duanjing9339 2014-08-19 14: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 14: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.

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

报告相同问题?