Redirect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deppeler
    New Member
    • Jul 2007
    • 40

    Redirect

    I have a script that edits/writes a flat file DB.
    After execution the script redirects the user to another script - advstoy.pl (to choose another option).
    Is there a way to make the script reload the same page as was just edited?

    Here is a sample of the code:
    Code:
    $databaseview='http://www.mysite.org/cgi-bin/admintoy/advstoy.pl';
    print "Location: $databaseview\n\n";
    I tried this:
    Code:
    print "Location: http://www.mysite.org$ENV{QUERY_STRING}\n\n";
    but it comes up with "Page Cannot be Displayed" error, I think because it is in the cgi-bin.

    Is there a way to get the same page of the script to reload, so the user can see the result of their edit?

    thanks
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    There really is not enough information to offer more than a general suggestion. You need to program the functionality you want into your advstoy.pl script and send the relevent parameters back to the script in the print "location:" line.

    Code:
    print "Location: http://www.you.com/cgi-bin/advstoy.pl?page=foo&key=value&key=value\n\n";
    That should work as long as advstoy.pl knows what to do with the query string data it recieves.

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      In your post this looks like it should work if the URL is correct:

      Code:
      $databaseview='http://www.mysite.org/cgi-bin/admintoy/advstoy.pl';
      print "Location: $databaseview\n\n";

      PS:

      Make sure you are using the "strict" pragma in your perl programs.

      Comment

      • deppeler
        New Member
        • Jul 2007
        • 40

        #4
        thanx a heap!

        Paul

        Comment

        Working...