CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
QUERY_STRING

 



keith2045
Deleted

Jan 16, 2001, 7:11 PM

Post #1 of 6 (424 views)
QUERY_STRING Can't Post

Hi.

i have a question. I want to have something like this. http://www.mydomain.com/cgi-bin/userid.cgi?id=82program=clickcough
How do i do this?? I know to use the query_string but i cant get it. I tried for at least 30 min.

Thanks

Keith



parham_m_s
journeyman

Jan 16, 2001, 7:20 PM

Post #2 of 6 (423 views)
Re: QUERY_STRING [In reply to] Can't Post

uhh... use the "get" query in u'r forms



keith2045
Deleted

Jan 16, 2001, 7:24 PM

Post #3 of 6 (422 views)
Re: QUERY_STRING [In reply to] Can't Post

It's not a form. It's like a redirection. I want to have an id where it prints it somewhere on the page and then the program name.

Thanks

Keith



sleuth
Enthusiast

Jan 16, 2001, 7:47 PM

Post #4 of 6 (420 views)
Re: QUERY_STRING [In reply to] Can't Post

 
What? Your not being specific. Are you just trying to read the values passed to your script then redirect accordingly? If so, CGI.pm can do it.

use CGI qw/:standard/;
$id = param('id');
print "$id";

Maybe I'm just nuts.

Sleuth



keith2045
Deleted

Jan 17, 2001, 5:34 AM

Post #5 of 6 (415 views)
Re: QUERY_STRING [In reply to] Can't Post

Ok heres what i want.
You know how some sites have where a user clicks on a link and it takes them to a link something like this http://www.mydomain.com/cgi-bin/redirect.cgi?siteid=45 and that redirects them to the site. Well how do i have the siteid? I can get it to work without the siteid but i want to have it there? How do i do this??

Thanks

Keith



sleuth
Enthusiast

Jan 17, 2001, 6:37 PM

Post #6 of 6 (406 views)
Re: QUERY_STRING [In reply to] Can't Post

 
Make a database like this,

24|^|www.yahoo.com|^|
25|^|www.craola.com|^|

THen point your browser to the script with ?id=24

$data = "file.db";
open(file, "<$data");
while(<file>){
($ID, $url)=split(/\|\^\|/, $_);
if ($id eq "$ID"){
print "Location: http://$url\n\n";
last;
}
}
close(file);

Don't forget to leave out the print "content-type: balbal";
or it won't redirect.

Sleuth


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives