Script to pass info to GET string

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

    Script to pass info to GET string

    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:



    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!


  • David Kroeber

    #2
    Re: Script to pass info to GET string

    * Shabam:[color=blue]
    > 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....me&var2=Domain
    >
    > And forwards the user to that url.[/color]

    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

    Comment

    • Jürgen Exner

      #3
      Re: Script to pass info to GET string

      Shabam wrote:[color=blue]
      > I need to create a perl script that basically loads a web page,[/color]

      perldoc LWP
      [color=blue]
      > asks
      > for a Username[/color]

      perldoc -f print
      perldoc perlop (pretty far down in the section about "I/O Operators")
      [color=blue]
      > and stores it as "Username". Also, it takes the[/color]

      Now, where and how do you want to store that? In a file? In a database? What
      kind of database? Just not enough information...
      [color=blue]
      > domain name of the site (that runs the script) and stores that in
      > "Domain".
      >
      > Next it does a substition:
      > http://www.anothersite.com/whatever....me&var2=Domain[/color]

      I suppose this is meant to be result of the substitution? What is the
      original string? Not enough information...
      [color=blue]
      > And forwards the user to that url.[/color]

      ???
      Do you mean you want to open a browser program and load that page?
      perldoc -f system
      perldoc -f exec
      [color=blue]
      > I'm a total newbie here. Can someone hack up a quick script based on
      > this requirement?[/color]

      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


      Comment

      • Shabam

        #4
        Re: Script to pass info to GET string

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

        Very basic. Just in memory is fine.
        [color=blue][color=green]
        > > domain name of the site (that runs the script) and stores that in
        > > "Domain".
        > >
        > > Next it does a substition:
        > > http://www.anothersite.com/whatever....me&var2=Domain[/color]
        >
        > I suppose this is meant to be result of the substitution? What is the
        > original string? Not enough information...[/color]

        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.
        [color=blue]
        > Do you mean you want to open a browser program and load that page?
        > perldoc -f system
        > perldoc -f exec[/color]

        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....me&var2=Domain.



        Comment

        • Jürgen Exner

          #5
          Re: Script to pass info to GET string

          Shabam wrote:
          [...][color=blue]
          > No. I mean this whole script is running as a cgi on a web page.[/color]

          Oh, a stealth CGI question.
          Good by then.


          jue


          Comment

          • Shabam

            #6
            Re: Script to pass info to GET string

            > Oh, a stealth CGI question.[color=blue]
            > Good by then.[/color]

            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.


            Comment

            Working...