thanks for reply. it errors with: Parse error: syntax error, unexpected T_ECHO in line 552 which is
<div class="collapsibleContent"
</div>
Main Topics
Browse All Topicshi
i am having a strange problem which i hope some expert can help me with. very simply if i include a file that dosen't exist <?php "notexist.php"; ?> then the page runs correctly but with just the error msg re missing include. however, if i include a file that does exist <?php "iexist.php";?> then it totally throws all page formatiing off. if i totally remove the php statement the page runs fine. can anyone see anything wrong with this code? many thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Do you just want to get rid of the warning? If so, see this link. It talks about suppressing the warning error.
http://us2.php.net/manual/
>>althought file exists, it dosen't work.
You said earlier "if i include a file that does exist <?php "iexist.php";?> then it totally throws all page formatiing off"
So your "problem" is when there is actually content to include. From what you are describing, the formatting is off because the content of the file that does Exist may be invalid markup and is therefore affecting your design. Maybe there are unclosed tags somewhere. Maybe you have tags/elements that do not confirm to your css rules (if you are using css somewhere)
>> if i put a file that dosen't exist, it runs but obviously with error because of missing file. go figure?
That is the correct behaviour. When you use include("file.php") OR include_once("file.php") you get a warning. However, if you use require("file.php") or require_once("file.php") the execution of the script will abort. There's no need to do "if( file_exists...)". The require once already does that.
hello peter_coop, I believe that an include is evaluated much differently than a regular output like echo, , I would think that if you want to use this include to have output as HTML, you might NOT use things like echo. I think to have HTML output for when you call include you MUST have a return statement
<?php
$foo = 'Good ';
$var = 'PHP';
return $foo.$var;
?>
Business Accounts
Answer for Membership
by: theodorejsalvoPosted on 2009-08-21 at 10:08:10ID: 25153734
One thing to try is to see if the file exists in PHP and if not, just echo " " so the div has something in it.
Select allOpen in new window