Diegar Posted September 29, 2007 Share Posted September 29, 2007 I have a search page, that you enter a name, and it searches the DB for that name. If there are results, they are displayed. If there are no results, it tells you that your search for "whatever" came back with zero results, and adds a hyperlink to that line. The hyperlink takes you to a form where you can add a new entry, but what i want, is for the word they searched for, to be carried to the addcontactform.php, so i can place it in the name field automatically. if ($numrows == 0) { echo "<tr><td width='100%' bgcolor='CCCCCC' colspan='4'><font face='Arial, Helvetica, sans-serif'>Sorry, your search: "" . $trimmed . "" returned zero results <a href=\"addContactForm.php\">( Add a new contact )</a></font></td></tr>"; } Is there a way to have the $trimmed variable attached to that hyperlink, like $_GET would do from a form, so the link would be like '../addContactForm.php?q=whatever'? Link to comment Share on other sites More sharing options...
Diegar Posted September 29, 2007 Author Share Posted September 29, 2007 Nevermind. I figured it out on my own. It was easy, so i feel a little ashamed for asking, but it was just adding '?q=$var' to the end of the link. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.