sunicani Posted September 16, 2009 Share Posted September 16, 2009 I use a form in html to display some of 'welcome' information via PHP, however, no related Name displayed aftering submitting 'First Name' and 'Last Name' in html Page, and, the specific code shown below seperately,--html-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Untitled Document</title></head><body><div align="center"><form action="welcome.php" method="post">First Name: <input type="text" name="firstname" /><br />Last Name: <input type="text" name="lastname" /><br /><input type="submit" value="Go" /></form></div></body></html>--PHP--welcome.php--<?phpecho ("Welcome to our Web site, $firstname");?>well, after clicking "Submit" button, just shown,"Welcome to our Web site,"but not the expected one like "Welcome to our Web site, cane scofield!"experts here who can guide me, thanks a lot, mates! Link to comment Share on other sites More sharing options...
dsonesuk Posted September 16, 2009 Share Posted September 16, 2009 try:<?php$firstname=$_POST["firstname"];echo ("Welcome to our Web site, ".$firstname);?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.