Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Redirecting client-side based on response from server

    Please can someone remind me how to do this? I need the user post some data to a CGI program which returns HTML. Based on the data returned, I may need to redirect the user. I've done this before but forgotten where and how! I'm sure I used a Javascript function on the results page. It needs to read the response and act before the initial response is displayed.

    Any pointers much appreciated!

    lionhart

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,045
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Let the CGI ouput this meta tag inside the <head> tag based on the data returned.

    <meta http-equiv="refresh" content="0; theURL" />

  • #3
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    clarification

    Thanks for the reply. Perhaps I should explain the problem better.

    I have a form for the user to submit a query to a CGI program. The CGI is not mine and I dont have the source, so I can't change it. The CGI program will either return the data that I want to display or an error. I want to trap the error before it is displayed and redirect the user to a different form.

    I've done something similar to this before. I think I sent the form data to another page instead of directly to the CGI. I think I then had a javascript function which called the CGI program and looked at the response before displaying it. If the response was an error it called a different page rather than displaying the data.

    Unfortunately I've forgotten how I called the CGI and examined the response without displaying it.

    lionhart


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •