GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Php + curl + cookies (https://gfy.com/showthread.php?t=917947)

PPC 07-25-2009 11:44 AM

Php + curl + cookies
 
Anyone have a working example of logging into a protected area and navigating to another page using php, curl & cookies, oh my


I can get logged in, but that's about it.

PPC 07-25-2009 03:22 PM

bump4help

PPC 07-25-2009 05:31 PM

guess i'll try a different forum :|

wizzart 07-25-2009 06:39 PM

It's possible only if you have login info for that portected area.

curl is perfect for that.

PPC 07-25-2009 08:35 PM

yeah , I have login info

I can login just having problems navigating to a page and submitting a form (I can submit forms while not logged in.. but I need to login and submit this one and cant)

just need to submit a form to add record to db while logged in and having problems

any help would be appreciated :)

woj 07-25-2009 08:58 PM

curl_setopt + CURLOPT_COOKIE FTW

jwerd 07-25-2009 09:18 PM

Quote:

Originally Posted by woj (Post 16107182)
curl_setopt + CURLOPT_COOKIE FTW

what he said :thumbsup:thumbsup

PPC 07-25-2009 09:28 PM

here's what I have that logs in and visits another page that shows I'm logged in. I just cant submit a form after this. I need to visit the submit form to grab values from it

I've tried every thing that doesn't work :(
PHP Code:

curl_setopt($chCURLOPT_URL'http://my.com/login.php?');
curl_setopt ($chCURLOPT_POST1);
curl_setopt ($chCURLOPT_POSTFIELDS'username=PPC&password=madcharacters');
curl_setopt ($chCURLOPT_COOKIEJAR'cookie.txt');
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
$store curl_exec ($ch);
stufffff
curl_setopt
($chCURLOPT_URL'http://my.com/add.php');
$
2ndpagecontent curl_exec ($ch);
echo $
2ndpagecontent


PPC 07-25-2009 10:00 PM

i got it its a beautiful thing

thank u 51bot

all bout tha keywords


All times are GMT -7. The time now is 08:57 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123