Re: Hide the real URL
| From: | Paul Novitski | Date: | Thu, 26 Jul 2007 15:51:01 +0000 |
| Subject: | Re: Hide the real URL | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259582@lists.php.net to get a copy of this message | ||
At 7/26/2007 08:08 AM, M. Sokolewicz wrote:
http://php.net/readfile "Reads a file and writes it to the output buffer. "Returns the number of bytes read from the file. If an error occurs, FALSE is returned and unless the function was called as @readfile(), an error message is printed." I figured that in the case of an image it would make more sense to download a FALSE value to the browser than a text error message. During development & debugging phases error messages are invaluable, but after publication some circumstances dictate no display rather than display of a message. Since the OP was looking for a solution that obfuscated the image URL, I thought the less techy information communicated to the user the better. Richard Heyes' suggestion of using passthru() might work better if it can be used with a mixture of content types on the same page. And, yes, heredoc is definitely a matter of taste. In my own work, its disadvantage (hugging left margin) is outweighed by its advantages (separation of logic from data/template/output, omission of escape codes except the occasional {}, fewer typographical errors, faster proofreading, etc.). I don't feel the need to convince anyone else to use heredoc, but I'm totally sold on it myself. Regards, Paul __________________________ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.comwhy are you suppressing error messages??// output to browser, suppressing error message@readfile($Filename);