Steveo31
February 24th, 2004, 01:03 AM
I'm learnin PHP, so be nice :p
This is givin me an error I can't get around... could you take a look?
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(isset($name) && isset($address) && isset($comments)){
$name=$_POST['name'];
$address=$_POST['address'];
$comments=$_POST['comments'];
print "<table width=\"100%\" height=\"30%\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
Name: $_GET['name']<br>
Email: $_GET['address']<br>
Comments: $_GET['comments']<br>
</td>
</tr>
</table>" or die(php_error());
}else{
print "<table width=\"100%\" height=\"30%\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
Please fill out the form.\n
</td>
</tr>
</table>";
}
}
?>
<form action="<? $_SERVER['PHP_SELF'] ?> " method="post">
<p>
Name: <input type="text" name="name">
</p>
<p>
E-Mail: <input type="text" name="address">
</p>
<p>
Comments: <textarea cols="20" rows="10" name="comments"></textarea>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
</body>
</html>
Error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\easyphp1-7\www\tester.php on line 17
Thanks.
This is givin me an error I can't get around... could you take a look?
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(isset($name) && isset($address) && isset($comments)){
$name=$_POST['name'];
$address=$_POST['address'];
$comments=$_POST['comments'];
print "<table width=\"100%\" height=\"30%\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
Name: $_GET['name']<br>
Email: $_GET['address']<br>
Comments: $_GET['comments']<br>
</td>
</tr>
</table>" or die(php_error());
}else{
print "<table width=\"100%\" height=\"30%\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td>
Please fill out the form.\n
</td>
</tr>
</table>";
}
}
?>
<form action="<? $_SERVER['PHP_SELF'] ?> " method="post">
<p>
Name: <input type="text" name="name">
</p>
<p>
E-Mail: <input type="text" name="address">
</p>
<p>
Comments: <textarea cols="20" rows="10" name="comments"></textarea>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
</body>
</html>
Error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\easyphp1-7\www\tester.php on line 17
Thanks.