jackie11 Posted January 21, 2007 Share Posted January 21, 2007 Hi everyone, I am having some problems getting information that I have collected from a form (inputted by users) to display on my page (simple problem, but I am new to this!), the code I am using is below, I know it is all over the place, its because I have been trying different thing to get it to work. I have been able to create pages to displayed info from my db and have created echos to confirm what users have impputted into a form but I just can seem to get this one to work.Any suggestions on how best to set this up, I want it to display in the table I have created and have tried to echo the table etc but can't seem to get it to operateAny help or suggestions would be great ThanksJackie[code]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>form_display.php</title> <link rel="stylesheet" href="etc/TJConsultants.css"></head><body><br><div id="wrapper"><div id="header"><div style="text-align: center;"><br></div><br></div><div id="centercolumn"><div style="text-align: center;"><br></div><div style="text-align: center;"><hr style="width: 100%; height: 2px;"><font style="color: rgb(21, 27, 84);" size="+3">Employee Details<br></font><hr style="width: 100%; height: 2px;"><font style="color: rgb(21, 27, 84);" size="+3"><br></font><?php $Employee_ID = $GET['Employee_ID'];$Surname = $GET['Surname'];$Forename = $GET['Forename'];$Job_title = $GET['Job_title'];$Office_location = $GET['Office_location'];$Telephone = $GET['Telephone'];$Email = $GET['Email'];$Expertise = $GET['Expertise'];$Hobbies = $GET['Hobbies'];$DOB = $GET['DOB'];$Picture = $GET['Picture'];print "$_GET[Employee_ID]<br>";?> <table style="text-align: left; margin-left: auto; margin-right: auto; width: 490px; height: 495px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="text-align: left; vertical-align: middle; font-family: Tahoma; color: rgb(0, 0, 102);">Employee ID:</td> "<td colspan="10":> "print=" $_get[employee_id]"<br> </td> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Surname:</td> <td colspan="10":>$Surname</td> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Forename:</td> <td colspan="10":>$Forename</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Job Title:</td> <td colspan="10":>$Job_title</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">DOB:</td> <td colspan="10":>$Office_location</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Telephone:</td> <td colspan="10":>$Telephone</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Email:</td> <td colspan="10":>$Email</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Office Location:</td> <td colspan="10":>$Expertise</td><br> </tr> <tr> <td style="text-align: left; font-family: Tahoma; color: rgb(0, 0, 102);">Expertise:</td> <td colspan="10":>$Hobbies</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Hobbies:</td> <td colspan="10":>$DOB</td><br> </tr> </tbody></table><br><hr style="width: 100%; height: 2px;"><div style="text-align: left;"><a href="index.html"><img style="border: 0px solid ; width: 94px; height: 46px;" alt="Home" src="etc/Home_button.JPG"></a><br></div><hr style="width: 100%; height: 2px;"></div></div><div id="footer"><p style="text-align: left;"></p></div></div></body></html>[/code] Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/ Share on other sites More sharing options...
ted_chou12 Posted January 21, 2007 Share Posted January 21, 2007 how is your data saved? Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/#findComment-165574 Share on other sites More sharing options...
mattd8752 Posted January 21, 2007 Share Posted January 21, 2007 $Picture = $GET['Picture'];Should be$_GET['picture']There might be other errors, if there still are, post em Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/#findComment-165579 Share on other sites More sharing options...
jackie11 Posted January 21, 2007 Author Share Posted January 21, 2007 Hi there Thanks for the replies, the variable layout you suggested works great, but I am now looking to get them to display in the table I greated, how do I echo this and set it up properly?[code]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>form_display.php</title> <link rel="stylesheet" href="etc/TJConsultants.css"></head><body><br><div id="wrapper"><div id="header"><div style="text-align: center;"><br></div><br></div><div id="centercolumn"><div style="text-align: center;"><br></div><div style="text-align: center;"><hr style="width: 100%; height: 2px;"><font style="color: rgb(21, 27, 84);" size="+3">Employee Details<br></font><hr style="width: 100%; height: 2px;"><font style="color: rgb(21, 27, 84);" size="+3"><br></font><?php $Employee_ID = $_GET['Employee_ID'];$Surname = $_GET['Surname'];$Forename = $_GET['Forename'];$Job_title = $_GET['Job_title'];$Office_location = $_GET['Office_location'];$Telephone = $_GET['Telephone'];$Email = $_GET['Email'];$Expertise = $_GET['Expertise'];$Hobbies = $_GET['Hobbies'];$DOB = $_GET['DOB'];$Picture = $_GET['Picture'];print "$Employee_ID";Print "$Surname";?> <table style="text-align: left; margin-left: auto; margin-right: auto; width: 490px; height: 495px;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="text-align: left; vertical-align: middle; font-family: Tahoma; color: rgb(0, 0, 102);">Employee ID:</td> "<td colspan="10":> print=" $Employee_ID"<br> </td> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Surname:</td> <td colspan="10":>$Surname</td> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Forename:</td> <td colspan="10":>$Forename</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Job Title:</td> <td colspan="10":>$Job_title</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">DOB:</td> <td colspan="10":>$Office_location</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Telephone:</td> <td colspan="10":>$Telephone</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Email:</td> <td colspan="10":>$Email</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Office Location:</td> <td colspan="10":>$Expertise</td><br> </tr> <tr> <td style="text-align: left; font-family: Tahoma; color: rgb(0, 0, 102);">Expertise:</td> <td colspan="10":>$Hobbies</td><br> </tr> <tr> <td style="font-family: Tahoma; color: rgb(0, 0, 102);">Hobbies:</td> <td colspan="10":>$DOB</td><br> </tr> </tbody></table><br><hr style="width: 100%; height: 2px;"><div style="text-align: left;"><a href="index.html"><img style="border: 0px solid ; width: 94px; height: 46px;" alt="Home" src="etc/Home_button.JPG"></a><br></div><hr style="width: 100%; height: 2px;"></div></div><div id="footer"><p style="text-align: left;"></p></div></div></body></html>[/code]PS I have saved it as a .phpThanksJackie Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/#findComment-165614 Share on other sites More sharing options...
feck Posted January 21, 2007 Share Posted January 21, 2007 Hi Jackie,Where you place your variables, like:<td colspan="10":>$Surname</td>try this:<td colspan="10":><?php echo $Surname ?></td>hope this worksregardsfeck Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/#findComment-165638 Share on other sites More sharing options...
webren Posted January 21, 2007 Share Posted January 21, 2007 You can try what feck did, and you can also place your entire HTML within the PHP script. That way you don't have to constantly start and end PHP tags. Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/#findComment-165652 Share on other sites More sharing options...
jackie11 Posted January 21, 2007 Author Share Posted January 21, 2007 Hi Thanks for the replies, it worked great Thanks for the help!Regards Jackie :) :) :) Link to comment https://forums.phpfreaks.com/topic/35084-problems-displaying-info-from-a-form/#findComment-165658 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.