short_open_tags

Status
Not open for further replies.

nol888

New Member
Messages
292
Reaction score
0
Points
0
Could you turn the php config "short_open_tags" off? At least for my account? I can't seem to change it using "ini_set". When I put "<?xml version='1.0' encoding='UTF-8'?>" in my page, the php module stupidly thinks it's for php and gives an error. >.<
 

dest581

New Member
Messages
348
Reaction score
0
Points
0
<? echo "<?xml version='1.0' encoding='UTF-8'?>"; ?>

That would work, right?
 

noerrorsfound

New Member
Messages
1,736
Reaction score
1
Points
0
I am also having the same problem as him. I'm not sure about him, but my page is an HTML page and it is being interpreted as a PHP page. It ends in .html so it shouldn't be parsed by PHP.
 
Last edited:

lambada

New Member
Messages
2,444
Reaction score
0
Points
0
USe this it's what I use:

<?php echo '<?xml version="1.0" encoding="utf-8"?>';?>

@noerrorsfound: Make sure that in cPanels Apache Handlers .html isn't listed as needing application/x-httpd-php
 
Last edited:

noerrorsfound

New Member
Messages
1,736
Reaction score
1
Points
0
@noerrorsfound: Make sure that in cPanels Apache Handlers .html isn't listed as needing application/x-httpd-php
It is. I can't remove it, though.

(In a code tag so it keeps the spacing.)
Code:
[U][B]User Defined Handlers[/B][/U]
[U][B]System Defined Handlers[/B][/U]
.cgi .pl	                            cgi-script
.php .php4 .php3 .html .htm	application/x-httpd-php
.shtml	                                   server-parsed

As you can see, it's listed under System Defined Handlers, so I can't remove it.

There is really no reason for html and htm files to be parsed by PHP, is there? If someone intends for something to be a PHP document then they should change the extension to php. I'm wondering why these two extensions were recently added. If someone needs these to be parsed this way then they're always able to configure it that way for themselves. For those of us that don't need it, though, there's no reason to force it on us.
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
try adding html as "text/html"
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
try adding html as "text/html"

I just did and I got a very...strange output.

Under user-defined it shows html as being text/html, but it never moved it out of the system defined handlers either.

I don't have a site where html actually has php to parse though, but unless user-defined overrides system defined then it still wont work :(
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
I just did and I got a very...strange output.

Under user-defined it shows html as being text/html, but it never moved it out of the system defined handlers either.

I don't have a site where html actually has php to parse though, but unless user-defined overrides system defined then it still wont work :(

User should override System; not exactly sure how that system works;)
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
If user does indeed override system then it should be fine :)

In all honesty though noerrorsfound was right - there isn't much of a reason to parse HTML for php in any case. I can see it for user functionality (IE, people who don't follow the best coding practices and don't name their files .php when theres php to process), but thats about it.

If theres no updates on this tomorrow I'll whip up a crappy html-named php script to see if user overrides system, I need to get some sleep though :S
 
Status
Not open for further replies.
Top