473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cannot access POSTed form data

I'm no Perl expert so I basically copied this code from a tutorial and I'm
not totally clear how it works. However, I am having trouble accessing the
POST variables that are posted to my page from another form on a different
server.

This is the code I am using to get at the variable:

#!/usr/bin/perl

# orderform.cgi

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$Form{$name} = $value;
}

print <<END_of_multiline_text;
Content-Type: text/html; charset=ISO-8859-1

<...html code here...>

END_of_multiline_text;

Okay, in that HTML section I refer to my variable in the following line:

<p>Your order is worth a total of:
<strong>&pound;$FORM{'grandtotal'}</strong></p>

However, the variable just displays a blank. I've a very rough idea of what
the code is doing but I've seen it posted on several tutorial sites so I
presume it's a pretty standard way of accessing form data. I think there
must be something wrong with how I call the variable in the HTML paragraph.

Thanks
Mark
Jul 19 '05 #1
1 3085
Mark wrote:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$Form{$name} = $value;
UGH! You really ought to be using code that does it right, like CGI.pm
instead of leaving yourself vulnerable to a denial-of-service attack.
<strong>&pound;$FORM{'grandtotal'}</strong></p>


$FORM is not the same as $Form.
-Joe

P.S. Next time post to comp.lang.perl.misc and not comp.lang.perl
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Oschler | last post by:
I know there isn't any $_POST array in Javascript, it exists on the server side accessible from PHP and other server side scripting languages. But I knew it would let you know specifically what...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
2
by: Enska | last post by:
I have problems connecting my access database I get information .. I cant use my database and I'm administrator on my computer so permission shutnot bee problem, but I dont know Where is the...
0
by: Gabriele Bertolucci | last post by:
Before saying anything more, I'm sorry for cross-posting, but the topic should be relevant for every newsgroups I posted in. ================================================== Access XP. ADP....
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
4
by: Ryan | last post by:
I've got a little bit of code that runs when you enter data in a datasheet view (which is a subform of the form you are in) if rst!DateReceived >= 30 Then Forms!DisposalRecords.Label90.Caption =...
3
by: epearce301 | last post by:
Hi, I have table1 and table2, both are linked, and a query has been run. I created forms that use both just the tables, and then another one using just the query. All of the information is there,...
7
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and...
12
by: tekctrl | last post by:
Environment; Win2K PC with 1Gb of RAM and plenty of HD space running Access 2002 Issue; Access presents a blank data entry form in the Forms view when the New Record icon is used. However, it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.