tags:

views:

58

answers:

3
+1  Q: 

Simple PHP file

Here is my code

<html>
<body>
<?php
  echo "<b>Hello World</b> <br />";
?> 
</body>
</html>

I have named the file as test.php but I dont get the desired output in my firefox 3.6 browser.

Output

Hello World
"; ?> 
+2  A: 

Sounds like you haven't configured PHP properly. Refer to the PHP documentation and the documentation for your web server.

Ignacio Vazquez-Abrams
I have installed PHP using WAMP. Can you guide me how to configure PHP for that.
Bruce
This site is for programming issues, not system administration issues.
Ignacio Vazquez-Abrams
+1  A: 

Have to copied the file to a server with PHP installed? If you just try to open the file in Firefox, it'll just trying to display the whole thing as HTML, which isn't going to do what expect.

Dean Harding
I have installed WAMP and I have copied my file to the locationC:\wamp\bin\apache\Apache2.2.11\htdocs and now I open http://localhost/test.php in my browser...still no luck
Bruce
k...got the answer from superuser. I was copying it in the wrong location. I had to copy it in the www folder.
Bruce
A: 

In a page called index.php put this code:

<?php phpinfo(); ?>

and see what happens.

LucaB