View Single Post
  #3 (permalink)  
Old 02-05-2008, 08:48 AM
BigAlReturns's Avatar
BigAlReturns BigAlReturns is offline
Moderator Extraordinaire!
 
Join Date: Dec 2007
Location: The Wirral, England
Posts: 291
Send a message via MSN to BigAlReturns
Default

If I understand you correctly, I think the best way to go about this is using a get variable. Here is the way that I would structure it:
Code:
employeepage
<a href="editpage.php?empid=1">John Smith</a>
<a href="editpage.php?empid=2">Mike Jones</a>
etc. etc.
I've assumed here that you are using a database to store employee details, and that within your database each employee has an ID - this would be a typical way to structure it. You could easily then cycle through the employees with a WHILE loop, spitting out the ID and name in the appropriate places as the links above show. Then, your edit page gets the ID from the URL, and uses this to query the database for the appropriate employees records, something like this:
Code:
editpage.php
$empid=$_GET['empid'];
$query="SELECT empid,empname,etc,etc FROM employees WHERE empid='" . $empid . "'";
$result=mysql_query($query);
// etc etc retrieving results as you normally would
This is how I'd go about it, if your basic approach is radically different, or you can't see how you could integrate this approach into your existing code, then you will have to post your code up here, and we can help you out with how to solve the problem. Hope this helps.
Reply With Quote