I am new to PHP.
I'm trying to write a simple mysql login script, just to get my feet wet with php.
I have copied most of this code from an example I found on the web, but it just doesn't seem to work.
I call it from an html page that sends the various post variables. I have tested publishing the variables and they all seem to be sent just fine.
The following code simply prints out the statement "Login Test" and that is all. I get no error message telling me that why the connect statement is not working. And the line after the ?> does not print either. Two questions:
1) any idea why this is not working?
2) how can I access the error message to get some idea of how to trouble shoot this?
<html>
<body>
<p>Login test</p>
<?php
$u = $POST["user"];
$d = $POST["database"];
$p = $_POST["passwd"];
$dbcnx = mysql_connect("localhost", $u, $p);
if (! dbcnx)
echo("<p>Can't connect at this time</P>");
else
echo("<p>Succefully conected to $d</p>")
?>
<p>I can't see this line</p>
</body>
</html>