iDenning
25-07-2009, 07:32 PM
Hai
I've been following a tutorial
http://www.youtube.com/watch?v=kEvVlULS2pE&feature=channel
And these are my codes:
Loginforms.php
<?
include(prehtml.php);
?>
<html>
<head>
<title>
Login
</title>
</head>
<body>
<!-- Login form -->
<form action="loginforms_handler.php" method="post">
Username <input type="text" name="username" value="username">
Password <input type="password" name="password" value="password">
<input type="submit" value="Login">
</form>
</body>
</html>
And this is my loginforms_handler.php
<?
$username = $_post=[username];
$password = $_post=[password];
$con = mysql_connect ('localhost', 'denning_test', 'test');
mysql_select_db('denning_test', $con);
$query = "SELECT * FROM users WHERE username='" . $username . "' AND password='" . $password . "'";
$run = mysql_query($query);
$results = mysql_affected_rows();
echo $results;
?>
I get this error:
Warning: include(prehtmlphp) [function.include (http://joinhabbo.co.uk/test/function.include)]: failed to open stream: No such file or directory in /home/denning/public_html/test/loginforms.php on line 2
Warning: include(prehtmlphp) [function.include (http://joinhabbo.co.uk/test/function.include)]: failed to open stream: No such file or directory in /home/denning/public_html/test/loginforms.php on line 2
Warning: include() [function.include (http://joinhabbo.co.uk/test/function.include)]: Failed opening 'prehtmlphp' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/denning/public_html/test/loginforms.php on line 2
Whats wrong with it? All help appreciated :)
I've been following a tutorial
http://www.youtube.com/watch?v=kEvVlULS2pE&feature=channel
And these are my codes:
Loginforms.php
<?
include(prehtml.php);
?>
<html>
<head>
<title>
Login
</title>
</head>
<body>
<!-- Login form -->
<form action="loginforms_handler.php" method="post">
Username <input type="text" name="username" value="username">
Password <input type="password" name="password" value="password">
<input type="submit" value="Login">
</form>
</body>
</html>
And this is my loginforms_handler.php
<?
$username = $_post=[username];
$password = $_post=[password];
$con = mysql_connect ('localhost', 'denning_test', 'test');
mysql_select_db('denning_test', $con);
$query = "SELECT * FROM users WHERE username='" . $username . "' AND password='" . $password . "'";
$run = mysql_query($query);
$results = mysql_affected_rows();
echo $results;
?>
I get this error:
Warning: include(prehtmlphp) [function.include (http://joinhabbo.co.uk/test/function.include)]: failed to open stream: No such file or directory in /home/denning/public_html/test/loginforms.php on line 2
Warning: include(prehtmlphp) [function.include (http://joinhabbo.co.uk/test/function.include)]: failed to open stream: No such file or directory in /home/denning/public_html/test/loginforms.php on line 2
Warning: include() [function.include (http://joinhabbo.co.uk/test/function.include)]: Failed opening 'prehtmlphp' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/denning/public_html/test/loginforms.php on line 2
Whats wrong with it? All help appreciated :)