php search database for row

Posted by Brenden Morley on Stack Overflow See other posts from Stack Overflow or by Brenden Morley
Published on 2012-12-13T04:49:14Z Indexed on 2012/12/13 5:03 UTC
Read the original article Hit count: 190

Filed under:
|
|

Okay I got code the code to pull data based on a users account number

well here is what im using (And yes I know it isnt safe now that is the reason for my post)

<?php

include('config.php');

$user_info = fetch_user_info($_GET['AccountNumber']);

?>
<html>
<body>
<div>
<?php
if ($user_info === false){
$Output = 'http://www.MyDomain.Com/';
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$Output.'">';
}else{
?>
<center>
<title><?php echo $user_info['FirstName'], ' ', $user_info['LastName'], ' - ',     $user_info['City'], ', ', $user_info['State']; ?> - Name of site</title>

So basically what this code is allowing me to do is have a file called Profile.php And when a user visits this this page it will return the data

Like this http://MyDomain.com/Profile.php?AccountNumber=50b9c965b7c3b

How can I do this securely cause right now its using a get method really unsafe to retive the account number from the url bar.

© Stack Overflow or respective owner

Related posts about php

Related posts about html