First of all...I used NOTEPAD to create the php files. So I'm using a real text editor and not a format one like wordpad or something.
The only thing I can think of that MIGHT cause the issue in changing the type of line break is to make editing the php code on my website easy (without using a software program) i created a simple php webpage that can edit my php code on the fly. Basically that editor pulls the source code into a text box where i can edit the code and it will save the updates. So I'm wondering if the php code I already created properly in Notepad might be changed in some form when i use this editor to update the page source code. However...if this IS an issue...it must also be a configuration issue since my online website doesn't have any problem...I only noticed this problem when I started accessing those pages offline thru Xampp.
Now the problem:
I have an index.php page with the snippet code:
- Code: Select all
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/inc.common.php';
?>
Now the index page is working fine...
HOWEVER the inc.common.php page starts with the following code:
- Code: Select all
<?php
session_start();
The problem happens when I access index.php. As soon as I do it outputs an error: "Call to undefined function phpsession_start" in the inc.common.php file
Then I goto inc.common.php and open in notepad. While the code was originally spaced correctly, it now looks like a jumbled mess and looks like:
- Code: Select all
<?phpsession_start()
For some reason...even though I'm not editing the php, only accessing the index php which includes the common file, it looks at my line breaks in the common file and removes them. I can actually re-edit the file and put a SPACE between php and session_start and it runs fine until then next error. I can even press a new line break and it works fine. But if I copy/paste the original code from notepad, it will repeat the error. However index.php is unchanged.
So it's clearly and issue between different types of line breaks or something like that ALONG with a configuration setting probably in php.ini that can be modified since my webserver doesn't do this.
Any ideas?
Basically I just need to find out either a) what configuration i can change to make like my webserver so it will ignore this or b) figure out why the line break is changing that is causing the issue so that I can make sure to stop creating this issue in the future and having to manually re-edit multiple pages. Obviously the latter B option is what I'd really like to do to make sure my code stays proper and concise.