Script to pass info to GET string

Discussion in 'Perl' started by Shabam, Nov 12, 2004.

  1. Shabam

    Shabam Guest

    I need to create a perl script that basically loads a web page, asks for a
    Username and stores it as "Username". Also, it takes the domain name of the
    site (that runs the script) and stores that in "Domain".

    Next it does a substition:

    http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain

    And forwards the user to that url.

    I'm a total newbie here. Can someone hack up a quick script based on this
    requirement? I'm going to do some string limits later, but I need some
    template to start with as I'm completely stuck. Thanks!
    Shabam, Nov 12, 2004
    #1
    1. Advertising

  2. * Shabam:
    > I need to create a perl script that basically loads a web page, asks for a
    > Username and stores it as "Username". Also, it takes the domain name of the
    > site (that runs the script) and stores that in "Domain".
    >
    > Next it does a substition:
    >
    > http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain
    >
    > And forwards the user to that url.


    see perldoc CGI

    Doing low-level things manually is a bad idea and error-prone, too...

    bye
    //Dave

    --
    Ja, der typische "Ich tippe alles ein was mir ein paar Trottel aus dem
    IRC sagen"-Newbie wird aber kein Solaris nutzen... ;)
    -- Christoph Gebhardt in bjt
    David Kroeber, Nov 12, 2004
    #2
    1. Advertising

  3. Shabam wrote:
    > I need to create a perl script that basically loads a web page,


    perldoc LWP

    > asks
    > for a Username


    perldoc -f print
    perldoc perlop (pretty far down in the section about "I/O Operators")

    > and stores it as "Username". Also, it takes the


    Now, where and how do you want to store that? In a file? In a database? What
    kind of database? Just not enough information...

    > domain name of the site (that runs the script) and stores that in
    > "Domain".
    >
    > Next it does a substition:
    > http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain


    I suppose this is meant to be result of the substitution? What is the
    original string? Not enough information...

    > And forwards the user to that url.


    ???
    Do you mean you want to open a browser program and load that page?
    perldoc -f system
    perldoc -f exec

    > I'm a total newbie here. Can someone hack up a quick script based on
    > this requirement?


    Can probably yes, want to unlikely.
    If you are looking for ready-made scripts you came to the wrong place.
    Show us what you have and many people here will be happy to help you with
    the next step.

    jue
    Jürgen Exner, Nov 12, 2004
    #3
  4. Shabam

    Shabam Guest

    > Now, where and how do you want to store that? In a file? In a database?
    What
    > kind of database? Just not enough information...


    Very basic. Just in memory is fine.

    > > domain name of the site (that runs the script) and stores that in
    > > "Domain".
    > >
    > > Next it does a substition:
    > > http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain

    >
    > I suppose this is meant to be result of the substitution? What is the
    > original string? Not enough information...


    I just need it to substitute the "Username" and "Domain" into the string,
    and redirect the user to that url. The
    "http://www.anothersite.com/whatever.cgi" part of it is hardcoded.

    > Do you mean you want to open a browser program and load that page?
    > perldoc -f system
    > perldoc -f exec


    No. I mean this whole script is running as a cgi on a web page. It takes
    the username that the user enters, and based on the domain name that the cgi
    script is running from, gets the other variable (Domain). Then, it
    redirects the user to the url
    http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain.
    Shabam, Nov 12, 2004
    #4
  5. Shabam wrote:
    [...]
    > No. I mean this whole script is running as a cgi on a web page.


    Oh, a stealth CGI question.
    Good by then.


    jue
    Jürgen Exner, Nov 12, 2004
    #5
  6. Shabam

    Shabam Guest

    > Oh, a stealth CGI question.
    > Good by then.


    What are you talking about? It's a simple web page cgi. User enters
    "Username", and the page takes that, along with the domain name from the
    server, and redirects the user to another script. This is being used for an
    order system for hosting, so that the user gets http://username.domain.com
    as their address. The billing system I'm using now doesn't support such a
    mechanism natively, as it accepts full domain names only. Thus I need to do
    it this way.

    I'm guessing you think I'm trying to do something bad. Don't assume,
    without any basis.
    Shabam, Nov 12, 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. Vasanth
    Replies:
    0
    Views:
    540
    Vasanth
    Jun 28, 2004
  2. Andrea Williams

    Clear the Render info & change to different info

    Andrea Williams, Oct 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,412
    Ken Dopierala Jr.
    Oct 27, 2004
  3. Kiran
    Replies:
    0
    Views:
    1,217
    Kiran
    Feb 6, 2005
  4. ilya

    get CPU info, RAM info

    ilya, Apr 8, 2010, in forum: Java
    Replies:
    43
    Views:
    5,963
    Mike Schilling
    Apr 19, 2010
  5. Shabam

    Script to pass info to GET string

    Shabam, Nov 12, 2004, in forum: Perl Misc
    Replies:
    14
    Views:
    161
    Henry Law
    Nov 15, 2004
Loading...

Share This Page