I've just started messing around with PHP and believe it or not its extremely frustrating haha. Anyway, I wanted to make a simple input form that would display the info after submitting it...
The script is a simple html script, which calls a php script passing
it the variables which it got by the forms:
**************H TML doc. named "insert.htm"*** *************** ******
<html>
<head>
<title>HTML Form</title>
</head>
<body>
<form ACTION="script1 .php" METHOD=POST>
First Name<input TYPE=TEXT NAME="FirstName " SIZE=20><br>
Last Name <input TYPE=TEXT NAME="LastName" SIZE=20><br>
E-mail Address <input TYPE=TEXT NAME="Email" SIZE=60><br>
Comments <textarea NAME="Comments" ROWS=5 COLS=40></textarea><br>
<input TYPE=SUBMIT NAME="SUBMIT" VALUE="Submit!" >
</form>
</body>
</html>
*************** ************PHP script named "script1.php"** *************** *****
<HTML>
<HEAD>
<TITLE>Form Results</title>
<BODY>
<?
$FirstName = $_POST["FirstName"];
$LastName = $_POST["LastName"];
$Email = $_POST["Email"];
$Comments = $_POST["Comments"];
?>
<?php
/* This page receives and handles the data generated by "insert.htm l".
*/
print "Your first name is $_POST["FirstName"].<BR>\n";
[color=blue]
print "Your last name is $_POST["LastName"].<BR>\n";
[color=blue]
print "Your E-mail is $_POST["Email"].<BR>\n";
[color=blue]
print "This is what you had to say:<BR>\n$_POS T["Comments"]<BR>\n";
[color=blue]
?>
</BODY>
</HTML>
I keep getting this error :
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/grademyc/public_html/script1.php on line 17
with line 17 being
print "Your first name is $_POST["FirstName"].<BR>\n";
[color=blue]
i'm new to all this so i'm sure i've made mistakes somewhere...
please help...thanks!
The script is a simple html script, which calls a php script passing
it the variables which it got by the forms:
**************H TML doc. named "insert.htm"*** *************** ******
<html>
<head>
<title>HTML Form</title>
</head>
<body>
<form ACTION="script1 .php" METHOD=POST>
First Name<input TYPE=TEXT NAME="FirstName " SIZE=20><br>
Last Name <input TYPE=TEXT NAME="LastName" SIZE=20><br>
E-mail Address <input TYPE=TEXT NAME="Email" SIZE=60><br>
Comments <textarea NAME="Comments" ROWS=5 COLS=40></textarea><br>
<input TYPE=SUBMIT NAME="SUBMIT" VALUE="Submit!" >
</form>
</body>
</html>
*************** ************PHP script named "script1.php"** *************** *****
<HTML>
<HEAD>
<TITLE>Form Results</title>
<BODY>
<?
$FirstName = $_POST["FirstName"];
$LastName = $_POST["LastName"];
$Email = $_POST["Email"];
$Comments = $_POST["Comments"];
?>
<?php
/* This page receives and handles the data generated by "insert.htm l".
*/
print "Your first name is $_POST["FirstName"].<BR>\n";
[color=blue]
print "Your last name is $_POST["LastName"].<BR>\n";
[color=blue]
print "Your E-mail is $_POST["Email"].<BR>\n";
[color=blue]
print "This is what you had to say:<BR>\n$_POS T["Comments"]<BR>\n";
[color=blue]
?>
</BODY>
</HTML>
I keep getting this error :
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/grademyc/public_html/script1.php on line 17
with line 17 being
print "Your first name is $_POST["FirstName"].<BR>\n";
[color=blue]
i'm new to all this so i'm sure i've made mistakes somewhere...
please help...thanks!
Comment