Parse error in code
<?php
//Print a greeting if the form was submitted
if ($_POST['user']) {
print "Hello, ";
//Print what was submitted in the form parameter called user
print $_POST['user'];
print "!";
}
else {
//otherwise, print the form
print <<<_HTML_
Your Name:
_HTML_;
}
?>
mikeandike22
Nearly a Posting Virtuoso
1,496 posts since May 2004
Reputation Points: 33
Solved Threads: 19
I fixed the problem here is the updated code if you would like to compare
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<?php
//Print a greeting if the form was submitted
if ($_POST['user']) {
print 'Hello, ';
//Print what was submitted in the form parameter called user
print $_POST['user'];
print "!";
}
else {
//otherwise, print the form
print <<<_HTML_
<form method="post" action="$SERVER[PHP_SELF]">
Your Name: <input type="text" name="user">
<br/>
<input type="submit" value="Say Hello">
</form>
_HTML_;
}
?>
</body>
</html>
i think it was the double quotes instead of the single in 'hello, '
mikeandike22
Nearly a Posting Virtuoso
1,496 posts since May 2004
Reputation Points: 33
Solved Threads: 19