Page 2 of 2
Re: working fine on local pc but not on server
Posted: Sat Jan 03, 2009 10:25 pm
by sunny12300
hi sir,
i thinks its due to cookie file. what i did today is i run script on my local computer and than upload cookie file generated by script to server. and try to grab grab page which require authentication and i was able to successfully grab that page.
i remove the request of login coz i have already uploaded cookie file.
is it so that login site server may be blocking the ip of my server to login??
Re: working fine on local pc but not on server
Posted: Sat Jan 03, 2009 10:34 pm
by sunny12300
one more thing.
when i upload this script to windows based server.it working perfectly fine on it.
so whats the problem with linux server\?
Re: working fine on local pc but not on server
Posted: Sun Jan 04, 2009 12:30 am
by novice4eva
It must have to do with the file permissions as i said earlier in my post, the file ie the cookie.txt must exist and if it does then it must be writable.
Re: working fine on local pc but not on server
Posted: Sun Jan 04, 2009 4:38 am
by sunny12300
novice4eva wrote:It must have to do with the file permissions as i said earlier in my post, the file ie the cookie.txt must exist and if it does then it must be writable.
yes,
i change permission to 777 for cookie.txt.
i came to know that there is something wrong with request made by server.
what i mean is when i run script on linux server, it is making using "GET" to make for login while on windows it is using "POST" .
SO I THINK I SHOULD CHANGE SOME PARAMETER OR DO SOMETHING SO SCRIPT ON SERVER WILL MAKE REQUEST IN "POST"
DO YOU KNOW HOW?
HERE IS MY HEADER FOR LINUX.
Code: Select all
* About to connect() to www28.discuss.com.hk port 80 (#0)
* Trying 124.XXX.150.30... * connected
* Connected to http://www.discuss.com. (124.244.150.30) port 80 (#0)
> GET /logging.php?action=login& HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Host: www28.discuss.com.hk
Accept: */*
Referer: http://www.discuss.com/logging.php?action=login
Re: working fine on local pc but not on server
Posted: Sun Jan 04, 2009 4:51 am
by sunny12300
i am using this two line also in my script for post.
curl_setopt ($ch, CURLOPT_POST, TRUE);
curl_setopt ($ch, CURLOPT_HTTPGET, FALSE);
Re: working fine on local pc but not on server
Posted: Sun Jan 04, 2009 10:08 pm
by novice4eva
Hummm, regardless of header what do you get if you do print_r($_POST) in the target page(if you have access to that page). I tried your code, and mine is linux server, and it worked well here

Re: working fine on local pc but not on server
Posted: Sun Jan 04, 2009 10:53 pm
by sunny12300
novice4eva wrote:Hummm, regardless of header what do you get if you do print_r($_POST) in the target page(if you have access to that page). I tried your code, and mine is linux server, and it worked well here

sorry sir. i am not getting what you want to ask.can you elaborate it more so i can give you information on it. i want to access one page which require login first.but now i am getting login page again though making login before that page request.i dont have access to target page.
i think i am not able to login in successfully.
here is topic he is having same problem like me 100%.
viewtopic.php?f=1&t=89757&p=492636
i have inserted double quote and singel quote too but not working.
Re: working fine on local pc but not on server
Posted: Wed Jan 07, 2009 12:49 am
by sunny12300
waiting.anyone please.