Script to pass info to GET string

S

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.

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!
 
D

David Kroeber

* 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
 
J

Jürgen Exner

Shabam said:
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
 
S

Shabam

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.
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.
 
S

Shabam

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top