Page 1 of 1

I´m not seeing any PHP echo

PostPosted: 06. May 2008 15:38
by alexandre_portugal
Hi!
I´ve installed Xampplite and it is working great: I´ve managed to set Drupal up in my machine.
But now I´m looking forward to learn the PHP basics, using some tutorials. The problem is that I do no see any PHP echo when looking at a webpage.

So I have:

<html>
<body>
this is html
<?
echo "this is PHP";
?>
</body>
</html>

I just see "this is html"

I tried this on two machines using Xampplite, but nothing. I mean, with IE6, nothing. With firefox I see: echo "this is PHP"; ?>

Is it something about the lite version?
Is there something I must change?

Thank you

PostPosted: 08. May 2008 13:25
by ifokkema
Hi,

How about looking at the page's source? I bet you see your PHP code right there. Change your <? tag to <?php. <? is not necessarily recognized; it's not the standard way of starting the PHP code and I do not recommend using it since it will not work everywhere (as you just found out) and it's only three characters shorter anyway.

Ivo

PostPosted: 08. May 2008 13:39
by Wiedmann
I tried this on two machines using Xampplite, but nothing. I mean, with IE6, nothing. With firefox I see: echo "this is PHP"; ?>

Your file must have the extension "*.php".