PDA

View Full Version : PHP Help needed.



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 :)

wsg14
25-07-2009, 09:38 PM
<?
include(prehtml.php);
?>

remove that from loginforms.php

DeejayMachoo$
25-07-2009, 10:29 PM
<?
include(prehtml.php);
?>

should be


<?
include("prehtml.php");
?>

Dentafrice
26-07-2009, 03:48 AM
Why are you putting parenthesis around include? It's a language construct.

Blob
26-07-2009, 08:41 AM
& Your including prehtml.php which doesn't seem to exist...

iDenning
26-07-2009, 01:02 PM
i screwed this one
i made a simple usersystem/chatbox and a download cms from a tut lol

Want to hide these adverts? Register an account for free!