0

I have this file x.php but it doesnt work. Php only works if it is in a pure php file
(with no html code).Im using xampp 1.7.7. Any ideas what might be the problem ?

<html>

<body>

<?php
echo ("HELLO");

?>
</body>

</html>
5
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by yanwick
0

Works fine on my system: Fedora 15, Firefox 9, Apache 2.x on localhost. I think it should run on other systems too. What error do you get?. If you look at the page source in the browser is there anything displayed? What do you get if you add some text to the html code such as below?

<html>

<body>

<h1>Do you see HELLO WORLD or just WORLD?</h1>

<?php
echo ("HELLO");
?>

<span> WORLD</span>

</body>

</html>

Edited by broj1: n/a

0

What it shoes is <?echo ('hello')?> but i ve tried in another computer with windows vista and it works fine,(im using xp professional).

Works fine on my system: Fedora 15, Firefox 9, Apache 2.x on localhost. I think it should run on other systems too. What error do you get?. If you look at the page source in the browser is there anything displayed? What do you get if you add some text to the html code such as below?

<html>

<body>

<h1>Do you see HELLO WORLD or just WORLD?</h1>

<?php
echo ("HELLO");
?>llo

<span> WORLD</span>

</body>

</html>
0

Did you use PHP short tags (as it is displayed in your last post)? Maybe your web server is not configured for short tags. Also it might be a good idea to put a whitespace between the tags and PHP code.

0
<?php
phpinfo();
?>

What does it return ? Also, don't put the bracket with echo statement.

<?php
echo "Hello";
?>

It should be.

0

Thank you all. I solved the problem by saving the file in a php editor program.The file was formatted using wordpad.Plus i installed the windows 7.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.