On Wednesday, November 26, 2003, at 09:14 AM, Anonymous wrote:

I was just wondering if it's possible to get a PHP script to fill a form for
you? You see, I'm trying to make PHP fetch a password protected website for
me and there's a form with username and password that protects it.


Can anyone help me? Perhaps give me another sollution?

It depends how the site at the other end works, and how securely they've set everything up.


If the form's action is 'get' rather than 'post', then you can simply copy the URL format (eg login.php?u=fred&p=secret) and submit directly to that script (bypassing the form). For example, I can take a query like "posting to a form with PHP", and write a google URL like http://www.google.com/search?q=posting+to+a+form+with+PHP&ie=UTF- 8&oe=UTF-8 ,which WILL work.

If it's 'post' rather than 'get', then I think there's some Pear classes that can POST data to a URL, and I think there's also some classes on phpclasses.org my Manuel Lemmos that do this too.

Not easy, but (AFAIK), achievable.
You might get caught out with what the next script does though... sessions and cookies may still prevent you from getting where you need to go, but that's not what you asked :)



Justin French


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to