drg14799 2015-10-14 08:57
浏览 52

使用cURL PHP登录Tumblr

I've been trying to login to Tumblr.com using cURL PHP.

I've also captured the right post data from Firefox Addon HTTPFox.

The problem is, when I echo out the value of $login_result only blank page shows up and nothing more than that.

What I want to do with Tumblr can only be done by authenticating yourself and I am not being able to proceed further more.

I am attaching the code. Thank you!

    <?php

$ch = curl_init();

$login_url = "https://www.tumblr.com/login";

$post_fields = "user%5Bemail%5D=xxxxx%40gmail.com&user%5Bpassword%5D=xxxxxxxxxx&tumblelog%5Bname%5D=&user%5Bage%5D=&context=no_referer&version=STANDARD&follow=&form_key=%211231444806625%7CTDf9wvG6TTcfiWFiVgzvmI2NCUQ&seen_suggestion=0&used_suggestion=0&used_auto_suggestion=0&about_tumblr_slide=&random_username_suggestions=%5B%22StickyWizardPersona%22%2C%22DarkKidFest%22%2C%22DeliciouslyCyberBouquet%22%2C%22SuperbGoateeUnknown%22%2C%22SeverelyNumberOneEnemy%22%5D";

curl_setopt($ch, CURLOPT_URL, $login_url);

curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0");

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);

curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$login_result = curl_exec($ch);


?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘