When I execute hello world.php in firefox:
<html>
<body>
<php
echo "Hello World";
>
</body>
</html>
I get no return.
The page that shows is blank. I have apache and PHP 5 installed. Help?
7 replies to this topic
#1
Posted 16 July 2011 - 06:04 PM
|
|
|
#2
Posted 16 July 2011 - 07:22 PM
[B]Please use [noparse]
, [html], and [code][/noparse] where appropriate. [/B] Your code should be: [php]<html> <body> <?php echo "Hello World"; ?> </body> </html>
#3
Posted 16 July 2011 - 11:40 PM
That does not generate valid PHP code of which can be ran, so likely if you view the source within Firefox, it will not parse that block and will be hidden in pink.
You may also be viewing the file directly (and not through http://localhost) and will also hide the code regardless if corrected.
You may also be viewing the file directly (and not through http://localhost) and will also hide the code regardless if corrected.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#4
Posted 17 July 2011 - 05:53 AM
Sorry, I checked and my code was:
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
as you stated. However, I'm new to the localhost thing. How does it work?
<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>
as you stated. However, I'm new to the localhost thing. How does it work?
#5
Posted 17 July 2011 - 06:29 AM
You'll need something like XAMPP to process the PHP for you. Then you can navigate to h t t p: // localhost
#6
Posted 17 July 2011 - 07:02 AM
So i installed xamp and explored to the file. Echo still dosen't return anything?
#7
Posted 17 July 2011 - 12:18 PM
Delta, Apache is a webserver as it sends your document to the client it can parse it through PHP.
Where did you install XAMPP to?? In the XAMPP folder there will be a htdocs folder, put your file in there. Change the name to hello_world.php and goto localhost/hello_world.php in firefox (open the XAMPP control panel and start Apache first!). :)
Where did you install XAMPP to?? In the XAMPP folder there will be a htdocs folder, put your file in there. Change the name to hello_world.php and goto localhost/hello_world.php in firefox (open the XAMPP control panel and start Apache first!). :)
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
#8
Posted 17 July 2011 - 02:19 PM
Thanks so much for your help. Finally got it to work.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









