Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI hanging script with POST data

Status
Not open for further replies.

1DMF

Programmer
Joined
Jan 18, 2005
Messages
8,795
Location
GB
I have found for some reason, that if I use CGI to parse FORM/URL data, my scripts are hanging.

I have finally been convinced I should use my $cgi = new CGI; instead of my home grown program to readt STDIN , but now I find my scripts hang and only work If I use my own STDIN parsing sub.

Why is this happening, what's wrong with CGI to be hanging my scripts with pasted forms or query strings?

I have a script that will not work and it is PayPal poasting me the data, so I have to assume there is nothing wrong with the post, but with CGI able to handle it?

any ideas?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Try saving paypals postdata to a file using your own stdin parser.

then run your cgi script from debugger or cmdline using input redirect to read the captured file. You will need to set the environment varible content_length so your script and CGI.pm knows how many bytes to read in
Jeb
\0
 
sorry you've lost me, I run perl via webhosting not local install, how would I acheive the same process?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
post a link to your other thread in the CGI forum related to this question.
 
related thread thread452-1253869

I've also got some concerns over the security of using PayPal, It is posting all the purchase info to my IPN script via HTTP, surely that breaches the Data Protection Act.

Their PDT method is secure but is easily broken, I'm concidering looking at an alternative payment provider such as worldpay , clickbank , 2checkout etc...

any thoughts?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Have you looked into timeouts in your webservers configuration, or what sort of volumes of data are you posting?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Most providers that support perl cgi allow the scripts some write access. Think of a guest book. You could ask the provider where a script could write and run a short sample. A simple
Code:
`echo testing123 >my.log` or die "can't write";
could do it.

Or you could write the paypal post data as a blob to MySql. Then download it and the script to a local machine and play it back from the command line.

I've also got some concerns over the security of using PayPal, It is posting all the purchase info to my IPN script via HTTP, surely that breaches the Data Protection Act.
Where did they get the url? Did you give them an https url to post back to?

The feed from paypal is likely unsecured as they would not pass the ccard information back to you. Many hosts charge substantially extra to provide you with https support. If you have hhtps support and a certificate provide paypal with a https url for them to call back to you after they process payment.

jb
 
I understand the HTTPS thing, but the point in using PayPal is so I don't have to have a certificate, deal with HTTPS or Credit Card Transactions.

PayPal will be taking nearly 50% from a single sale...

I sell for 0.50p they take 0.22p, I pay Artist 0.25p, I get 3p.

I expect more for nearly 50% charge from PayPal.

Plus the fact the post to HTTP is irrelevant, their PDT is capable of doing it secure as it only passes me the Transaction ID. I then use Crypt::SSLeay & LWP to GET the transaction details, but this method is easily broken, yet IPN, their reliable method is unsecure as it posts all transaction data to my script - how stupid is that!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top