Hello,
I am learning PHP/MySQL at the moment.
I found what looked like an excellent tutorial site, but the first
program I wrote already left me with an error to which I cannot find an
answer.
I typed in the following program:
<html>
<head><title>Co nnect Server</title></head>
<body>
<?
$link =
mysql_connect(" localhost",$_PO ST['username'],$_POST['password'])or
die("Connect Error: ".mysql_error() );
print "Successful ly connected.\n";
mysql_close($li nk);
?>
</body>
</html>
Iobviously typed in my own username and password instead of 'username'
and 'password' in the line
"mysql_connect( "localhost",$_P OST['username'],$_POST['password'])or...."
However, I keep getting the following error when running it from my
browser:
"Parse error: syntax error, unexpected T_VARIABLE in C:\Program
Files\Abyss Web Server\htdocs\l ogon.php on line 5"
Can anyone enlighten me please ?
I use PHP v 5.1.1.0 and MySQL v 4.1.13
Any help will be much appreciated.
TIA,
Newsscanner.
I am learning PHP/MySQL at the moment.
I found what looked like an excellent tutorial site, but the first
program I wrote already left me with an error to which I cannot find an
answer.
I typed in the following program:
<html>
<head><title>Co nnect Server</title></head>
<body>
<?
$link =
mysql_connect(" localhost",$_PO ST['username'],$_POST['password'])or
die("Connect Error: ".mysql_error() );
print "Successful ly connected.\n";
mysql_close($li nk);
?>
</body>
</html>
Iobviously typed in my own username and password instead of 'username'
and 'password' in the line
"mysql_connect( "localhost",$_P OST['username'],$_POST['password'])or...."
However, I keep getting the following error when running it from my
browser:
"Parse error: syntax error, unexpected T_VARIABLE in C:\Program
Files\Abyss Web Server\htdocs\l ogon.php on line 5"
Can anyone enlighten me please ?
I use PHP v 5.1.1.0 and MySQL v 4.1.13
Any help will be much appreciated.
TIA,
Newsscanner.
Comment