Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on

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?
PHPCSS

Avatar of undefined
Last Comment
Chris Stanyon

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dave Baldwin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Bruce Gust

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:"
header.php
ASKER
Bruce Gust

Here's the other header. Same script, just a different name, but for some reason I'm getting a bunch of redundancy.
header-script.php
SOLUTION
Chris Stanyon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Bruce Gust

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

Thanks.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER
Bruce Gust

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 Stanyon

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