From: Lennie J. <lja...@gm...> - 2009-12-23 18:47:56
|
I need to do the following and not sure how to get it done. 1. Fill in form (submit) 2. Gather the data and store it into my database (This is not a problem) 3. Build a custom URL string based on the form 4. Post the new data to a https form on another site for CC entry and validation I have tried a meta redirect (has to be a post so this is not an option). Tried using CURL which gives me page one on the CC site, but when I hit submit on that page it tries to find a local page and the not CC site on the other server. Is there a way in PHP to just do a form post submit to the secure URL? Thanks in advance Lennie -- Office: 847-548-4562 Mobile: 847-302-3985 Twitter: http://twitter.com/ljarratt Facebook: http://www.facebook.com/people/Lennie_Jarratt/1182350486 "The necessity of the times, more than ever, calls for our utmost circumspection, deliberation, fortitude, and perseverance." - Samuel Adams |
From: Arlo L. <ar...@ar...> - 2009-12-23 19:44:06
|
Hi Lennie, > I need to do the following and not sure how to get it done. > > 1. Fill in form (submit) > 2. Gather the data and store it into my database (This is not a problem) > 3. Build a custom URL string based on the form > 4. Post the new data to a https form on another site for CC entry and > validation Do you want the remote form to appear so that users can complete their entries there, or do you want to just post data to it in the background and maintain control of the workflow? If the latter, you can use curl with the -d option, or fsockopen with a POST request. Both of those methods will let you parse the results from the remote form and then do whatever you want in response. If the former, I think you need to print some hidden fields with your values and print a JavaScript document.form_name.submit() to send the values to the remote form and display it. That's how I've done it and seen others do it. Maybe someone else knows a cleaner (PHP-only) way to handle that? Cheers, -Arlo _______________________________ Arlo Leach 773.769.6106 http://arlomedia.com |
From: matt d. <mm_...@ya...> - 2009-12-23 19:47:36
|
Use 'header' function: http://www.php.net/manual/en/function.header.php#89447 ________________________________ Fror funtion:y headem: Lennie Jarratt <lja...@gm...> To: chi...@li... Sent: Wed, December 23, 2009 12:47:24 PM Subject: [chiPHPug-discuss] PHP advanced question I need to do the following and not sure how to get it done. 1. Fill in form (submit) 2. Gather the data and store it into my database (This is not a problem) 3. Build a custom URL string based on the form 4. Post the new data to a https form on another site for CC entry and validation I have tried a meta redirect (has to be a post so this is not an option). Tried using CURL which gives me page one on the CC site, but when I hit submit on that page it tries to find a local page and the not CC site on the other server. Is there a way in PHP to just do a form post submit to the secure URL? Thanks in advance Lennie -- Office: 847-548-4562 Mobile: 847-302-3985 Twitter: http://twitter.com/ljarratt Facebook: http://www.facebook.com/people/Lennie_Jarratt/1182350486 "The necessity of the times, more than ever, calls for our utmost circumspection, deliberation, fortitude, and perseverance." - Samuel Adams ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ chiPHPug-discuss mailing list chi...@li... https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss |
From: Arlo L. <ar...@ar...> - 2009-12-23 20:30:52
|
> Use 'header' function: > http://www.php.net/manual/en/function.header.php#89447 Oh cool -- I'll use that next time I need something like this. Cheers, -Arlo _______________________________ Arlo Leach 773.769.6106 http://arlomedia.com |
From: Richard L. <ce...@l-...> - 2009-12-24 06:31:22
|
A POST over SSL (or any HTTP request over SSL) is best done with cURL. While you could, in theory, use PHP's crypt functions to handle the SSL handshake and calculate all the bits and bytes to do an SSL connection "by hand" you really really really do NOT want to re-invent that wheel. I'm not 100% sure where you want wrong with the cURL option, but it sounds like you pulled in their HTML which has a <form action="process.php" > tag, but you will need to alter that to have the FULL url to their processing page, rather than the "local" URL they put in. This is probably fairly easy to do, with a: $html = str_replace('action="process.php"', 'action="http://theirsite.com/path/to/process.php"', $html); Of course, the actual action="" parts aren't going to be that, but you get the idea. On Wed, December 23, 2009 12:47 pm, Lennie Jarratt wrote: > I need to do the following and not sure how to get it done. > > 1. Fill in form (submit) > 2. Gather the data and store it into my database (This is not a > problem) > 3. Build a custom URL string based on the form > 4. Post the new data to a https form on another site for CC entry > and > validation > > I have tried a meta redirect (has to be a post so this is not an > option). > > Tried using CURL which gives me page one on the CC site, but when I > hit > submit on that page it tries to find a local page and the not CC site > on the > other server. > > Is there a way in PHP to just do a form post submit to the secure URL? > > Thanks in advance > > Lennie > -- > Office: 847-548-4562 > Mobile: 847-302-3985 > > Twitter: http://twitter.com/ljarratt > Facebook: http://www.facebook.com/people/Lennie_Jarratt/1182350486 > > "The necessity of the times, more than ever, calls for our utmost > circumspection, deliberation, fortitude, and perseverance." - Samuel > Adams > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > -- Some people ask for gifts here. I just want you to buy an Indie CD for yourself: http://cdbaby.com/search/from/lynch |
From: Richard L. <ce...@l-...> - 2009-12-24 06:36:22
|
That can do a POST, but it isn't using SSL, so any data transmitted in that connection is in plain text on the wire. That may be okay, depending on what is being sent in that initial exchange, if the user ends up on an SSL page before they put in anything sensitive. But I'd be a bit leery that anybody snooping would be able to snoop out the beginning of your eCommerce Process, and possibly forge requests on your behalf or learn a bit too much about how your site handles the money/fulfillment. On Wed, December 23, 2009 1:20 pm, matt donohue wrote: > Use 'header' function: > http://www.php.net/manual/en/function.header.php#89447 > > > > > ________________________________ > Fror funtion:y headem: Lennie Jarratt <lja...@gm...> > To: chi...@li... > Sent: Wed, December 23, 2009 12:47:24 PM > Subject: [chiPHPug-discuss] PHP advanced question > > I need to do the following and not sure how to get it done. > > 1. Fill in form (submit) > 2. Gather the data and store it into my database (This is not a > problem) > 3. Build a custom URL string based on the form > 4. Post the new data to a https form on another site for CC entry > and > validation > > I have tried a meta redirect (has to be a post so this is not an > option). > > Tried using CURL which gives me page one on the CC site, but when I > hit > submit on that page it tries to find a local page and the not CC site > on the > other server. > > Is there a way in PHP to just do a form post submit to the secure URL? > > Thanks in advance > > Lennie > -- > Office: 847-548-4562 > Mobile: 847-302-3985 > > Twitter: http://twitter.com/ljarratt > Facebook: http://www.facebook.com/people/Lennie_Jarratt/1182350486 > > "The necessity of the times, more than ever, calls for our utmost > circumspection, deliberation, fortitude, and perseverance." - Samuel > Adams > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > -- Some people ask for gifts here. I just want you to buy an Indie CD for yourself: http://cdbaby.com/search/from/lynch |
From: matt d. <mm_...@ya...> - 2009-12-24 14:35:24
|
I believe this works if you have openssl module loaded in Apache (and you should) and the URL you post to is HTTPS? The server should handle the details. Matt ________________________________ From: Richard Lynch <ce...@l-...> To: Chicago PHP User Group <chi...@li...> Sent: Thu, December 24, 2009 12:36:18 AM Subject: Re: [chiPHPug-discuss] PHP advanced question That can do a POST, but it isn't using SSL, so any data transmitted in that connection is in plain text on the wire. That may be okay, depending on what is being sent in that initial exchange, if the user ends up on an SSL page before they put in anything sensitive. But I'd be a bit leery that anybody snooping would be able to snoop out the beginning of your eCommerce Process, and possibly forge requests on your behalf or learn a bit too much about how your site handles the money/fulfillment. On Wed, December 23, 2009 1:20 pm, matt donohue wrote: > Use 'header' function: > http://www.php.net/manual/en/function.header.php#89447 > > > > > ________________________________ > Fror funtion:y headem: Lennie Jarratt <lja...@gm...> > To: chi...@li... > Sent: Wed, December 23, 2009 12:47:24 PM > Subject: [chiPHPug-discuss] PHP advanced question > > I need to do the following and not sure how to get it done. > > 1. Fill in form (submit) > 2. Gather the data and store it into my database (This is not a > problem) > 3. Build a custom URL string based on the form > 4. Post the new data to a https form on another site for CC entry > and > validation > > I have tried a meta redirect (has to be a post so this is not an > option). > > Tried using CURL which gives me page one on the CC site, but when I > hit > submit on that page it tries to find a local page and the not CC site > on the > other server. > > Is there a way in PHP to just do a form post submit to the secure URL? > > Thanks in advance > > Lennie > -- > Office: 847-548-4562 > Mobile: 847-302-3985 > > Twitter: http://twitter.com/ljarratt > Facebook: http://www.facebook.com/people/Lennie_Jarratt/1182350486 > > "The necessity of the times, more than ever, calls for our utmost > circumspection, deliberation, fortitude, and perseverance." - Samuel > Adams > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > -- Some people ask for gifts here. I just want you to buy an Indie CD for yourself: http://cdbaby.com/search/from/lynch ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ chiPHPug-discuss mailing list chi...@li... https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss |
From: Anacreo <an...@gm...> - 2009-12-25 12:08:25
|
Seems to cover it nicely: http://blog.taragana.com/index.php/archive/how-to-use-curl-in-php-for-authentication-and-ssl-communication/ <http://blog.taragana.com/index.php/archive/how-to-use-curl-in-php-for-authentication-and-ssl-communication/>Were you able to get this working? I'm a bit out of PHP right now trying to get my Python chops up to snuff for Google App Engine... It's pretty nice, anyone else playing with it? Alec On Thu, Dec 24, 2009 at 8:35 AM, matt donohue <mm_...@ya...> wrote: > I believe this works if you have openssl module loaded in Apache (and you > should) and the URL you post to is HTTPS? > The server should handle the details. > > Matt > > > > > > ________________________________ > From: Richard Lynch <ce...@l-...> > To: Chicago PHP User Group <chi...@li...> > Sent: Thu, December 24, 2009 12:36:18 AM > Subject: Re: [chiPHPug-discuss] PHP advanced question > > That can do a POST, but it isn't using SSL, so any data transmitted in > that connection is in plain text on the wire. > > That may be okay, depending on what is being sent in that initial > exchange, if the user ends up on an SSL page before they put in > anything sensitive. > > But I'd be a bit leery that anybody snooping would be able to snoop > out the beginning of your eCommerce Process, and possibly forge > requests on your behalf or learn a bit too much about how your site > handles the money/fulfillment. > > On Wed, December 23, 2009 1:20 pm, matt donohue wrote: > > Use 'header' function: > > http://www.php.net/manual/en/function.header.php#89447 > > > > > > > > > > ________________________________ > > Fror funtion:y headem: Lennie Jarratt <lja...@gm...> > > To: chi...@li... > > Sent: Wed, December 23, 2009 12:47:24 PM > > Subject: [chiPHPug-discuss] PHP advanced question > > > > I need to do the following and not sure how to get it done. > > > > 1. Fill in form (submit) > > 2. Gather the data and store it into my database (This is not a > > problem) > > 3. Build a custom URL string based on the form > > 4. Post the new data to a https form on another site for CC entry > > and > > validation > > > > I have tried a meta redirect (has to be a post so this is not an > > option). > > > > Tried using CURL which gives me page one on the CC site, but when I > > hit > > submit on that page it tries to find a local page and the not CC site > > on the > > other server. > > > > Is there a way in PHP to just do a form post submit to the secure URL? > > > > Thanks in advance > > > > Lennie > > -- > > Office: 847-548-4562 > > Mobile: 847-302-3985 > > > > Twitter: http://twitter.com/ljarratt > > Facebook: http://www.facebook.com/people/Lennie_Jarratt/1182350486 > > > > "The necessity of the times, more than ever, calls for our utmost > > circumspection, deliberation, fortitude, and perseverance." - Samuel > > Adams > > > ------------------------------------------------------------------------------ > > This SF.Net email is sponsored by the Verizon Developer Community > > Take advantage of Verizon's best-in-class app development support > > A streamlined, 14 day to market process makes app distribution fast > > and easy > > Join now and get one step closer to millions of Verizon customers > > http://p.sf.net/sfu/verizon-dev2dev > > _______________________________________________ > > chiPHPug-discuss mailing list > > chi...@li... > > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > > > ------------------------------------------------------------------------------ > > This SF.Net email is sponsored by the Verizon Developer Community > > Take advantage of Verizon's best-in-class app development support > > A streamlined, 14 day to market process makes app distribution fast > > and easy > > Join now and get one step closer to millions of Verizon customers > > http://p.sf.net/sfu/verizon-dev2dev > > _______________________________________________ > > chiPHPug-discuss mailing list > > chi...@li... > > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > > > > > -- > Some people ask for gifts here. > I just want you to buy an Indie CD for yourself: > http://cdbaby.com/search/from/lynch > > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > |
From: matt d. <mm_...@ya...> - 2009-12-31 05:48:42
|
After you post a question and a bunch of people stop whatever they are doing (work?) and give thoughtful/researched answers, it's always nice to know wtf you did (lest your next question gets no response). Not calling anyone out or anything...but, this always bugs me and helps me decide what email I should delete. Be nice- follow up. Enjoy the holidays! |