Page 1 of 1

php as plain text?

PostPosted: 20. January 2009 07:50
by gwiz665
I'm having a weird error which is bugging me like crazy. I think it's much like viewtopic.php?f=16&t=32740 but the solution there didn't really help me.

All the php code is not interpreted, but just spat out as plan text. When I look at the page source it's like so:

Code: Select all
<?
include ("./top.php");
$side = $_REQUEST['side'] * 10;
if ($side != NULL)
{
    $side = $side - 10;
}
forbind();
$samlet = mysql_query("SELECT * FROM `samlet` ORDER BY `dato` DESC LIMIT " . $side . ",10");

And so on.

If I change the <? to <?php it works, but shouldn't it work anyway? Is this some setting in apache or something?

It happened when I made a clean installation om XAMPP 1.7. Both apache and mysql is running.

even on http://localhost/xampp/ the title is "XAMPP <?include('.version');?>". How can I fix this? I've tried re-installing xampp multiple times.

Re: php as plain text?

PostPosted: 20. January 2009 07:51
by gwiz665
And I'm of course looking at it through the localhost/[proper subdomain]/.

Re: php as plain text?

PostPosted: 20. January 2009 08:00
by Wiedmann
If I change the <? to <?php it works, but shouldn't it work anyway?

Read about "short tags":
http://de.php.net/manual/en/language.ba ... hpmode.php

Re: php as plain text?

PostPosted: 20. January 2009 08:22
by gwiz665
Thank you! :)