Why does this header cause a problem?

Head out to http://www.countryshowdown.com/app/view_contestants.php?id=58382. No biggie, just the mobile version of the countryshowdown.com page.

I've got dilemma, however, and I'm at a loss as to why it's happening.

I need to swap out the header on this page with something else that will allow for a little drop down animation that alerts the user to the possibility of adding the page to their mobile device as an icon. The script works great and I can put it in the header where it belongs without any issue, but...

I don't want this script to run on any other page beside the view_contestants.php page. Yet, when I change the code from require_once('header.php') to require_once('header_script.php') only a portion of the page is shown and I don't understand why or how to fix it.

For the sake of trying to eliminate problems, I kept the two files - header.php and header_script.php exactly the same. But when you go to  http://www.countryshowdown.com/app/view_contestants_1.php?id=58382, you'll see that only half the content is displayed. Why and how do I fix it?
brucegustPHP DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
bruce!! Do you ever look at the source code in your browser?  To see things like the fact that the second version is trying to include a second page in the page??  I mean, that's one of the first things we do to try to help you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brucegustPHP DeveloperAuthor Commented:
Yes, I do look at the source code...

And I was kind of hoping you could tell me why there's a repetition. Lines 1-275 are repeated. Yet the only difference in the two pages is in one instance I'm calling require once('header.php') and the other page I'm saying require('header_script.php') and both header.php and header_script.php are identical. So why the repetition?

And just for grins, in case I'm missing something obvious, here are the two "headers:"
brucegustPHP DeveloperAuthor Commented:
Here's the other header. Same script, just a different name, but for some reason I'm getting a bunch of redundancy.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Chris StanyonWebDevCommented:
OK. So the headers includes are the same, which means that your 2 pages that are including them are not: Can you post the code for view_contestants_1.php and view_contestants.php.
brucegustPHP DeveloperAuthor Commented:
So I figured before I posted the files, I would go thru, just to make sure, that I wasn't overlooking something ridiculously simple. I mean, I do not recall coding two instances of headers. Why would I be appealing to the experts for something so outrageously simplistic?

Line 6 - there it was: require_once('header.php'); in addition to the other require_once('header_script.php)

I'm an idiot, but I'm a hardworking idiot...

brucegustPHP DeveloperAuthor Commented:
As an aside, it just dawned on me why this was so illusive.

This particular app was outsourced and while I wrote most of the code, the subcontractor (who did a great job) began by copying and pasting my code as a starting point and then changing things as they needed to be altered for the sake of the mobile version that he was responsible for.

He had two instances of require_once('header.php') listed, but it wasn't a problem because it was the same header and line 102 didn't trigger anything because it was identical to line 4.

Here I come several weeks later and make some changes, oblivious to the redundancy and my attempts to troubleshoot begin with something complicated rather than something easy. In other words, I'm looking at replacing the engine rather than beginning by seeing if there's gas in the tank.

Thanks for the other set of eyes...
Chris StanyonWebDevCommented:
Don't feel bad. I've been there and sometimes just explaining the problem to others can help you see it, particularly when it's so obvious - pleased you got it working :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.