I created a .php file and when I am trying to execute it via- localhost, it shows nothing. If the script is working fine, then it should print something on the screen. <- The basic idea of the script, but nothing is getting displayed.
<?php
$con = mysql_connect("localhost","somanshu","somanshu");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("james007", $con);
$result = mysql_query("SELECT * FROM info");
while($row = mysql_fetch_array($result))
{
if($_POST['mail'] == $row['email'])
{
echo "Logged In.<META HTTP-EQUIV=\"refresh\" CONTENT=\"0;URL=home\">";
}
else
{
$sql="INSERT INTO info (email, password)
VALUES
('$_POST[mail]','$_POST[pwd]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
else
{
echo "Added. <META HTTP-EQUIV=\"refresh\" CONTENT=\"0;URL=home\">";
}
}
}
mysql_close($con);
?>