ASP-Style Tags

I have a whole site I built from scratch that liberally uses ASP-style tags for php, e.g. <% and %>

This option can be enabled in php.ini, I’m pretty sure, without breaking anything. However, I have looked up, and it should be possible to (in an .htaccess file):

php_flag asp_tags On

But that doesn’t seem to fly on DH for some reason, can anyone help?

That will work, but you can only use PHP options in .htaccess if PHP is running as an Apache module. The default is CGI.

If you want useful replies, ask smart questions.

Good info to know!

Is there any way to accomplish this when run as CGI?


W/out installing your own copy of PHP; No.

Nothing as convenient, no, but you might find ini_set() to be useful. You could put this in your global header or library but, of course, you’d have to use regular PHP tags at the top of your file, up to the point where you call this function to make the change.

It would probably be easier to just change your tag style to the standard <?php ... ?>

If you want useful replies, ask smart questions.

Don’t know if you know (I didn’t but found it useful) you can use <?=$user_name?> just like ASPs <%=user_name%> to print out variables. Very useful when just printing a few variables in a large part of HTML.