Page 1 of 1

weird html script in browsers.

PostPosted: 10. July 2011 07:52
by xxgiga
Hello, I'm a newbie regarding this matter, and I have a problem. I'm sorry if this was already posted, but I'm not sure what's the exact name of the problem that I have, so I couldn't figure out what to type in the search box :(

I was using Windows XP long time ago and I installed XAMPP to list my videos collection inside my computer, and it works well. Then I was about to format my comp to become windows 7 in April, my friend helped me to back up anything that I had worked and told me to keep it inside Drive D. Then after I formatted the comp, I didn't install XAMPP again (so practically I didn't use it) until recently in June. After I installed it and had everything running (Apache, MySql), put the back up datas in proper place, I open the http://localhost and it shows normal like this :

Image

But when I browse other section under the Main Menu it becomes weird like this :

Image

Same goes to the other section :

Image


I showed this to my friend, then when he tried it in his computer (I gave him the XAMPP installer & folders of my backup datas) it worked just fine! Just like when I use it in my old Windows XP. And all the datas I had stored inside it showed up nicely.

And I'm afraid I can't fix it myself because I was just practically receive this program, I only need to store the list without superior knowledge regarding how the program works.

Any help will be so much appreciated. Thank you :)

Re: weird html script in browsers.

PostPosted: 10. July 2011 10:32
by xxgiga
Hi wole,

I've read through the link you gave me, and I'm afraid I don't really understand of what should I do. Is it means that I have to either downgrade/upgrade my XAMPP version or something else? Sorry I'm really worse at programming stuff, I only understand CSS a bit and that's it :(

Re: weird html script in browsers.

PostPosted: 10. July 2011 11:09
by Altrea
xxgiga wrote:Is it means that I have to either downgrade/upgrade my XAMPP version or something else?

No, you have two possibilities:

1st: Change all <?= to <?php echo and all <? to <?php by hand or with a replace function of any text editor
2nd: switch the function short_open_tag in the php.ini to On, and restart your Apache

Re: weird html script in browsers.

PostPosted: 13. July 2011 07:10
by xxgiga
Altrea wrote:
xxgiga wrote:Is it means that I have to either downgrade/upgrade my XAMPP version or something else?

No, you have two possibilities:

1st: Change all <?= to <?php echo and all <? to <?php by hand or with a replace function of any text editor
2nd: switch the function short_open_tag in the php.ini to On, and restart your Apache


Hi Altrea,
I'm using the 2nd possibility (because I don't understand how to do the first @.@), I have the value ON already, but there are 3 values like this :
; short_open_tag
; Default Value: On
; Development Value: Off
; Production Value: Off

Should I change all of them to ON?

Re: weird html script in browsers.

PostPosted: 13. July 2011 07:46
by Sharley
xxgiga wrote:but there are 3 values like this :
; short_open_tag
; Default Value: On
; Development Value: Off
; Production Value: Off

Should I change all of them to ON?
No! this is not the place as all those entries are comments or examples only.

Scroll down the php.ini file further until you see a section that looks like this
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;

; Enable the PHP scripting language engine under Apache.
; http://php.net/engine
engine = On

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off
Change to On the last line that I have emphasized in red so it looks like this
short_open_tag = On
Then save the php.ini file and restart Apache (a must do).

Next, clear your Firefox browser's cache (Tools>Options>Advanced>Network>Offline Storage>Clear Now) so you do not get an old cached page instead of a fresh page.

Then try and load in your browser the page(s) that gave you this issue in the first place.

Re: weird html script in browsers.

PostPosted: 13. July 2011 08:27
by xxgiga
Thank you Sharley!
It works! Exactly like what it is before it went absurd.

Thank you so much for the help to everyone in this thread too :)