Forum Moderators: coopster

Message Too Old, No Replies

Is there a way to turn php off for part of a file?

short tag problem (<? ?>) instead of (<?php ?>)

         

benlieb

3:37 am on Nov 4, 2004 (gmt 0)

10+ Year Member



That is I want to turn php off at a certain point in a file.

The following crashes php because my host has short tags turned on.

<?import namespace="AI" implementation="aiEditor.htc" />

I don't even know what the above code type is, but it's necessary for a web-gui that I'm trying out.

How would you get around this?

mincklerstraat

7:35 am on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



what you could do is go into PHP *before* anything like <? comes up and output that part by echoing it.

<?php
echo '<?import namespace="AI" implementation="aiEditor.htc" />';
?>

mincklerstraat

9:27 am on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



forgot, another thing is just to use an .htaccess file in your root directory to turn off short tags:

php_flag short_open_tag off

benlieb

3:59 pm on Nov 4, 2004 (gmt 0)

10+ Year Member



mincklerstraat,

These are both great ideas. Thanks for the help. I had never delved into .htaccess files, but now intend to soon.