473,396 Members | 2,011 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.

How to make Perl Script "POST" call from another Perl Script???

I am passing data to a putcart.pl , parsing it, then building the query
string to put the item in the shopping cart:
$cartStr =
http://www.domain.com/cgi-bin/cart.p...456&price=5.00

$co = new CGI;
print $co->redirect($cartStr);
print $co->start_html;
$co->end_html;

This works fine except that I need to pass book titles with "&" ( Bears &
Cows ==> Bears+&+Cows ===> does NOT work) and &Stk needs to be "# D123456"
(&Stk=#+D123456 ===> does NOT work) . It bombs when I try to pass "&" or
"#" in the query string.

1) Is there any way I can redirect or call a perl script from another perl
script using "POST" so I do not have to deal with the & or # mess (or the +
signs for spaces).

2) If #1 is No, How do I pass "&" and "#" in a header query string. I
could not make %26 work for & and found no % equivalent for #.

Thanks so much.
Lynn
ly**@pdinfo.com


Jul 19 '05 #1
1 5378
> I am passing data to a putcart.pl , parsing it, then building the query
string to put the item in the shopping cart:
$cartStr =
http://www.domain.com/cgi-bin/cart.p...456&price=5.00
This works fine except that I need to pass book titles with "&" ( Bears &
Cows ==> Bears+&+Cows ===> does NOT work) and &Stk needs to be "# D123456"
(&Stk=#+D123456 ===> does NOT work) . It bombs when I try to pass "&" or
"#" in the query string.


You might consider rethinking your approach to the problem. We save the
users shopping cart information to a local database. Then we only need to
pass the record number for the database entry as part of the calling string
or insert it into a new form on the generated page. This allows state to
travel with the page and prevents the possibility someone would edit the
string to change the price. It also solves the problem of passing book
titles as part of the string by saving the information elsewhere.

If you want to stick with your current approach, use subsitutions for the
characters you are trying to replace -- _AMP_ or _HASH_
You can use a simple regex to put them into the string and a simple regex
to put them in and pull them out.
Jul 19 '05 #2

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

Similar topics

2
by: Omar E Contreras | last post by:
Hi guys, Let me explain what I want to do in just 3 steps: Step 1: An HTML page that has a form which passes some data to an aspx page Step 2: The aspx page take this values and add some...
1
by: Pete Mahoney | last post by:
Ok I use a textarea to store data input by the user, and then upon them clicking the submit button I store this data to a database. The problem is once the user inputs too much data (about 3...
12
by: Assaf | last post by:
Hi all, My client is using an online service provider that processes survey responses. After a user fills survey.aspx and presses the OK button, 2 things need to happen: 1. the data has to...
0
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
5
by: Jeff | last post by:
Visual Studio 2003 DotNet framework 1.1 Windows 2000 Pro I create two pages in an Asp.net application, one is html page with a form in it: .... <form id="testForm" method="post"...
1
by: kbarrios | last post by:
Hi, I am working with VBScript and I put a "window.open" inside a "form action post" due that I am handing a "checkbox" on it, but the "window.open" doesn't work: <FORM...
14
by: Robert S | last post by:
I am trying to use POST to transfer data to another page. When I do this, '.' characters get converted to"_". For example: #index.html: <form action="test.php" method="post"> <input...
25
by: william.hooper | last post by:
here is my form: <html> <head></head> <body> <FORM ACTION="code.php" method="post"> <INPUT TYPE=SUBMIT NAME="arty.jpg" VALUE="Action"> </FORM>
14
by: terrible.theterrible4 | last post by:
Hello w3c,php, fedora + apache experts! Is there code I can use for POST A COMMENT? I am not ready for PHP yet. Anybody did it in JS?
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.