V
V
Vahe2016-03-21 18:58:29
PHP
Vahe, 2016-03-21 18:58:29

Reddit API and cURL account creation?

I'm working on an app that allows users to create an account on Reddit (and more), this is my code.

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"https://www.reddit.com/post/reg");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
            "user=valueuser1&passwd=value2password&passwd2=value2password");


curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec ($ch);

curl_close ($ch);

if ($server_output == "OK") { 
echo "true";} else { echo "false"; }

but the result is returned to mefalse

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-03-21
@dimonchik2013

put www.telerik.com/fiddler
sniff
compare with the behavior of your script
in Curl master the option https://curl.haxx.se/libcurl/c/CURLOPT_VERBOSE.html
helps immensely

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question