home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / WEBSERVE / SAMBAR / DATA.1 / README.NPH < prev    next >
Text File  |  1997-06-29  |  7KB  |  136 lines

  1. ______________________________________________________________________________
  2. _ Redirection Script                Version 2.3                              _
  3. _ Created on 4/10/96                Last Modified: 05/30/96 13:45            _
  4. _ Scripts Found at:                 http://www.terminalp.com/scripts/        _
  5. _ Copyright 1996 By Jeff Carnahan   jeffc@terminalp.com                      _
  6. ______________________________________________________________________________
  7. _ If you run into any problems while trying to configure this scripts, help  _
  8. _ is available.  The steps you should take to get the fastest results, are:  _
  9. _       1) Read this file thoroughly                                         _
  10. _       2) If you are still having difficulty installing this script, send   _
  11. _          e-mail to: script-help@terminalp.com                              _
  12. _          Include any error messages you are receiving and as much detail   _
  13. _          as you can so I can spot your problem.  Also, please include      _
  14. _          the variables at the top of the script.                           _
  15. _                                                                            _
  16. _   Hopefully I will be able to help you solve your problems.  Thank you.    _
  17. ______________________________________________________________________________
  18. _ Copyright (C) 1996 Jeffrey D. Carnahan                                     _
  19. _                                                                            _
  20. _ This program is free software; you can redistribute it and/or modify       _
  21. _ it under the terms of the GNU General Public License as published by       _
  22. _ the Free Software Foundation; either version 2 of the License, or (at      _
  23. _ your option) any later version.                                            _
  24. _                                                                            _
  25. _ This program is distributed in the hope that it will be useful, but        _
  26. _ WITHOUT ANY WARRANTY; without even the implied warranty of                 _
  27. _ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           _
  28. _ General Public License for more details.                                   _
  29. _                                                                            _
  30. _ A full copy of the GNU General Public License can be retrieved from        _
  31. _ http://www.terminalp.com/scripts/copying.html                              _
  32. _                                                                            _
  33. _ - Jeff Carnahan <jeffc@terminalp.com>                                      _
  34. ______________________________________________________________________________
  35.  
  36.  
  37. This script is to be used to redirect users based upon the information
  38. stored in different form elements.  When users click on the Submit button,
  39. the script runs, and automatically sends them to the new URL.  This is
  40. very useful for people who want to have navigation forms, or simply
  41. Submit buttons where clicking on the button would redirect the user to a
  42. new location.
  43.  
  44. The script, nph-redr.pl, needs to be placed in your server's cgi-bin and the 
  45. anonymous WWW user must have the ability to read/execute the script.
  46.  
  47. **** IMPORTANT NOTE ****:
  48.         The script *MUST* be named 'nph-something' to run.. THE 'nph-' IS
  49.     CRUCIAL TO THE SCRIPT, IF IT ISN'T NAMED 'nph-something', IT WILL NOT
  50.     RUN!
  51.  
  52.     (Ok, I'm over the caps thing now.. <grin>)
  53.  
  54. Setting Up the Redirection Script:
  55. ==================================
  56.  
  57. The nph-redr.pl script does not have to be extensively configured to get 
  58. it to work.  In fact, there is only 1 line you need to modify under the 
  59. nph-redr.pl script. You must make sure the top line of the script to matches
  60. the location of you Perl interpreter.
  61.  
  62. You can find the location of your perl interpreter on your system, by
  63. executing the command: 'which perl' at the Unix command prompt.  A typical use
  64. of this command looks like this:
  65.  
  66. $ which perl
  67. /usr/local/bin/perl
  68.  
  69. In this case, you have just found that the location of Perl on your system to be
  70. "/usr/local/bin/perl".  To update the nph-redr.pl script, you need to append
  71. this value to '#!'.  So, for this example, the first line the nph-redr.pl 
  72. script should look like:
  73.  
  74. #!/usr/local/bin/perl
  75.  
  76. Necessary Variables:
  77. --------------------
  78.  
  79.     There Are None!  Woo!
  80.  
  81.     However, to configure the script for your WWW Server, you need to complete
  82.     the following steps:
  83.     
  84.     1) Type "chmod 755 nph-redir.pl" in the directory where nph-redir.pl resides.
  85.        (This makes your script executable)
  86.  
  87.     2) Get a glass of Milk and Cookies.
  88.  
  89. A Sample Session looks like:
  90.  
  91. <--- Start Of Captured Session --->
  92. $
  93. $ chmod 755 nph-redir.pl
  94. $
  95. <--- End Of Captured Session --->
  96.  
  97.  
  98.  
  99. Updating The HTML File:
  100. ------------------------
  101.     Next comes updating the given HTML file.  This should be simple, as you
  102.     only need to change the settings to your own liking.
  103.     First, note the different ways the script can be invoked.  With each
  104.     method, we are sending one feild of information to the script, and this
  105.     feild is named 'dest'.  This feild contains the Internet URL that you
  106.     want the user to be redirected to.
  107.  
  108.     If you want to redirect users to specific frames, you should add a
  109.     hidden field inside your document called 'target'.  An example of
  110.     redirecting a user to Yahoo, in a frame called "main" would look like
  111.     this:
  112.  
  113.     <form action="/nph-redir.pl" method="POST">
  114.       <input type="HIDDEN" name="target" value="main">
  115.       <input type="HIDDEN" name="dest"   value="http://www.yahoo.com">
  116.       <input type="SUBMIT" value="Click Here To Visit Yahoo">
  117.     </form>
  118.  
  119.     Note how I used a hidden field to point the script to the 'main' frame.
  120.  
  121.     Also note that since there are no variables you need to configure within
  122.     the script, you can use an unlimited amount of HTML pages to interface 
  123.     with it.
  124.     
  125. -----------------------------------------------------------------------------
  126.  
  127. History:
  128. Version 1.0     4/10/96 -  This script was created.
  129.         2.1     5/5/96  -  Possible problem with Spry Mosaic Fixed.
  130.         2.2     5/18/96 -  Added Frame Targeting (by request)
  131.         2.3     5/30/96 -  Fixed a problem w/ Frames..
  132.  
  133. -----------------------------------------------------------------------------
  134. Jeff Carnahan - (jeffc@terminalp.com) - http://www.terminalp.com/scripts/
  135.