|
|
|
|
|
|
|
|
Re: how did I wind up with double headers? [message #184570 is a reply to message #184569] |
Sun, 12 January 2014 00:20   |
Beauregard T. Shagnas
Messages: 154 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
richard the sto0pid wrote:
> richard the sto0pid wrote:
>> http://mroldies.net/home.php
>>
>> View the page source.
>> You will see I have two sets of headers.
>> Yet, the original document does not!
>> Where in the hell did the extra headers come from?
>
> For you whiners that insist, here's the damn whole page with code.
>
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="utf-8">
> <title>Mr Oldies Preserving Rock and Roll Forever!</title>
>
> <style>
>
> </style>
>
> </head>
>
> <body>
>
> <?php
>
> $go=$_GET['a'];
> if(empty($go)){$go=0;}
>
> if ($go==0){include "http://mroldies.net/home1.php";}
> if ($go==1){include "http://mroldies.net/test/index2.php";}
> if ($go==2){include "http://mroldies.net/radio/24hours.php";}
If you were smart enough, you would use an if/elseif or a switch command
there, saving processing time. But that's beyond your meager abilities.
> ?>
>
>
> </body>
> </html>
And if you had even a modicum of ability, you would know that each one of
those possible includes *already has* html, head, and body elements.
It's so simple, even a child could understand it.
--
-bts
-This space for rent, but the price is high
|
|
|
|
|
Re: how did I wind up with double headers? [message #184573 is a reply to message #184569] |
Sun, 12 January 2014 00:18   |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
richard wrote:
> On Sat, 11 Jan 2014 15:00:48 -0500, richard wrote:
>> http://mroldies.net/home.php
>>
>> View the page source.
>> You will see I have two sets of headers.
>> Yet, the original document does not!
>> Where in the hell did the extra headers come from?
>
> For you whiners that insist, here's the damn whole page with code.
Evidently, *you* are the whiner.
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="utf-8">
> <title>Mr Oldies Preserving Rock and Roll Forever!</title>
>
> <style>
>
> </style>
Remove that empty “style” element.
>
>
>
Why all those empty lines?
> </head>
>
> <body>
>
> <?php
>
> $go=$_GET['a'];
> if(empty($go)){$go=0;}
>
> if ($go==0){include "http://mroldies.net/home1.php";}
(null == 0) and ("" == 0), so if you compare like this (with type juggling),
you can skip the initialization.
> if ($go==1){include "http://mroldies.net/test/index2.php";}
> if ($go==2){include "http://mroldies.net/radio/24hours.php";}
As you have been told before: This will include whatever PHP *generates*
from these resources, if it parses them on <http://mroldies.net/>. Very
likely you want to use the relative file paths instead of URIs, e. g.
"home1.php".
It is also the worst possible way of selecting content for inclusion.
You could at least have used “switch” or a mapping array.
--
When all you know is jQuery, every problem looks $(olvable).
|
|
|
|
|
Re: how did I wind up with double headers? [message #184582 is a reply to message #184562] |
Sun, 12 January 2014 03:00  |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 11/01/14 20:00, richard wrote:
> http://mroldies.net/home.php
>
> View the page source.
> You will see I have two sets of headers.
> Yet, the original document does not!
> Where in the hell did the extra headers come from?
>
probably you included something richard.
But knowing you, it could be almost anything.
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
|
|
|