duanjing9339 2014-08-19 22:47
浏览 55
已采纳

弄清楚在PHP中传递标头的方法

Referring to the following PHP code here

$data = array(
    'foo' => 'foo foo foo',
    'bar' => 'bar bar bar',
    'baz' => 'baz baz baz'
);

The explanation for CURLOPT_POSTFIELDS below the code in the document says that :

equivilent HTML form value for this might be something like <input type='hidden' name='foo' value='foo foo foo' />

1)How did the person who explained the code in the document figured out that the type was hidden in its HTML equivalent?

2)What if I have to use type = header, then how would the PHP code would look like?

  • 写回答

1条回答 默认 最新

  • duanquanhan2333 2014-08-19 22:54
    关注

    You can figure out form elements of a remote page by downloading it and parsing it using an HTML parser like this : http://simplehtmldom.sourceforge.net/

    Or you could simple view source and forge your script accordingly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化