How to enable PHP to run with <? ?>

lkovnih226

Member
Registered
Joined
Dec 11, 2012
Messages
62
Points
0
I bought a script but the programmers makes php codes with <? ?>
I ran it on my hosting but it is showing error, I tried to add <?php ?> then it worked.
I uploaded to some different web hostings then some worked with <? ?> but some only <?php ?>

My question is how to enable PHP to run with <? ?>

thanks
 

elcidofaguy

Well-known member
Registered
Joined
Jan 13, 2015
Messages
866
Points
0
I bought a script but the programmers makes php codes with <? ?>
I ran it on my hosting but it is showing error, I tried to add <?php ?> then it worked.
I uploaded to some different web hostings then some worked with <? ?> but some only <?php ?>

My question is how to enable PHP to run with <? ?>

thanks
Easy to do with amending the short_open_tag in php.ini:

short_open_tag = on
 

ElixantTechnology

Well-known member
Registered
Joined
Nov 26, 2014
Messages
281
Points
43
The mentioned tags have not been used since PHP Version 3/4 and should not be used generally. They used to be the norm, but they conflict with XML headers when running parsable XML files.

<? (which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option).

If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because PHP will start output buffering when there is no intention from the programmer to send any output at that point in the script.
 
Older Threads
Replies
9
Views
4,679
Replies
1
Views
3,599
jms
Replies
22
Views
12,142
Replies
6
Views
6,495
Newer Threads
Latest Threads
Replies
0
Views
68
Replies
1
Views
199
Replies
0
Views
32
Replies
0
Views
40
Replies
1
Views
151
Recommended Threads
Replies
4
Views
4,927
Replies
2
Views
4,319
Replies
17
Views
7,779

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top