Login to wordpress.com using cURL (help)

Status
Not open for further replies.

Rascagua

New member
Jun 18, 2007
281
3
0
whats the process for logging onto wordpress.com? ofcourse using php and curl.

If you can help me or link me to a tutorial I would be very grateful...

heck, if you could show me how to login any site, that would be awesome...

all I need to know is how can I look at a header and figure this out.
 


currently what the script I have set up to login, but it isnt working is:

PHP:
<?php
$url = "https://wordpress.com/wp-login.php";
$post = "log=testerette&pwd=testerrette&testcookie=1&redirect_to=http%3A%2F%2Fwordpress.com%2F&submit=Login";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); 
curl_setopt($ch, CURLOPT_COOKIEFILE, “cookies.txt”);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);
curl_close($ch);
?>
I have no idea what to do... or why it wont work...

holy shits... I found the error...

https://wordpress.com/wp-login.php

should have been

WordPress.com Blog › Login

that was an annoying 10 hour detour
 
Status
Not open for further replies.