Can somebody tell me why this isn't working:
form.html:
----------
<html>
<head>
<title>Form</title>
</head>
<body>
<FORM ACTION="HandleForm.php" METHOD="GET">
Firs Name <INPUT TYPE=TEXT NAME="FirstName" SIZE=20><BR>
Last Name <INPUT TYPE=TEXT NAME="LastName" SIZE=40><BR>
E-Mail <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>
HandleForm.php:
----------------
<html>
<head>
<title>Form Results/Using Strings</title>
</head>
<body>
<?php
extract($_GET);
$FirstName = Trim($FirstName);
$LastName = Trim($LastName);
$Email = Trim($Email);
$Comments = Trim($Comments);
$Name = $FirstName . " " . $LastName;
print("Your Name is $Name<BR>\n" );
print("Your E-Mail address is $Email<BR>\n" );
print("This is what you had to say: <BR>\n $Comments<BR>\n" );
$Name = urlencode($Name);
print ("<P>Click <a href=http://www.htmlforums.com/archive/index.php/\"welcome.php?Name=$Name\"> here</a> to see your personalized greeting!\n" );
?>
</body>
</html>
welcome.php:
-------------
<html>
<head>
<title>Welcome</title>
</head>
<body>
<?php
print ("<B><CENTER>Hello, $Name</CENTER></B>\n" );
?>
</body>
</html>
The problem is that in welcome.php, the $Name variable is empty, i don't know how to pass the value of $Name in HandleForm.php to $Name in welcome.php. In the way I'm doing it (source code above), is not working.
Can anybody help me??, i'm very new in PHP.
Just for the record, i'm using PHP 4.3.3 in Windows 98 SE with Personal Web Server.
Sorry for my poor english, and thanks in advance.
Matias.ask in the PHP forum you are using the wrong variable in welcome.php. you have to use the GET superglobal
<html>
<head>
<title>Welcome</title>
</head>
<body>
<?php
print ("<B><CENTER>Hello, {$_GET['Name']}</CENTER></B>\n" );
?>
</body>
</html>Thank you very much for taking the time to answer my question. I've already fix my problem, but thank you very much for your time.
Sorry for my poor english.
Matias
form.html:
----------
<html>
<head>
<title>Form</title>
</head>
<body>
<FORM ACTION="HandleForm.php" METHOD="GET">
Firs Name <INPUT TYPE=TEXT NAME="FirstName" SIZE=20><BR>
Last Name <INPUT TYPE=TEXT NAME="LastName" SIZE=40><BR>
E-Mail <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>
HandleForm.php:
----------------
<html>
<head>
<title>Form Results/Using Strings</title>
</head>
<body>
<?php
extract($_GET);
$FirstName = Trim($FirstName);
$LastName = Trim($LastName);
$Email = Trim($Email);
$Comments = Trim($Comments);
$Name = $FirstName . " " . $LastName;
print("Your Name is $Name<BR>\n" );
print("Your E-Mail address is $Email<BR>\n" );
print("This is what you had to say: <BR>\n $Comments<BR>\n" );
$Name = urlencode($Name);
print ("<P>Click <a href=http://www.htmlforums.com/archive/index.php/\"welcome.php?Name=$Name\"> here</a> to see your personalized greeting!\n" );
?>
</body>
</html>
welcome.php:
-------------
<html>
<head>
<title>Welcome</title>
</head>
<body>
<?php
print ("<B><CENTER>Hello, $Name</CENTER></B>\n" );
?>
</body>
</html>
The problem is that in welcome.php, the $Name variable is empty, i don't know how to pass the value of $Name in HandleForm.php to $Name in welcome.php. In the way I'm doing it (source code above), is not working.
Can anybody help me??, i'm very new in PHP.
Just for the record, i'm using PHP 4.3.3 in Windows 98 SE with Personal Web Server.
Sorry for my poor english, and thanks in advance.
Matias.ask in the PHP forum you are using the wrong variable in welcome.php. you have to use the GET superglobal
<html>
<head>
<title>Welcome</title>
</head>
<body>
<?php
print ("<B><CENTER>Hello, {$_GET['Name']}</CENTER></B>\n" );
?>
</body>
</html>Thank you very much for taking the time to answer my question. I've already fix my problem, but thank you very much for your time.
Sorry for my poor english.
Matias