Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12589

Re: how did I wind up with double headers?

Message-ID <4555789.NIToQkNJ70@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2014-01-12 01:18 +0100
Subject Re: how did I wind up with double headers?
Newsgroups comp.lang.php
References <1iz6hl98tu34s$.6mf0ex4z93no.dlg@40tude.net> <g6azku8wa1qg.10do8re9dcoe6$.dlg@40tude.net>

Show all headers | View raw


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).

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how did I wind up with double headers? richard <member@newsguy.com> - 2014-01-11 15:00 -0500
  Re: how did I wind up with double headers? Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-11 21:00 +0000
  Re: how did I wind up with double headers? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-01-11 21:07 +0000
  Re: how did I wind up with double headers? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-11 22:07 +0100
  Re: how did I wind up with double headers? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-01-11 21:08 +0000
    Re: how did I wind up with double headers? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-11 22:04 +0000
      Re: how did I wind up with double headers? Dave Pyles <dave@user.invalid> - 2014-01-11 18:19 -0500
      Re: how did I wind up with double headers? Jerry Stuckle <jstucklex@attglobal.net> - 2014-01-11 19:23 -0500
      Re: how did I wind up with double headers? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-01-12 00:30 +0000
  Re: how did I wind up with double headers? richard <member@newsguy.com> - 2014-01-11 18:18 -0500
    Re: how did I wind up with double headers? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2014-01-12 00:20 +0000
    Re: how did I wind up with double headers? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-12 01:18 +0100
    Re: how did I wind up with double headers? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-01-12 00:37 +0000
  Re: how did I wind up with double headers? Evan Platt <evan@theobvious.espphotography.com.invalid> - 2014-01-11 17:29 -0800
  Re: how did I wind up with double headers? The Natural Philosopher <tnp@invalid.invalid> - 2014-01-12 03:00 +0000

csiph-web