View Full Version : anything wrong with this simple text grabber?
BroChris
08-27-2002, 09:51 PM
Will this work for everybody? It seems too simple.
<?php @readfile("header.txt"); ?>
mordred
08-27-2002, 10:55 PM
Short answer: Yes. It's similar to require, include, require_once etc.
Long answer: Only you know what you mean with "everybody".
BroChris
08-27-2002, 11:17 PM
I mean anybody who has a browser. Will it work for anybody who could possibly access my website?
Nightfire
08-27-2002, 11:45 PM
Yeah it will :) Serverside scripting is completely different from say javascript or html. This gets processed from the server, so it doesn't matter what browser the user is using, which unlike html or javascript is processed on the users browser.
mordred
08-27-2002, 11:49 PM
Perhaps I'm stating the obvious, but nevertheless: PHP is processed entirely on the server. What you ask is whether browsers can handle the output generated by this PHP script. And that depends totally on the browser, but generally it should display the contents of header.txt as best as it can, interpreting HTML tags if there are any, just like any other static html page.
Unless, of course, you add additional headers that tell the browser another content-type is coming ahead. If you don't do that (like in your script), then the output is sent IIRC as text/html, which every browser should be able to interpret.
You won't come around testing it yourself in as many browsers as you deem necessary.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.