Re: [PHP-DB] https post using php
on 3/27/02 11:45 PM, mailing list at [EMAIL PROTECTED] appended the following bits to my mbox: I am attempting to POST to a https://whatever.url.com server and return the result from the server into the script without the user knowing using a php script. I can not use CURL becuase the shared server I have hosting this site was not compiled -with-curl. I downloaded HTTP_POST PHP script from: http://px.sklar.com/code.html?code_id=313. Here is my code that I am using to call the functions: Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please. 1) Since this post is non-database related, it should be posted to the PHP-General list. 2) That said, I don't think it's possible to do what you want without curl. There's much more to an SSL/HTTPS connection that talking on a different port. Paul ?php while ($self != asleep) { $sheep_count++; } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] https post via php
The only way I can think of doing this is via cURL, so you'll need to either have the hosting company recompile their PHP with cURL (something any decent hosting company should do - it's not a difficult process), or have them provide an external curl module (like an .so file) so you can use the dl() function load it, which is basically the same as having curl compiled, but a tiny bit slower. Or you could also install the command-line version of cURL or any other https posting 3rd-party programs and have PHP use the command-line tools to post to https, but there's no other way that I know of. - Jonathan -Original Message- From: mailing list [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] https post via php Hello, I am attempting to POST to a https://whatever.url.com server and return the result from the server into the script without the user knowing using a php script. I can not use CURL becuase the shared server I have hosting this site was not compiled -with-curl. I downloaded HTTP_POST PHP script from: http://px.sklar.com/code.html?code_id=313. Here is my code that I am using to call the functions: ?php require('classes2.php'); //instantiate class http_post $a = new http_post; //define variables $a-set_server(onlinechecks.interceptcorporation.com); $a-set_port(443); $a-set_file(/icolc/short.cgi); $a-set_action(https://onlinechecks.interceptcorporation.com/icolc/short.cg i); $a-set_enctype(application/x-www-form-urlencoded); $a-set_element(array(MEN = 789,MPA = 456, MID = 7015,CRO = 123456780,CAC = 123123123, CPH = 17015551212,PAM = 12.34)); $a-set_timeout(20); $a-show_post(); $a-send($display=1); ? Here is the result returned from the browser: Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please. Hint: https://206.11.164.21/ Apache/1.3.20 Server at 206.11.164.21 Port 80 Does anyone have any ideas? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] https
I think that you MUST retype the whole URL. George. - Original Message - From: J-E-N [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, October 20, 2001 2:22 PM Subject: [PHP-DB] https hello, how can i switch from http to https without typing the whole url? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] https
you mean to use for some sort of header redirect or something? couldn't you do 1. click link change to secure mode 2. pass the url you just came from with the link (or get it from HTTP_REFERRER or whatever it is) 3. header(Location: . str_replace(http://;, https://;, $last_url)); or am i missing the point of what you want to do? HTH /beau // -Original Message- // From: George Lioumis [mailto:[EMAIL PROTECTED]] // Sent: Monday, 22 October 2001 2:52 PM // To: PHP Mailing List // Subject: Re: [PHP-DB] https // // // I think that you MUST retype the whole URL. // // George. // // - Original Message - // From: J-E-N [EMAIL PROTECTED] // To: [EMAIL PROTECTED] // Sent: Saturday, October 20, 2001 2:22 PM // Subject: [PHP-DB] https // // // hello, // // how can i switch from http to https without typing the whole url? // // thanks // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]