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 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?