REPOST: Calling CGI script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arenaTR

    REPOST: Calling CGI script

    I wanted to respost this question becuase I didn't think I was very clear in
    my earlier post.

    After doing some db work in a php script, from the same script, i want to
    call a CGI script with a bunch of strings. I've tried:

    header("Locatio n: http://mydomain.com/cgi-local/sendemail.cgi?[etc]");

    To no avail. Following this script is a simple header for an HTML page
    redirect, which does work. in fact, the cgi call doesn't work at all, but
    the script still successfully continues to the html page.

    So, if you can advise how to call cgi in this situation, or in general, i
    would be very appreciative. Thank you very much in advance!


  • Pedro Graca

    #2
    Re: REPOST: Calling CGI script

    arenaTR wrote:[color=blue]
    > After doing some db work in a php script, from the same script, i want to
    > call a CGI script with a bunch of strings. I've tried:
    >
    > header("Locatio n: http://mydomain.com/cgi-local/sendemail.cgi?[etc]");
    >
    > To no avail. Following this script is a simple header for an HTML page
    > redirect, which does work. in fact, the cgi call doesn't work at all, but
    > the script still successfully continues to the html page.[/color]

    ???? You have two redirects in the same script?

    I just tested
    <?php
    header('Locatio n: url1');
    header('Locatio n: url2');
    ?>

    and my browser always gets redirected to url2
    [color=blue]
    > So, if you can advise how to call cgi in this situation, or in general, i
    > would be very appreciative. Thank you very much in advance![/color]

    Can you change the cgi?
    If you can perhaps you could try redirecting to it and include a forward
    URL. When the cgi is done it will then redirect to that URL.

    header('Locatio n: http://mydomain.com/cgi-local/sendemail.cgi?[etc]'
    . '&fURL=[foward_URL]');


    If you can't change it, maybe using CURL functions in your script before
    redirecting will let you do what you want




    HTH
    --
    USENET would be a better place if everybody read: : mail address :
    http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
    http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
    http://www.expita.com/nomime.html : to 10K bytes :

    Comment

    • Andy Hassall

      #3
      Re: REPOST: Calling CGI script

      On 15 Mar 2004 22:19:34 GMT, Pedro Graca <hexkid@hotpop. com> wrote:
      [color=blue]
      >???? You have two redirects in the same script?
      >
      >I just tested
      ><?php
      >header('Locati on: url1');
      >header('Locati on: url2');
      >?>
      >
      >and my browser always gets redirected to url2[/color]

      And it looks invalid due to section 4.2 of the HTTP/1.1 spec:

      <http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4. 2>

      "Multiple message-header fields with the same field-name MAY be present in a
      message if and only if the entire field-value for that header field is defined
      as a comma-separated list [i.e., #(values)]. It MUST be possible to combine the
      multiple header fields into one "field-name: field-value" pair, without
      changing the semantics of the message, by appending each subsequent field-value
      to the first, each separated by a comma. The order in which header fields with
      the same field-name are received is therefore significant to the interpretation
      of the combined field value, and thus a proxy MUST NOT change the order of
      these field values when a message is forwarded. "

      --
      Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

      Comment

      Working...