I’m pretty new to PHP but i understand the basics but ive encountered a problem.
My website is using php and html base on a page named index.php the main problem is the checklogin.php page which the index.php submits to, i get this error on my server: Remote server or file not found
Check that the address is spelled correctly, or try searching for the site.
here is the checklogin.php code:
[php]<?php
session_start();
$username = $_POST[‘username’];
$password = $_POST[‘password’];
if ($username&&$password)
{
$connect = mysql_connect(“localhost”,“accessroot”,“hydrocarbon12345”); or die (“Couldn’t connect to database”)
mysql_select_db(“Members”) or die (“Couldn’t find database”)
$query = mysql_query(“SELECT * FROM Main WHERE username=’$username’”);
$numrows = mysql_num_rows($query);
if($numrows !=0)
{
while ($rows = mysql_fetch_assoc($query))
{
$dbusername = $row [‘username’]
$dbpassword = $row [‘password’]
}
if ($username==$dbusername&&$password==$dbpassword)
{
echo “Login successful. index.php</a”";
$_SESSION['username']=$dbusername;
}
else
die (Login Unsuccessful"
}
else
die (“LogiN Unsuccessful”)
}
echo
die (“please enter user and pass”)
}
?>[/php]
Cheers
Chris.