I am trying to build a log in script for my website.
When I upload the site and try the form I get this error.
Server error
The website encountered an error while retrieving http://emscomplete.com/php/login.php. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
This is the script I am using for my connection
<?php
/ Created By Adam Khoury @ www.developphp.com
-----------------------June 19, 2008-----------------------/
// "die()" will exit the script and show an error if something goes wrong with the "connect" or "select" functions.
// A "mysql_connect()" error usually means your connection specific details are wrong
// A "mysql_select_db()" error usually means the database does not exist.
// Place db host name. Usually is "localhost" but sometimes a more direct string is needed
$db_host = "emscompletecom.ipagemysql.com";
// Place the username for the MySQL database here
$db_username = "jblevins";
// Place the password for the MySQL database here
$db_pass = "*****";//mycorrect password is entered here
// Place the name for the MySQL database here
$db_name = "fdcomplete";
mysql_connect("$db_host","$db_username","$db_pass") or die(mysql_error());
mysql_select_db("$db_name") or die("no database by that name");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
This is my log in script
<?php
/**
@author
@copyright 2011
*/
include ("mysqlconnect.php");
if ($_POST['login'])
{
//get info
$username = $_POST['username'];
$password = $_POST['password'];
if ($username && $password)
{
$query = mysql_query("SLECT * FROM employee");
while ($getrows = mysql_fretch_assoc($query))
{
$dbuser = $getrows['email'];
$dbpass = $getrows['password'];
}
}
if (($dbpass == $password) && ($dbuser == $password))
{
include ("loggedin.php");
} else
{
echo "Login Failed please check your username and password and try again.";
}
else
die("The username and password field should not be left blank. ")
}
?>
I cant seem to get this to work I have tried other ways to write this script without any luck...
Any help appreciated, thank you in advanced.