curl ajax 区别,Curl: RE: Curl and Ajax-程序员宅基地

技术标签: curl ajax 区别  

Date: Tue, 12 May 2009 15:48:13 +0000

Hello,

Thank you for quick reply.

Login script ;

$cookie_file_path = "/home/xxxxx/public_html/cookie.txt";

$fp = fopen($cookie_file_path,'wb');

fclose($fp);

$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12)Gecko/20050915 Firefox/1.0.7";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"http://www.xxxxxx.com/user/login");

curl_setopt($ch, CURLOPT_USERAGENT, $agent);

curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);

curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);

curl_setopt($ch, CURLOPT_REFERER,"http://www.xxxxxx.com/user/login");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($ch, CURLOPT_POSTFIELDS,"name=admin&pass=adminhere&form_id=user_login&op=Log in");

$store = curl_exec ($ch); //kaydet

curl_setopt($ch, CURLOPT_COOKIEFILE, '/home/xxxxx/public_html/cookie.txt');

curl_setopt($ch, CURLOPT_URL, "http://www.xxxxxx.com");

$html = curl_exec($ch);

echo $html;

?>

Post Script ;

$postdata=array();

// &form_id=drigg_node_form&op=Submit

$postdata['url']="http://www.domainname.com";

$postdata['title']="title";

$postdata['body']="body paragraph";

$postdata['taxonomy[4]']="32";

$postdata['taxonomy[tags][6]']="test";

$postdata['form_token']="87517a3d7c11c8d8af9f2d2f0142f1a1";

$postdata['form_id']="drigg_node_form";

$postdata['op']="Submit";

$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12)Gecko/20050915 Firefox/1.0.7";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"http://www.xxx.com/submit");

curl_setopt($ch, CURLOPT_COOKIEFILE, '/home/xxxx/public_html/cookie.txt');

curl_setopt($ch, CURLOPT_VERBOSE, 1);

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);

$buf=curl_exec ($ch);

curl_close ($ch);

echo $buf;

?>

Post script fill the forms correctly and trying to submit it but the response from my web site is "Validation error, please try again. If this error persists, please contact the site administrator."

Sincerely,

Date: Tue, 12 May 2009 16:13:29 +0100

Subject: Re: Curl and Ajax

From: msjunior_at_gmail.com

To: curl-and-php_at_cool.haxx.se

as u said, posting ur script would help us help u

best.

2009/5/12 Cem S

Hello dear curl-and-php mail list users,

First time, I have joined a maillist, If I do something wrong, please let me know.

I have problem post something to my web site with curl. I am using drigg on my web site.

My script can/cannot do following actions ;

Can login to the web site.

Can fill the forms.

Can't submit.

I think, the problem is with drigg. Drigg checks urls valid or not.

Any help would be appreciated. If needed I could post my curl script.

Kind regards,

check out the rest of the Windows Live�.

More than mail�Windows Live� goes way beyond your inbox.

More than messages

_______________________________________________

_________________________________________________________________

More than messages�check out the rest of the Windows Live�.

http://www.microsoft.com/windows/windowslive/

_______________________________________________

http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Received on 2009-05-12

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_35062801/article/details/119467767

智能推荐

springMVC中文乱码_spring jdbc中文乱码-程序员宅基地

文章浏览阅读111次。一、页面编码<%@ page contentType="text/html;charset=UTF-8" language="java" %><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> 二、URL中的乱码  改tomcat中server.xml中Connector_spring jdbc中文乱码

2021-06-09 Linux INIT_DELAYED_WORK schedule_work 延时队列使用学习-程序员宅基地

文章浏览阅读3.9k次,点赞5次,收藏13次。https://blog.csdn.net/qq_31339221/article/details/105057978https://blog.csdn.net/qq_31339221/article/details/105057978_init_delayed_work

linux设置双屏拼接_双屏、3屏拼接——A卡、N卡——Windows、Linux-程序员宅基地

文章浏览阅读2k次。“折腾是一种生活态度”。买了个显卡,在公司折腾了下双屏和3屏,记录一下。3个20英寸的显示器,分辨率都是1600x900。普通双屏:1个屏幕有任务栏,另一个没有任务栏,分辨率单独设置,壁纸重复显示一张,分辨率都是1600x900。双屏水平拼接:通过显卡驱动设置,操作系统检测到1个显示器,分辨率为3200x900,1个超长任务栏横跨2个屏幕,1个超长壁纸横跨2个屏幕。3屏水平拼接:分辨率为4800x..._横屏双屏壁纸拼接

反射之getDeclaredMethod和getMethod的区别以及一些小技巧_反射getdeclaredmethod-程序员宅基地

文章浏览阅读6.8k次,点赞2次,收藏8次。区别getDeclaredMethod:获取当前类的所有声明的方法,包括public、protected和private修饰的方法。需要注意的是,这些方法一定是在当前类中声明的,从父类中继承的不算,实现接口的方法由于有声明所以包括在内。getMethod:获取当前类和父类的所有public的方法。这里的父类,指的是继承层次中的所有父类。比如说,A继承B,B继承C,那么B和C都属于A的父类。..._反射getdeclaredmethod

计算机java毕业设计 JavaWeb的图书查询管理系统_怎么描述java项目中图书管理页面的内容-程序员宅基地

文章浏览阅读415次。 Hi,各位同学好呀,这里是L学长!今天向大家分享一个今年(2022)最新完成的毕业设计项目作品基于JavaWeb的图书查询管理系统 学长根据实现的难度和等级对项目进行评分(最低0分,满分5分)难度系数:3分工作量:3分创新点:3分。_怎么描述java项目中图书管理页面的内容

html5安卓机判断刘海屏,Android判断是否为刘海屏-程序员宅基地

文章浏览阅读1.5k次。主要总结主流品牌小米、华为、oppo、vivo的刘海屏判断。在某些特殊页面需要适配刘海屏时,可以用以下方法判断。或者判断屏幕比例是否大于2。/*** 小米刘海屏判断.*/public static int getInt(String key,Activity activity) {int result = 0;if (isXiaomi()){try {ClassLoader classLoader..._h5中如何判断根据手机有没有刘海屏灵动岛

随便推点

J.U.C之AQS源码解读以及ReentrantLock源码解读_reentrantlock 源码-程序员宅基地

文章浏览阅读1k次。文章目录前言AQS重要变量unsafeReentrantLocklock方法加锁原理公平锁非公平锁公平锁跟非公平锁的代码区别参考博客前言像我大佬烟说过:面试的时候颜值可以提高分数,没有颜值的话就需要会点J.U.C。人丑就要多读书,没错说的就是我。AQS是AbstractQueuedSynchronizer缩写,作者是@author Doug Lea并发大神,致敬一哈。J.U.C很多东..._reentrantlock 源码

测序总结,高通量测序名词-程序员宅基地

文章浏览阅读573次。主要来自 :http://mp.weixin.qq.com/s/iTnsYajtHsbieGILGpUYgQ测序的黄金标准:一代测序了,故称之为黄金测序。高通量测序最近这几年很火越来越火,但是世界上更多的还是一帮天天做分子克隆、养细胞、养细菌、杂蛋白的生物学家,究其原因Sanger测序还是测序届的金标准,由于精确度高于2、3代测序且保持大白菜价格使之地位稳固。应用范围:De Novo测..._一个unigene在可以被注释到几个通路中吗

WinForm界面布局空间---WeifenLuo.WinformUI.Docking-程序员宅基地

文章浏览阅读1.1k次。最近在学习Sharpdevelop的过程中,看到了使用的很好的winform页面布局控件,感觉非常的不错。实现效果如下所示:这里我就简单的下一下他的实现步骤,当中我也看考了其他人的博客。1)创建一个windowsForm的应用程序2)添加引用:WeifenLuo.WinFormsUI.Docking他是一个DLL文件,可以自行从网络上下载。3)设置Form1窗体作为父窗..._weifenluo.winformui.docking

操作系统作业调度实验报告-程序员宅基地

文章浏览阅读1.6w次,点赞7次,收藏62次。一、实验名称作业调度算法实验。二、实验目标已知n个作业的进入时间和估计运行时间(以分钟计)(1)单道环境下,分别用先来先服务调度算法、短作业优先调度算法、响应比高者优先调度算法,求出批作业的平均周转时间和带权平均周转时间;在多道环境(如2道)下,求出这些作业的平均周转时间和带权平均周转时间(2)就同一批次作业,分别讨论这些算法的优劣;(3)衡量同一调度算法对不同作业流的性能_操作系统作业调度实验报告

68 数据采集与线程池隔离使用-程序员宅基地

文章浏览阅读42次。我们按照xxl-job-executor-sample-springboot给我们提供的流程整合xxljob;1)stock_backend工程引入核心依赖--引入xxljob核心依赖--> < dependency > < groupId > com.xuxueli < artifactId > xxl-job-core

源码_拍照判卷源码-程序员宅基地

文章浏览阅读2k次。文件夹 PATH 列表卷序列号为 000A-8F50E:.│ javaapk.com文件列表生成工具.bat│ 使用说明.txt│ 免费下载更多源码.url│ 目录列表.txt│ ├─android web应用│ jqmDemo_static.zip│ jqmMobileDemo-master.zip│ jqmMo_拍照判卷源码

推荐文章

热门文章

相关标签