Please translate tech support's comments

He has: 688 posts

Joined: Feb 2001

The situation is that I've got several different php scripts on several different domains, many of which stopped working all at the exact same time. Also, commenting stuff out seems to not work anymore if what you're commenting out contains php code. I wrote to tech support and here's part of what I was told:

Quote: none of your files have valid tags to define where the pages should start parsing. Another problem, is that you're requiring files in toerh home directories:
require('/home/mikesuss/public_html/gallery/main.php');

1) I've always used the following code as an include.

<?
include "/home/pstvalu/public_html/includes/header.php";
?>
'What's wrong with it? I know I can write <?php but I didn't think I was required to and my codes all worked until last week.

2) Am I incorrect or should the following code do absoultely nothing at all?

<!-- HIDING NEWS SCRIPT
<?
include("/home/pstvalu/public_html/news/show_news.php");
?>
-->
'
Shouldn't the script NOT function because the whole thing was commented out?

3) What are they talking about requiring files in the home directory? If that's the path to my scripts than don't I need to start with /home ?

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

1. You shouldn't need to have the php but it is always a good idea to have it anyway.
2. Those are for HTML comments not php. PHP comments are either \\ or \* *\

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

mairving wrote: 1. You shouldn't need to have the php but it is always a good idea to have it anyway.
2. Those are for HTML comments not php. PHP comments are either \\ or \* *\

I thought it was // and /* */ to comment in PHP Plain

Shirthead's picture

He has: 58 posts

Joined: Jun 2006

What's the error you are getting? Is it something about basedir restriction?

He has: 688 posts

Joined: Feb 2001

There are actually two issues. Before I commented it out, the include to a scipt was working fine but the script being called is what failed (even though it had worked fine for the past year up until recently). (The script is from cutephp.com) I do get an error message but it's not from the include, but from the script being called. If it matters the error is Parse error: syntax error, unexpected $end in /home/pstvalu/public_html/news/inc/functions.inc.php on line 232' But the admin page (totally different page) also stopped working the exact same day. It just sounds ridicuouls to me that a script that's been working flawlessly for over a year would suddenly fail to function in multiple different pages, on multiple sites, all at once.

Now about the commenting, I know that 's and class tags to simplify my post. Since there was actually html around that include call and I wanted to hide the all of it, shouldn't the

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

The issue probably had something to do with an update to PHP. I had some issues recently after an update with the DOCUMENT_ROOT directory not being defined. Another issue was caused by some register globals issues. It seems like there was an issue with includes not working properly as well.

Did you try it with the <?php tag? I doubt if it will make a difference though.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

do an echo of $_SERVER['DOCUMENT_ROOT']; to make sure the path has not changed. If it has, you can always do

$inc_path = $_SERVER['DOCUMENT_ROOT'].'/includes/';
include($inc_path.'header.php');
'

the that are in the include, since the comment will ignore other it finds. Thus:

<--
something

another thing
-->

will hide 'something' and 'something else', but not 'another thing'

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

Renegade is right, // for single line (or #) and /* */ for multi-line.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.