Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Script to pass info to GET string

Reply
Thread Tools

Script to pass info to GET string

 
 
Shabam
Guest
Posts: n/a
 
      11-12-2004
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.

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!


 
Reply With Quote
 
 
 
 
David Kroeber
Guest
Posts: n/a
 
      11-12-2004
* 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....me&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
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      11-12-2004
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....me&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


 
Reply With Quote
 
Shabam
Guest
Posts: n/a
 
      11-12-2004
> 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....me&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....me&var2=Domain.



 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      11-12-2004
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


 
Reply With Quote
 
Shabam
Guest
Posts: n/a
 
      11-12-2004
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get CPU info, RAM info ilya Java 43 04-19-2010 03:23 PM
Pass variables to arbitrary ruby script: ruby script.rb Mario Gr Ruby 3 07-04-2009 06:00 AM
perl script to pass data to another perl script? PhEaSaNt PLuCKeR Perl Misc 1 10-30-2005 07:48 PM
Script to pass info to GET string Shabam Perl Misc 14 11-15-2004 06:41 PM
How to get the Operating System info like ( Wireless info, Wireless connection) Vasanth Perl 0 06-28-2004 08:56 AM



Advertisments