开发者

How to create manual php header?

开发者 https://www.devze.com 2023-01-01 17:08 出处:网络
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\\\");

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

精彩评论

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