Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > How to make Perl Script "POST" call from another Perl Script???

Reply
Thread Tools

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

 
 
Wet Basement
Guest
Posts: n/a
 
      07-15-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)






 
Reply With Quote
 
 
 
 
BobMonk
Guest
Posts: n/a
 
      07-15-2003
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl script to pass data to another perl script? PhEaSaNt PLuCKeR Perl Misc 1 10-30-2005 07:48 PM
Problem in passing values to perl script using another perl script vikrant Perl Misc 4 08-10-2005 06:20 PM
How to make landline call to another landline then out call long distance? jt VOIP 6 01-30-2005 03:57 AM
CGI: Execute a perl script inside another perl script xdarcos@hotmail.com Perl Misc 20 01-18-2005 12:33 PM
Execute another perl script from my perl script Petterson Mikael Perl Misc 3 01-05-2005 01:31 PM



Advertisments