开发者

How to create manual php header?

hello i would like to know how would it be possible to create a manual php header example

header("Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\");

instead of using that i would like to create manual it as

$senddata = "开发者_运维技巧Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"".$nn;


This:

ob_start();

$senddata = "Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"".$nn;

header($senddata);

but make sure that you have constructed the valid header.


ob_start();
.... other stuff ....
$senddata ="Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"".$nn;
header($senddata);

?


If you need to get the fieldname and filename and some data is outputted before, you can look into output buffering

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜