Hello,
I was designing a site and a php script I wrote works fine my itself; however, the moment I add include to the PHP script that writes it all of my site except the background disappears; however, it is shifted.
I hope someone can please help me fix and understand why this is happening.
If you have any questions, comments, concerns, suggestions, or solution Please reply.
And of course the code without the include just does not have the php code in that line.
Do you have any other ideas because this is quite strange, I do not understand why the rest of my site is gone
I checked the view-source of what the page looks like, and I found out that nothing after line 136 is there. And all of my content is after line 136.
The code just stops at line 136, even though there is much more code after than. I attached a screenshot of the view source here
Any ideas on why this is happening and why none of my code after line 136 is being parsed even though it is just html and not php. Maybe is there a tag not closed or a function not closed in the php.
EDIT: I found the solution after I carefully read my code. It is explained below. I guess the lessoned learned is to read code carefully and make sure all necessary resources are included. However, I do not understand why an error was not parsed saying the necessary class was not included. How do I make sure the errors are parsed. Do i have to add a php.ini file ? And how do I do that?
when looking at the code of testServer/smartSearch/newsfeed/index.php
I realised that there is another PHP include to the PHP class which I based this entire script off of and I kept that include when I copied the script to smartSearch/ticker.php
but I do not have it in /smartSearch/index.php
I believe i forgot to add it to the file where my site and the news ticker are added together because it is above the doctype and I never look above the doctype because I usually never put anything before it.
This seems like the only sensible explanation because that would cause the script to not parse because it can not find the class it is derived from and therefore stops and does not parse the rest of the html below it.
well because this is on my testServer I have no php.ini file in the root directory.
the RSS Slide works fine it is own directory.
the root of my testserver is myUsername/proejcts/testServer/
In there are two directories
newsfeed/
and
smartSearch/
smartSearch is where my main site is. In newsfeed is the php script I wrote working on its own. I copied the newsfeed dir and pasted it into the smartSearch dir.
then when I go to smartSearch/newsfeed/
it displays the index.php file which contains this:
I then copied and pasted that index.php into the directory one up, which is just /smartSearch/
and I renamed it ticker.php and updated all the links so they can still find the resources.
when I go to my testServer/smartSearch/ticker.php
everything works fine.
So there are no errors in rss_slide.php
Then I simply copied the resource links in to index.php in /smartSearch/ and then added the include in line 136. And my problem occurs.
I hope this made it more clear and you can help with my problem.
I can attach some screenshots or link a video of me showing all this if it helps