I've seen tutorials on doing this sort of things echo'ing the results directly from the form into a different form on the following page however the issue I'm facing is slightly different and I can't find any threads that cover it, I'm sure someone will prove how much of a novice I am by answering this however.
I have a search form as shown here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ift.tt/kTyqzh"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Search Contacts</title> </head> <p><body> <h3>Search Contacts Details</h3> <p>You may search either by first or last name</p> <form method="post" action="search.php?go" id="client"> <input type="text" name="name"> <input type="submit" name="submit" value="Search"> </form> </body> </html> </p>
The results are then display in a table on the Search.PHP page, the code is shown here: enter code here
}
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Client/title>
<link href="/csstwo.css" type="text/css" rel="stylesheet">
</head>
<div id="Header">
<h1>Search results</h1>
<div id="Banner"></div>
<div id="logo"></div>
<div style="clear: both;"></div>
</div> <!-- /Header -->
<body>
<div id="nav">
<div id="nav_wrapper">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="">Client</a>
<ul>
<li><a href="client.php">Add a Client</a></li>
<li><a href="#">Manage Client</a></li>
</li><li><a href="#">Client List</a></li>
</ul>
<li><a href="">Case</a>
<ul>
<li><a href="case.php">Add a Case</a></li>
</li><li><a href="caselist.php">Manage Case</a></li>
</ul>
<li><a href=#">Help <img src="arrow.jpg"></a>
<ul>
<li><a href="#">Case</a></li>
<li><a href="#">Client</a></li>
</li><li><a href="#">Contacts</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="content">
<table width="70%" cellpadding="5" cellspace="5" position="centre">
<tr>
<td><strong>ID</strong></td>
<td><strong>Forename</strong></td>
<td><strong>Surname</strong></td>
<td><strong>Postcode</strong></td>
<td><strong>Address Line One</strong></td>
<td><strong>Address Line Two</strong></td>
<td><strong>Town/City</strong></td>
<td><strong>Contact Number</strong></td>
<td><strong>Manage Client</strong></td>
</tr>
<?php while ($row =mysql_fetch_array($result)) { ?>
<tr>
<td><?php echo $ID =$row ['ClientID'] ?></td>
<td><?php echo $FirstName =$row ['forename'] ?></td>
<td><?php echo $LastName =$row ['surname'] ?></td>
<td><?php echo $row ['postcode'] ?></td>
<td><?php echo $row ['addresslineone'] ?></td>
<td><?php echo $row ['addresslinetwo'] ?></td>
<td><?php echo $row ['towncity'] ?></td>
<td><?php echo $row ['contactnumber'] ?></td>
<td><a href='manageclient.php?id={$row['id']}'>Manage</a></td>
</tr>
<?php } ?>
</table>
</body>
I have a link at the end that takes you to Manageclient.php, the user would select 'Manage' client on the Search.php page that displays results. This would then take the user to Manageclient.php with a prepopulate form from the results of Search.php.
I'm probably being extremely stupid but I can't seem to carry the results from the Search.php and echo them into the form on Manageclient.php, I keep getting errors saying the variables are not defined.
I hope this makes sense and any help on this would be appreciated greatly.
Chris
Aucun commentaire:
Enregistrer un commentaire