home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / PHP / redir.php3.txt < prev    next >
Encoding:
Text File  |  2002-05-06  |  1.2 KB  |  35 lines

  1. redir.php3 
  2.  
  3. a simple redirection script for use with forms or..? 
  4.  
  5.  
  6.  
  7. <?php
  8. // --------------------------------------------------------------------- 
  9. // a working example is at http://demonx.dhis.org/redir.php3 
  10. // a simple redirection script, examples of usage: 
  11. // http://whateveryoursiteis.com/redir.php3?url=http://www.php.net 
  12. //  or several html forms work as well, 
  13. //  <form method="POST" action="http://whatever.com/redir.php3"> 
  14. //  <SELECT NAME="url"> 
  15. // <option value="http://mysite.com">whois.php3">Domain lookup</option> 
  16. // <option value="http://mysite.com/bleh.phtml">somthing</option> 
  17. // etc........ 
  18. // you get the picture :) problems? mail gh0ul@FireStar.org 
  19. // or visit http://www.linuxfreak.org 
  20. // --------------------------------------------------------------------- 
  21.  
  22. if ($url) {
  23. header( "Location: $url");
  24. }
  25. echo  "<html><head>\n";
  26. echo  "<title>PHP3: Website redirection script</title></head>";
  27. echo  "<b>redirect to?</b><br>\n";
  28. echo  "<form action=redir.php3>\n";
  29. echo  "
  30. <input type=text size=40 name=url value=http://>
  31. <input type=submit name=submit value=submit><br>";
  32. echo  "</p></form>\n";
  33. echo  "</html>";
  34. ?>
  35.