Re: Calling IE for a form POST
| From: | Gonzalo Monzón | Date: | Wed, 20 Jul 2005 15:30:08 +0000 |
| Subject: | Re: Calling IE for a form POST | ||
| References: | 1 2 3 4 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6081@lists.php.net to get a copy of this message | ||
Hi all,
I think the lib_curl php extension is all what you need.
You can send POST data, authenticathe an user, etc.
Have a look to this url:
http://curl.haxx.se/libcurl/php/examples/
Gonzalo.
Benjamin Smith escribió:
Scott, In this case, that still leaves the user unauthenticated. I need to (somehow) pass the user to the web-based thingy with login/pw passed so that the PHP session is active, links work, etc. The only thing I've come up with so far is to pass the credentials in PHP-GTK using fopen or fsockopen or your aforementioned PEAR lib, get a one-time token via a special script on the server, and then use that token to get past authentication. EG: /********************************************* special_login_script.php generates a login token that can only be used once, then it's deleted. ********************************************* $fp=fopen("https://mysite.com/special_login_script.php?_login=$login&_pass=$pass", 'r'); $match="/token: ([0-9a-zA-Z]*)/"; while ($line=fgets($fp, 1024)) if (preg_match($match, $line, $r)) $token=$r[1]; fclose($fp); /******************************************* Now, we'll use the token we got above to login the user to the script/in/question.php *******************************************/ $url="https://mysite.com/script/in/question.php?_token=$token&login=true"; return HandOffWithIE($url); This passes the user to the web-based application, which disables the token (almost) immediately, and has the user logged in painlessly. It's just more work, and I figure it's more "right" just to pass via post in the first place! Having just checked my inbox, it seems Christian Weiske proposes something similar to the above. -Ben On Tuesday 19 July 2005 12:10, Scott Mattocks wrote:Benjamin Smith wrote:one.In this case, it's to integrate a PHP-GTK application with a web-basedaIt's not just for passing data - the user will be using the website afterhiddenhand-off. I'd like to use the form post to pass the login credentials in a mannerweb-basedfrom the user, so that I'm not littering a browser's site history with usernames and passwords, etc. Once the form post is done in IE, the user must interact with theapplication, so it can't be done directly from PHP-GTK.I don't know much about COM and IE but is it possible to launch IE and pass it a string to display? Something similar to: $reply = $httpRequest->send(); $ie = new IE(); $ie->load($reply); $ie->launch(); Scott -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php