Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6563
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: PHP Always Outputs |
| Date | 2012-07-14 16:16 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <jtsk27$lrt$1@dont-email.me> (permalink) |
| References | (1 earlier) <XnsA09061B2DDDBBdougmilmaccom@88.198.244.100> <jtrt6u$ccj$1@dont-email.me> <XnsA0906C7C39899dougmilmaccom@88.198.244.100> <jtsfl7$rqo$1@dont-email.me> <XnsA090A4C7FC3D3dougmilmaccom@88.198.244.100> |
On 7/14/2012 4:12 PM, Doug Miller wrote:
> Jerry Stuckle <jstucklex@attglobal.net> wrote in
> news:jtsfl7$rqo$1@dont-email.me:
>
>> On 7/14/2012 10:40 AM, Doug Miller wrote:
>>> Jerry Stuckle <jstucklex@attglobal.net> wrote in
>>> news:jtrt6u$ccj$1@dont-email.me:
>>>
>>>> On 7/14/2012 9:37 AM, Doug Miller wrote:
>>>>> Ryan <rbilesky@gmail.com> 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:
>>>>>>
>>>>>> <?php
>>>>>> ?>
>>>>>>
>>>>>> will output this html
>>>>>>
>>>>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
>>>>>> Transitional//EN"> <HTML><HEAD>
>>>>>> <META content="text/html; charset=windows-1252"
>>>>>> http-equiv=Content-Type></HEAD> <BODY></BODY></HTML>
>>>>>>
>>>>>> 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 "!<DOCTYPE HTML PUBLIC...";
>>>>> echo "<HTML><HEAD>";
>>>>> etc.
>>>>>
>>>> If it were, it would be seriously broken.
>>>
>>> I disagree.
>>>
>>>> There would be no way
>>>> to add <HEAD> tags or the <BODY> 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
>>> <?php
>>> printf ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
>>> Transitional//EN\">\n"); printf ("<HTML><HEAD>\n");
>>> printf ("<META content=\"text/html; charset=windows-1252\"
>>> http-equiv=Content-Type> </HEAD>\n");
>>> printf ("<BODY>");
>>> ?>
>>>
>>> C:\WebSites\fubar>type append.txt
>>> </BODY></HTML>
>>>
>>> Content of the OP's pages will be served between the <BODY> and
>>> </BODY> 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
>>> <HEAD> and <\HEAD>, putting the desired tags into
>>> head_tags.txt.
>>>
>>
>> Now, how is the user supposed to place other <HEAD> tags such as
>> <TITLE>, <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
==================
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PHP Always Outputs Ryan <rbilesky@gmail.com> - 2012-07-13 21:21 -0700
Re: PHP Always Outputs Luuk <luuk@invalid.lan> - 2012-07-14 10:54 +0200
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 09:19 -0400
Re: PHP Always Outputs Luuk <luuk@invalid.lan> - 2012-07-14 16:21 +0200
Re: PHP Always Outputs Luuk <luuk@invalid.lan> - 2012-07-14 16:51 +0200
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 15:46 -0400
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 09:17 -0400
Re: PHP Always Outputs Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-07-14 13:37 +0000
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 09:46 -0400
Re: PHP Always Outputs Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-07-14 14:40 +0000
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 15:00 -0400
Re: PHP Always Outputs Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-07-14 20:12 +0000
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 16:16 -0400
Re: PHP Always Outputs Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-07-15 00:59 +0000
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-14 21:49 -0400
Re: PHP Always Outputs Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-07-15 16:14 +0000
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-15 14:15 -0400
Re: PHP Always Outputs Michael Vilain <vilain@NOspamcop.net> - 2012-07-16 16:48 -0700
Re: PHP Always Outputs Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-16 20:30 -0400
Re: PHP Always Outputs The Natural Philosopher <tnp@invalid.invalid> - 2012-07-17 09:12 +0100
Re: PHP Always Outputs "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-07-16 11:52 +0200
Re: PHP Always Outputs Tim Streater <timstreater@greenbee.net> - 2012-07-16 19:18 +0100
Re: PHP Always Outputs "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-07-17 09:30 +0200
Re: PHP Always Outputs Tim Streater <timstreater@greenbee.net> - 2012-07-17 09:49 +0100
Re: PHP Always Outputs "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-07-17 11:03 +0200
Re: PHP Always Outputs "Peter H. Coffin" <hellsop@ninehells.com> - 2012-07-17 09:58 -0500
Re: PHP Always Outputs Arno Welzel <usenet@arnowelzel.de> - 2012-07-16 14:20 +0200
csiph-web