Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Undefined Variable Help

$
0
0

I know undefined variables are simple to fix, but I can't seem to get this fixed at all.

<?php 
include ("./inc/headerinc.php");

mysql_connect("localhost","root","");
mysql_select_db("mid");

$email = $_GET['email'];
$check_email = mysql_query("SELECT * FROM users WHERE email='$email'");
$count  = mysql_num_rows($check_email);
if ($count == 1) {
while ($row = mysql_fetch_assoc($check_email)) {
      $id = $row['id'];
      $firstname = $row['firstname'];
      $lastname = $row['lastname'];
      $email = $row['email'];
      $password = $row['password'];

      echo "<h2>$firstname's Profile</h2><br />
      Name: $firstname $lastname<br />
      Email: $email
      ";
}
}
?>

In line 7 'email' is undefined.

When I try using isset($_GET ['email']) the error goes away, but none of the information that's suppose to echo is displayed.


Viewing all articles
Browse latest Browse all 13200

Trending Articles