Jump to content

Adding a word or variable to a link?


Diegar

Recommended Posts

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

Archived

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

×
×
  • Create New...