Previous Thread
Next Thread
Print Thread
Rate Thread
#101437 10/10/2000 4:24 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
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? wink



Wartortle

I'm supposed to put somthin here? wink
Sponsored Links
#101438 10/10/2000 5:54 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Quote
quote:
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
#101439 10/10/2000 6:14 PM
Joined: Sep 2000
Posts: 14
Junior Member
Junior Member
Offline
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/

#101440 10/10/2000 6:26 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
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
#101441 10/11/2000 1:11 PM
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
Quote
quote:
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!

Sponsored Links
#101442 10/11/2000 6:56 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
Quote
quote:
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? wink



Wartortle

I'm supposed to put somthin here? wink
#101443 10/11/2000 6:59 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
Quote
quote:
I dont get an error it just skips it.


------------------

Wartortle

I'm supposed to put somthin here? wink



Wartortle

I'm supposed to put somthin here? wink
#101444 10/11/2000 7:25 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
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
#101445 10/12/2000 4:32 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
I just did...

------------------

Wartortle

I'm supposed to put somthin here? wink



Wartortle

I'm supposed to put somthin here? wink
#101446 10/12/2000 4:38 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
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
Sponsored Links
#101447 10/12/2000 4:50 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
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? wink



Wartortle

I'm supposed to put somthin here? wink
#101448 10/12/2000 4:57 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
Nevermind I got it to work, I used this:

Quote
quote:


------------------

Wartortle

I'm supposed to put somthin here? wink



Wartortle

I'm supposed to put somthin here? wink
#101449 10/12/2000 5:42 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
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:



Change it to:




and that should work for you.

--mark

This message has been edited by Mark Badolato on October 12, 2000 at 05:45 PM


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#101450 10/12/2000 7:41 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
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? wink



Wartortle

I'm supposed to put somthin here? wink
#101451 10/12/2000 7:42 PM
Joined: Oct 2000
Posts: 38
Member
Member
Offline
Joined: Oct 2000
Posts: 38
Never mind I figured it out. And thanks!

------------------

Wartortle

I'm supposed to put somthin here? wink



Wartortle

I'm supposed to put somthin here? wink
#101452 10/13/2000 7:07 AM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Quote
quote:
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?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)