College student S.O.S. need help with some code
Posted: Thu May 20, 2010 4:17 pm
Here is the code can anyone tell me where im going wrong the code is not perfect but i am concerned with why im not getting any data back from the query.sql injections are the furthest thing from my mind at the present moment this is a project for school
Code: Select all
<?php
include 'databaseconnect2.php';
$firstname = $_GET["firstname"];
$email=$_GET["email"];
$password=$_GET["Password"];
$sql="Select password from customer where Email Like '% ".$email." %';";
$result= mysql_query($sql);
$row = mysql_fetch_row($result);
$password2= $row[0];
echo $password2;
function writeName($email,$password,$password2)
{
if ($password2 == $password)
echo "<h1>Welcome back " .$firstname."</h1>";
else
echo "<h1>Invalid login</h1>";
}
writeName($email,$password,$password2);
?>