|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
Heres my problem: I click on the link to go to the register page at RPG.pl?action=Login It brings me there and when I click submit it should go to RPG.pl?action=Login2 but it just goes to RPG.pl and does not open the Login2 sub I have the thing specifing the action of Login2 setup the same as the rest but it wont log from the pages that are at RPG.pl?action=wahtever already. Please tell me what to do Also I would like the code used to read forms used in a program like whatever it does to read this form to post a message ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Well gee, let's try this: #!/usr/bin/perl -wT use strict; use Perl::ESP; my $problem = Perl::ESP->new(); print $problem->get_error('RPG.pl?action=Login2'); __END__ Output: You have a problem in your script.--mark This message has been edited by Mark Badolato on October 10, 2000 at 05:57 PM
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Sep 2000
Posts: 14
Junior Member
|
Junior Member
Joined: Sep 2000
Posts: 14 |
Well first off here is the code I use to parse forms in all the scripts I write. ####################################### read(STDIN, $input, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $input); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; $FORM{$name} = $value;} @vars = split(/&/, $ENV{QUERY_STRING}); foreach $var (@vars) { ($v,$i) = split(/=/, $var); $v =~ tr/+/ /; $v =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $i =~ tr/+/ /; $i =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $i =~ s///g; $INFO{$v} = $i; } ################################## with that code to parse what I get from a form I use $FORM{$variablename} and for strings (scriptname.pl?variablename=blah) You would use $INFO{$variablename} in your script (if you used my parsing code) you should have somthing like this telling it to go to the second sub if ($INFO{'action'} eq 'Login2') {&LoginTwo;} Don't forget it is case sensitive. so if you have login2 instead of Login2 it will return a false value. ------------------ -Twenty7 http://www.englishhouse.com/twenty7/ That game called Infantry http://infantry.nmebase.com/
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
However keep in mind that NO ONE should use that parse routine. It's old, it's unsupported, and it's insecure.
The perl community dislikes cargo culted code, and that particular one is one of the big peeves.
use this instead:
use CGI qw/:standard/;
my $username = param('username');
Simpler, clearner, more secure, and supported.
--mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Feb 2000
Posts: 4,625
Member
|
Member
Joined: Feb 2000
Posts: 4,625 |
No, no no. Thats all...no no no... Is their a typo in your script? Typo's can easily be overlooked. ::cough:: ubb 5.44a ::cough:: Like mark said, check the script. ------------------ UBBDEV Moderator OCCUPATION: Programmer, webmaster. Read my BIO in the team link!
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
I use that... Heres how its set up... use CGI qw/:standard/;
$action = param('action');
if($action eq "Login") { require "link here" &Login; } if($action eq "Login2") { require "link here" &Login2; }
Login brings me to the login page @ RPG.pl?action=Login The login form should load Login2 the link I used for theform is RPG.pl?action=Login2 but it just brings me to the main page and doesnt load Login2 should I make it say RPG.plaction=Login&other=Login2 or somthin else? Also I still need somthin that will read the forms. ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
I dont get an error it just skips it. ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
*sigh*
The point was that we don't have ESP and have not a clue what you are doing wrong in your script until you actually bother to show us the code.
--mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
I just did... ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
1) That snippet wasn't with your original question
2) No you didn't just post it... you posted a code snippet sort of LIKE what you're using. That isn't your real snippet, and if it is, it wouldn't compile due to syntax errors.
Now try posting the REAL code.
--mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
This the the part of code that calls the functions: use CGI qw/:standard/; $action = param('action'); if ($action eq 'Login') { require "$SF/LoginLogout.pl"; &Login; } if ($action eq 'Login2') { require "$SF/LoginLogout.pl"; &Login2; }
And heres the form tag:
The form tags at RPG.pl?action=Login so you see what it should be calling but it ain't. ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
Nevermind I got it to work, I used this: ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
*sigh*
DON'T USE THAT CODE. Read my above explanation.
Now, on to your problem, your snippet looks fine. This doesn't:
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
That code works fine for me, I don't know why I shouldn't use it cause it works good. And also if I used the other thing how can I get it to read forms? ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
Never mind I figured it out. And thanks! ------------------ Wartortle
I'm supposed to put somthin here? 
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
Mark told you why you shouldn't do it. It is insecure, outdated, and unsupported. Use CGI.pm. MUCH better in every way! ------------------ Da Wannabe Cannuck:: Who is Andy?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|