PHP Classes

need your help in implementing this class

Recommend this page to a friend!

      PHP HTTP protocol client  >  All threads  >  need your help in implementing this...  >  (Un) Subscribe thread alerts  
Subject:need your help in implementing this...
Summary:I am a newbie and I need your help in how I can use this class
Messages:8
Author:Tayyab
Date:2006-01-31 07:31:25
Update:2007-09-10 17:05:26
 

  1. need your help in implementing this...   Reply   Report abuse  
Picture of Tayyab Tayyab - 2006-01-31 07:31:25
I am a newbie and I need your help in how I can use this class. Best solution would be if u could provide me any example.

What I want to do is to login at some website using login/password through this script. I want to send request (username and password) to the server and be able to get & understand its response.

Please tell me how I can use this class effeciently to get my result.

thank you very much in advance for your kind help.

  2. Re: need your help in implementing this...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-01-31 13:25:00 - In reply to message 1 from Tayyab
The test_http.php example demonstrates how to do what you want. Take a look at the comments to understand how to set the authentication credentials.

  3. Got it implemented ... but more...   Reply   Report abuse  
Picture of Tayyab Tayyab - 2006-02-01 13:49:04 - In reply to message 2 from Manuel Lemos
Thanks for reply .. actually it was my mistake .. i didn't take notice of it before...

one more thanks ... for providing us with this class ... great work ...

one more thanks in advance :) i.e. I successfully got to implement this class (weldone! tayyab) ... I am trying to get login at this page : https://www.mcssl.com/netcart/login/login.asp

I posted data on this URL ... and in processReply() function in Client.php I printout the headers array '$this->responseHeaders' for debugging ... and got this output :

Array ( [Date] => Wed, 01 Feb 2006 11:44:56 GMT [Server] => Microsoft-IIS/6.0 [P3P] => CP="CAO DSP LAW CUR ADMi TAIi PSDi IVDi HISi OUR SAMi BUS PRE" [X-Powered-By] => ASP.NET [Location] => /netcart/login/bwscapsorry.asp?brws=no [Content-Length] => 159 [Content-Type] => text/html [Set-Cookie] => ASPSESSIONIDSSCSCTAQ=PDNNOOEAGABJKPFKMDJBGIME; path=/ [Cache-Control] => private [X-Cache] => MISS from pxy2.dsl.net.pk [X-Cache-Lookup] => MISS from pxy2.dsl.net.pk:3128 [Connection] => close )

Now if u look at the Location, /netcart/login/bwscapsorry.asp?brws=no , and put this in URL as :
mcssl.com/netcart/login/bwscapsorry ...

you will come to know all my tensions in life :) ...

how happy was I when I successfully logged-in at my local pc but after putting it to fire online and watching this page ... I am very umm ummmm ... here some security measures have been taken for Browser... which I am unable to fix yet. Please give me the idea how to handle this situation ... I have a long way to go .. and I m really struck on this first milestone.


  4. Re: need your help in implementing this...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-02-01 17:30:38 - In reply to message 3 from Tayyab
You are redirected to that page because the server assumes that for some reason your "browser" does not support Javascript.

I did not see any Javascript code to submit the form in a different way, so it may work by spoofing one of those browsers like this as explained in the example:

$http->user_agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";

  5. Re: need your help in implementing this...   Reply   Report abuse  
Picture of Michael Michael - 2006-06-15 16:01:29 - In reply to message 2 from Manuel Lemos
I just downloaded your package and there was no test_http.php file in it. Is it seperate?

I am new at this and the docs did not provide enough info for me to use.

Thanks.

Mike

  6. Re: need your help in implementing this...   Reply   Report abuse  
Picture of Michael Michael - 2006-06-15 16:14:48 - In reply to message 5 from Michael
I found it but am now working on the mcrypt issue.

Mike

  7. Re: need your help in implementing this...   Reply   Report abuse  
Picture of Philippides Cayetano Philippides Cayetano - 2007-09-10 09:49:10 - In reply to message 6 from Michael
how can i use the yahoo export address book?

i need to scrape all the contacts of the yahoo user. but i dont know how to do it with your class... please help me... thanks

  8. Re: need your help in implementing this...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-09-10 17:05:26 - In reply to message 7 from Philippides Cayetano
The example yahoo_export_address_book.php shows exactly what you need.