Jump to content


PHP + IPN + fsockopen

  • This topic is locked This topic is locked
1 reply to this topic

#1 babenis



  • Members
  • PipPip
  • 13 posts

Posted 28 February 2003 - 10:22 AM

I have a page with a form on the site where users enter the id number, mark checkboxes beside the agreement and enter an email address as their username.
After user submits the form it posts back to the script on my server to parse the information entered in the form and if everything is ok script takes him/her directly to the PayPal screen (using fsockopen).

Technical flow:

Form -> submit -> Script parses form input -> if no errors -> fsockopen(¡¥paypalpath.com¡¦,80) -> display fsockopen() output

Paths to StyleSheet and one JavaScript include files are screwed up ¡V because they are relative (no https://www.paypal.com/ included in path)

Fsockopen() always opens the registration screen even if user has paypal cookie installed (because being called from server and not users browser)

It also gives me a JavaScript error which I can¡¦t find ƒ¼

I want path to paypal be displayed in the url string. Sort of initiate a post request from users browser with my variables :)

#2 paypal_pb


    Advanced Member

  • Members
  • 2,960 posts

Posted 28 February 2003 - 12:06 PM

I don't think you want to be using fsockopen.

For information on redirects in PHP: http://www.php.net/m...tion.header.php

An alternative is to return HTML/JavaScript which implements a POST redirect: http://www.paypaldev...sp?TOPIC_ID=588

This has the slight benefit of not incouding all the fields in the address box and can sometimes be "cleaner". But there is a slight delay to the user of a blank page refreshing and some users won't be able to run JavaScript but will be able to click the button.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users