Not sure if Perl or browser problem.....

J

Jamie

I think this is a browser or OS issue...but it seems nobody responds
to those groups, lol...so I'm hoping someone here may be able to help
since i'm using perl for the form processing...

Is there something with IE6 on WinXP that would stop my HTML forms
from processing the entered information to my perl script. I just
switched
systems from Win95 / IE5.5 (where the form and script worked fine), to
XP Pro with IE6. I double & triple checked all the file/directory
paths. The server and Perl Interpreter were both installed and set up
with their respective default settings. The ACTION is pointing to the
correct path & script name. The script is running when the submit
button is clicked, but the form information is not being passed to the
script for some reason. I'm baffled !!

Can anyone help ?? Do you need more info ??

I even did a simple test form and script to make sure I was doing
everything correct and got the same results.



FORM:
<form action="cgi-bin/Home.pl" method=post>
First Name: <input type=text name="firstName"><br>
Last Name: <input type=text name="lastName">
<p align=center><input type=submit value="Continue"><br><br></p>
</form>


SCRIPT:
#! C:\Perl\bin\perl
use CGI ':standard';
print "Content-type: text/html\n\n";

$firstName = param('firstName');
$lastName = param('lastName');

print qq($lastName $firstName);



.....As you can see, this is a very basic form...but the names entered
into the form do not get thru to the script and are not printing. But
in my original sript, I'm also printing out HTML code, to format the
output, which is printed to the screen without a problem.

HELP !!
 
P

Paul Lalli

I double & triple checked all the file/directory
paths. The server and Perl Interpreter were both installed and set up
with their respective default settings. The ACTION is pointing to the
correct path & script name. The script is running when the submit
button is clicked, but the form information is not being passed to the
script for some reason. I'm baffled !!

Can anyone help ?? Do you need more info ??

I even did a simple test form and script to make sure I was doing
everything correct and got the same results.



FORM:
<form action="cgi-bin/Home.pl" method=post>
First Name: <input type=text name="firstName"><br>
Last Name: <input type=text name="lastName">
<p align=center><input type=submit value="Continue"><br><br></p>
</form>


SCRIPT:
#! C:\Perl\bin\perl
use CGI ':standard';
print "Content-type: text/html\n\n";

$firstName = param('firstName');
$lastName = param('lastName');

print qq($lastName $firstName);

Out of curiousity, what gets displayed if you do

print Dump();

? That should print an HTML list of all parameters.

Paul Lalli
 
B

Brian McCauley

I think this is a browser or OS issue...but it seems nobody responds
to those groups, lol...so I'm hoping someone here may be able to help
since i'm using perl for the form processing...

Is there something with IE6 on WinXP that would stop my HTML forms
from processing the entered information to my perl script. I just
switched
systems from Win95 / IE5.5 (where the form and script worked fine), to
XP Pro with IE6. I double & triple checked all the file/directory
paths. The server and Perl Interpreter were both installed and set up
with their respective default settings.

If the Win95/IE5.5 client can still talk to the server and get the
right result then this must be a browser issue. However if that's not
what you are saying then I'd guess it's very unlikely to be a browser
issue.
The ACTION is pointing to the
correct path & script name. The script is running when the submit
button is clicked, but the form information is not being passed to the
script for some reason. I'm baffled !!

Can anyone help ?? Do you need more info ??

Well since this is most likely to be a web server issue then one bit
of useful info would be what web server you are using.

The posibility that your problem has anything to do with Perl is
vanishingly small.

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 
J

Jamie

If the Win95/IE5.5 client can still talk to the server and get the
right result then this must be a browser issue. However if that's not
what you are saying then I'd guess it's very unlikely to be a browser
issue.

Yes...the Win95/IE5.5 client could talk to the server and get the
right result, that's why I'm positive its a browser issue...the only
other thing I can think of is that the new system is missing some sort
of driver or plugin. Is that possible??
Well since this is most likely to be a web server issue then one bit
of useful info would be what web server you are using.

I'm using a small web server software that was recommended by one of
my Perl books, called "Xitami"...i'm not using this to host the site
at all...I installed this purely to test the perl scripts, as
suggested by the book.
:p
 
S

Scott J

This baffled me for a minute too :)

You have loaded the CGI module, but you have not initialized it.

Change your script to reflect my changes :

#! C:\Perl\bin\perl

use CGI ':standard';
$query = new CGI;

print "Content-type: text/html\n\n";

$firstName = $query->param('firstName');
$lastName = $query->param('lastName');

print qq($lastName $firstName);

If this script is running on a windows machine, I remember reading how
using the qq() operator wont work, fyi.

print "$lastName $firstName"; # less typing this way too!

Scott
 
G

gnari

Scott J said:
print qq($lastName $firstName);

If this script is running on a windows machine, I remember reading how
using the qq() operator wont work, fyi.

do not believe everything you read.

gnari
 
S

Scott J

Things have been known to change in this industry, from time to time,
haha.

Scott
 
S

Sherm Pendley

Scott said:
You have loaded the CGI module, but you have not initialized it.

Have you ever actually looked at the CGI.pm docs? The function-based style
is perfectly valid; an example of it is given as the very first thing in
the CGI.pm man page, in the synopsis section.

There is a thorough discussion of the two styles in the "Programming Style"
section as well - the very first section in the full docs.
$query = new CGI;

This does not "initialize" the CGI.pm module. It creates a new instance of
class CGI, which has the param() method you use later.
print "Content-type: text/html\n\n";

If you're going to criticize how others use CGI.pm, you'd better use it
correctly yourself:

print header("text/html");

Or, with the OOP style:

print $query->header("text/html");
If this script is running on a windows machine, I remember reading how
using the qq() operator wont work, fyi.

Do you have any supporting evidence for this? I haven't heard about this bug
before, and Google didn't turn up anything. Given the error-riddled nature
of the rest of your post, I'm sceptical.

This is not valid HTML 4.01/Strict. Using that DTD, input elements cannot
"float" loose inside a form; they have to be contained in a block element,
which in turn is contained by the form. Try this instead:

<form action="cgi-bin/Home.pl" method=post>
<p>First Name: <input type=text name="firstName"><br>
Last Name: <input type=text name="lastName"></p>

<p align=center><input type=submit value="Continue"><br><br></p>
</form>

While it might seem like nit-picking, this might actually make a difference
in IE6, which has so-called "strict" and "quirks" modes that are triggered
by the DTD declaration. If it's working in "strict" mode, IE6 could be
ignoring the invalid inputs.

sherm--
 
J

Joe Smith

Scott said:
print qq($lastName $firstName);

If this script is running on a windows machine, I remember reading how
using the qq() operator wont work, fyi.

You remember incorrectly. q($lastName $firstName) won't work but qq() will.
-Joe
 
S

Scott J

Hey sherm...first off, I wasn't criticizing anyone. I was offering
help to someone who was asking. I have no problem leaving this group a
scant day after I came, if my input isn't welcome.

Sherm Pendley said:
Have you ever actually looked at the CGI.pm docs? The function-based style
is perfectly valid; an example of it is given as the very first thing in
the CGI.pm man page, in the synopsis section.

There is a thorough discussion of the two styles in the "Programming Style"
section as well - the very first section in the full docs.

I have read the CGI.pm docs. After re-reading, you are correct. Before
my next post I will spend no less than 2 hours scouring the web to
ensure my answer is as exact and flawless as is expected. TMTOWTDI.
This does not "initialize" the CGI.pm module. It creates a new instance of
class CGI, which has the param() method you use later.

It appears I chose the wrong word (initialized). In the future I will
"try" to be as exact and flawless as is expected. TWTOWTDI.
If you're going to criticize how others use CGI.pm, you'd better use it
correctly yourself:

print header("text/html");

Or, with the OOP style:

print $query->header("text/html");

TMTOWDI.


Do you have any supporting evidence for this? I haven't heard about this bug
before, and Google didn't turn up anything. Given the error-riddled nature
of the rest of your post, I'm sceptical.

Not a bug, but a feature that wasn't available with all ports of perl.
I read this in a book somewhere. I did a quick search on the net and
couldn't find anything either. So, if I'm wrong, I certainly hope I go
to hell.
This is not valid HTML 4.01/Strict. Using that DTD, input elements cannot
"float" loose inside a form; they have to be contained in a block element,
which in turn is contained by the form. Try this instead:

<form action="cgi-bin/Home.pl" method=post>
<p>First Name: <input type=text name="firstName"><br>
Last Name: <input type=text name="lastName"></p>

<p align=center><input type=submit value="Continue"><br><br></p>
</form>

While it might seem like nit-picking, this might actually make a difference
in IE6, which has so-called "strict" and "quirks" modes that are triggered
by the DTD declaration. If it's working in "strict" mode, IE6 could be
ignoring the invalid inputs.

sherm--

To recap, I offered my help. I have been wrong in the past and you
have been too!! You being anyone, not specifically you.

Well, I wasted enough of my time and energy replying to this.

Scott
 
S

Sherm Pendley

Scott said:
Hey sherm...first off, I wasn't criticizing anyone. I was offering
help to someone who was asking.

*Shrug* Call it what you will, the fact remains that you incorrectly pointed
out mistakes in the code that weren't really mistakes, and posted a
"solution" that had mistakes of its own.
I have no problem leaving this group a
scant day after I came, if my input isn't welcome.
my next post I will spend no less than 2 hours scouring the web to
ensure my answer is as exact and flawless as is expected. TMTOWTDI.
It appears I chose the wrong word (initialized). In the future I will
"try" to be as exact and flawless as is expected. TWTOWTDI.
So, if I'm wrong, I certainly hope I go to hell.

Do you always over-react this much?

No one asked you to leave, no one told you to go to hell, and it took 2
seconds glancing at 'perldoc CGI', not "2 hours scouring the web" to verify
my posting. And finally, initializing a module and instantiating an object
are *completely* different concepts, not just a minor difference in
terminology.

sherm--
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top