Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jerry Stuckle Newsgroups: comp.lang.php Subject: Re: PHP Always Outputs Date: Sat, 14 Jul 2012 16:16:03 -0400 Organization: A noiseless patient Spider Lines: 128 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 14 Jul 2012 20:16:07 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="96372c5206308f96aea5409fef9765ed"; logging-data="22397"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xlaxBWNKv2O/dGTfcU7WzoVZnWcZPTFU=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: Cancel-Lock: sha1:kslVVaymEbe9s2iU1t6jI1IhuEE= Xref: csiph.com comp.lang.php:6563 On 7/14/2012 4:12 PM, Doug Miller wrote: > Jerry Stuckle wrote in > news:jtsfl7$rqo$1@dont-email.me: > >> On 7/14/2012 10:40 AM, Doug Miller wrote: >>> Jerry Stuckle wrote in >>> news:jtrt6u$ccj$1@dont-email.me: >>> >>>> On 7/14/2012 9:37 AM, Doug Miller wrote: >>>>> Ryan wrote in >>>>> news:a5baa7aa-287c-4862-8ab9-898783d691f4 @googlegroups.com: >>>>> >>>>>> I want a php script to run and simply output nothing. But >>>>>> even this script: >>>>>> >>>>>> >>>>> ?> >>>>>> >>>>>> will output this html >>>>>> >>>>>> >>>>> Transitional//EN"> >>>>>> >>>>> http-equiv=Content-Type> >>>>>> >>>>>> Is there a setting somewhere in my php or apache config that >>>>>> needs to be turned off? >>>>> >>>>> Check your .htaccess file -- it probably contains a line that >>>>> looks like this: >>>>> >>>>> php_value auto_prepend_file "foo.php" >>>>> >>>>> with the contents of the file foo.php resembling >>>>> >>>>> echo "!>>>> echo ""; >>>>> etc. >>>>> >>>> If it were, it would be seriously broken. >>> >>> I disagree. >>> >>>> There would be no way >>>> to add tags or the in their proper places. >>> >>> Of course there is. I have reproduced the OP's results >>> *exactly* with the following: >>> >>> C:\WebSites\fubar>type .htaccess >>> php_value auto_prepend_file "prepend.php" >>> php_value auto_append_file "append.txt" >>> >>> >>> C:\WebSites\fubar>type prepend.php >>> >> printf (">> Transitional//EN\">\n"); printf ("\n"); >>> printf (">> http-equiv=Content-Type> \n"); >>> printf (""); >>> ?> >>> >>> C:\WebSites\fubar>type append.txt >>> >>> >>> Content of the OP's pages will be served between the and >>> tags. If he wants to be able to add tags in the HEAD >>> section as well, it's simple enough to insert readfile >>> ("head_tags.txt") into the file prepend.php somewhere between >>> and <\HEAD>, putting the desired tags into >>> head_tags.txt. >>> >> >> Now, how is the user supposed to place other tags such as >> , <SCRIPT> and <LINK>? The answer is, he can't. > > Ummmm, yes, he can. I just described how that can be done. > >> And while he >> *could* put a readfile() in there, it would be no different than >> placing the tags directly in the file. He couldn't customize >> the tags to the page. > > I didn't say that the tags could be customized. But you *did* say > they couldn't be inserted at all. Which they obviously can. That is not inserting tags. It is just copying them from a file - just as if they were in the original header. >> >> While what you say *could* be used - it would result in a >> seriously broken site with the inability to add such tags. > > Again -- there is no such "inability to add" tags in the HEAD > section. OK, they can't be customized. But let's back up a few > paragraphs, to where you said "there would be no way" to add them. > Of course there is. > Which makes them pretty worthless. And no, you are NOT "adding them". You are just placing fixed tags in the header. >> Also, there would be no need to use printf() there. Just the >> HTML code itself would be fine. > > If the prepended file is just HTML code, not a PHP script, then > it's not possible to use readfile() to insert any head tags that > may be desired. > Which, since it is always reading the same file, is no different than just placing the tags in the HTML file itself. You are over-complicating the problem with a *very stoopid* response. The *real* problem here is that IE is inserting the HTML when it gets the blank page back. It is easily duplicated in IE8. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================