Posted By

karindalziel on 01/20/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Constructing a URL


 / Published in: PHP
 

I'm trying to find a way to auto forward to the constructed URL instead of just providing a link.

  1. <?
  2. $searchField = $_REQUEST["searchField"];
  3. if (empty($searchField)){
  4. print <<<HERE
  5.   <form>
  6.   Please enter your name:
  7.   <input type = "text"
  8.   name = "searchField"><br>
  9.   <input type = "submit">
  10.   </form>
  11. HERE;
  12. } else {
  13. print "<a href=\"http://google.com/search?q=";
  14. print $searchField;
  15. print "\">Click Here</a>";
  16. } //end
  17. ?>

Report this snippet  

You need to login to post a comment.