469,336 Members | 5,746 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

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:

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!
Jul 19 '05 #1
5 5186
* 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
Jul 19 '05 #2
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
Jul 19 '05 #3
> 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.

Jul 19 '05 #4
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
Jul 19 '05 #5
> 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.
Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Oli | last post: by
2 posts views Thread by Luis | last post: by
3 posts views Thread by David | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.