hope this is easy, passing a url as a parameter

Discussion in 'Perl Misc' started by Danny, May 1, 2004.

  1. Danny

    Danny Guest

    I am trying to pass a parameter to a cgi script, it is a URL that has its
    own call to a cgi script with ? in statement.
    for example

    so my cgi (load.cgi) is getting confused because of the extra ? in the
    statement.
    my cgi redirects to the passed url

    I call it like this:
    www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin/pro
    ducts.cgi?search=volvo

    what do I do to get that entire url, right now it is stopping at the other ?

    Thanks in advance
     
    Danny, May 1, 2004
    #1
    1. Advertising

  2. Danny

    John Bokma Guest

    Danny wrote:
    > I am trying to pass a parameter to a cgi script, it is a URL that has its
    > own call to a cgi script with ? in statement.
    > for example
    >
    > so my cgi (load.cgi) is getting confused because of the extra ? in the
    > statement.
    > my cgi redirects to the passed url
    >
    > I call it like this:
    > www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin/pro
    > ducts.cgi?search=volvo


    Encode the URL, this is wrong.

    --
    John MexIT: http://johnbokma.com/mexit/
    personal page: http://johnbokma.com/
    Experienced Perl programmer available: http://castleamber.com/
     
    John Bokma, May 1, 2004
    #2
    1. Advertising

  3. Danny

    Danny Guest

    "John Bokma" <> wrote in message
    news:40931fc8$0$198$...
    > Danny wrote:
    > > I am trying to pass a parameter to a cgi script, it is a URL that has

    its
    > > own call to a cgi script with ? in statement.
    > > for example
    > >
    > > so my cgi (load.cgi) is getting confused because of the extra ? in the
    > > statement.
    > > my cgi redirects to the passed url
    > >
    > > I call it like this:
    > >

    www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin/pro
    > > ducts.cgi?search=volvo

    >
    > Encode the URL, this is wrong.
    >
    > --
    > John MexIT: http://johnbokma.com/mexit/
    > personal page: http://johnbokma.com/
    > Experienced Perl programmer available: http://castleamber.com/


    Thanks

    How can I encode the URL.?
     
    Danny, May 1, 2004
    #3
  4. Danny wrote:

    >
    > "John Bokma" <> wrote in message
    > news:40931fc8$0$198$...
    >> Danny wrote:
    >> > I am trying to pass a parameter to a cgi script, it is a URL that has

    > its
    >> > own call to a cgi script with ? in statement.
    >> > for example
    >> >
    >> > so my cgi (load.cgi) is getting confused because of the extra ? in the
    >> > statement.
    >> > my cgi redirects to the passed url
    >> >
    >> > I call it like this:
    >> >

    > www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin

    pro
    >> > ducts.cgi?search=volvo

    >>
    >> Encode the URL, this is wrong.
    >>
    >> --
    >> John MexIT: http://johnbokma.com/mexit/
    >> personal page: http://johnbokma.com/
    >> Experienced Perl programmer available: http://castleamber.com/

    >
    > Thanks
    >
    > How can I encode the URL.?


    Its a faq.

    http://www.perldoc.com/perl5.8.0/pod/perlfaq9.html
    How do I decode or create those %-encodings on the web?


    But its better to use the cgi.pm module

    gtoomey
     
    Gregory Toomey, May 1, 2004
    #4
  5. Danny

    Danny Guest

    "Gregory Toomey" <> wrote in message
    news:1513682.d3x1Bjo0rK@GMT-hosting-and-pickle-farming...
    > Danny wrote:
    >
    > >
    > > "John Bokma" <> wrote in message
    > > news:40931fc8$0$198$...
    > >> Danny wrote:
    > >> > I am trying to pass a parameter to a cgi script, it is a URL that

    has
    > > its
    > >> > own call to a cgi script with ? in statement.
    > >> > for example
    > >> >
    > >> > so my cgi (load.cgi) is getting confused because of the extra ? in

    the
    > >> > statement.
    > >> > my cgi redirects to the passed url
    > >> >
    > >> > I call it like this:
    > >> >

    > > www.domain.com/cgi-bin/load.cgi?url=http://www.anotherdomain.com/cgi-bin

    > pro
    > >> > ducts.cgi?search=volvo
    > >>
    > >> Encode the URL, this is wrong.
    > >>
    > >> --
    > >> John MexIT: http://johnbokma.com/mexit/
    > >> personal page: http://johnbokma.com/
    > >> Experienced Perl programmer available: http://castleamber.com/

    > >
    > > Thanks
    > >
    > > How can I encode the URL.?

    >
    > Its a faq.
    >
    > http://www.perldoc.com/perl5.8.0/pod/perlfaq9.html
    > How do I decode or create those %-encodings on the web?
    >
    >
    > But its better to use the cgi.pm module
    >
    > gtoomey


    Thanks

    I will fix this:

    but an initial call with this long url is always made from my index.html,
    how can I encode a URL in an HTML page?

    Thanks again
     
    Danny, May 1, 2004
    #5
  6. Danny

    gnari Guest

    "Danny" <> wrote in message
    news:pLKkc.67740$...
    >
    > "Gregory Toomey" <> wrote in message
    > news:1513682.d3x1Bjo0rK@GMT-hosting-and-pickle-farming...
    > > Danny wrote:
    > >
    > >
    > > Its a faq.
    > >
    > > http://www.perldoc.com/perl5.8.0/pod/perlfaq9.html
    > > How do I decode or create those %-encodings on the web?
    > >
    > >
    > > But its better to use the cgi.pm module
    > >

    >
    > Thanks
    >
    > but an initial call with this long url is always made from my index.html,
    > how can I encode a URL in an HTML page?


    thats where the FAQ code can be handy.
    just make a short script that encodes our urls, and
    paste them into your html.
    or have your whole html file generated by this script.
    or just use a oneliner:
    perl -ple '$_="text to encode";s/([^\w()\'*~!.-])/sprintf "%%%02x", ord
    $1/eg'

    gnari
     
    gnari, May 1, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alter
    Replies:
    1
    Views:
    314
    Nils Petter Vaskinn
    Nov 25, 2003
  2. Replies:
    0
    Views:
    350
  3. dave

    Easy question (i hope)

    dave, Jun 20, 2006, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    101
    Steve C. Orr [MVP, MCSD]
    Jun 21, 2006
  4. Miguel Orrego

    An easy one I hope

    Miguel Orrego, Aug 19, 2003, in forum: ASP General
    Replies:
    2
    Views:
    103
    Tim Slattery
    Aug 19, 2003
  5. Caspar Bl

    easy question i hope

    Caspar Bl, Aug 30, 2006, in forum: Ruby
    Replies:
    2
    Views:
    96
    Tim Pease
    Aug 30, 2006
Loading...

Share This Page