...

View Full Version : Commenting out includes



Daf
01-29-2007, 11:54 AM
Hi all,

Having a bit of trouble commenting out some php includes. I have some includes that are only used periodically - so I comment them out at times. I generally use firefox so I didn't notice, right off, that IE was still displaying the includes! What??

See below:


<!-- Bulletin -->
/*<?php $CatID='53'; include('news/News.php'); ?>*/
Displays this in IE /* */


<!-- Bulletin -->
<!-- <?php $CatID='53'; include('news/News.php'); ?> -->

Displays this in IE -->

The only way I was able to accomplish it was to break the include code bu adding some space between the first 2 characters of the line.


<!-- Bulletin -->
<!-- < [space] ?php $CatID='53'; include('news/News.php'); ?> -->

I guess I don't understand how to comment out this include correctly for IE. Please advise. :)

Thanks
Daf

VIPStephan
01-29-2007, 02:05 PM
Hm, might be that the closing bracket of the PHP command makes IE think the comment is closed:


ws.php'); ?> -->


You could/should try it with a PHP comment within the PHP:



<?php /* $CatID='53'; include('news/News.php'); */ ?>

or use the PHP command brackets for the comment:


<!-- ?php $CatID='53'; include('news/News.php'); ? -->

Daf
01-29-2007, 03:29 PM
Thanks! Both of your suggestions work. :)

Daf



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum