Im still working through some exercises and have a problem getting my urlencode() to work this is my main code:
<?
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$Email = $_POST['Email'];
$Comments = $_POST['Comments'];
/* this page receives and handles the data generated by chapter3.htm */
$FirstName = trim($FirstName);
$LastName = trim($LastName);
$Email = trim($Email);
$Comments = trim($Comments);
$Name = $FirstName . " " . $LastName;
//print ("Your first name is $FirstName.<br>\n");
//print ("Your last name is $LastName.<br>\n");
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=\"welcome.php?
Name=$Name\">here </A> to see your personalised greeting!\n");
?>
This is the HREF tag which the handeform passes to:
<html>
<head>
<title>Welcome!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
print ("<b><center>Hello, $Name. </center></b>\n");
?>
</body>
</html>
Here is the error im getting once i hit that link word:
Notice: Undefined index: Name in C:\Program Files\Apache Group\Apache2\htdocs\adam\welcome.php on line 9
Hello, .
It looks like the welcome page just doesnt know what $Name is i looked at my source and it seems to be identicle to the book, but i wondered if anyone could help... i kow its simple problem and sorry to waste your time
TIA Adam


