How can I use multiple PHP header content types on the same page? is this possible?

后端 未结 6 741
说谎
说谎 2020-12-06 21:38

Is it possible to use multiple header types in one document? For example:

header(\"Content-type: image/jpeg\");
header(\'Content-Type: text/html; charset=utf         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-06 22:38

    Be careful about what parameters you are passing to the wrapper file, in order that it finds the relevant image, and ONLY the relevant image, not /etc/passwd or any other file.

    It's best to hard code the base dir in the script and don't accept any hierarchy in the input. It's probably best to not use real filenames at all and do the lookup in a mapping table (in a db, array in your script or wherever)

提交回复
热议问题