Jump to content

Problems displaying info from a form!


jackie11

Recommended Posts

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 operate

Any help or suggestions would be great

Thanks

Jackie



[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

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 .php

Thanks

Jackie

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.