Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Hello PHP, World!</title>
</head>
<body>
<?php
echo 'Hello PHP, World!';
?>
</body>
</html>
Landslyde
Moderator: General Moderators
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Hello PHP, World!</title>
</head>
<body>
<?php
echo 'Hello PHP, World!';
?>
</body>
</html>
No. I set the title myself just to make sure that the page was loading.requinix wrote:Does it have Hello PHP, World in the title? What is the URL you're trying? And if you do a View Source of the page, do you see the PHP code?
Actually I was asking whether you saw "Hello PHP, World" in the title bar or tab of your browser.Landslyde wrote:No. I set the title myself just to make sure that the page was loading.
Not the URL of whatever you're learning from. The URL as you're looking at (trying to look at) your PHP script. It should be like "http://localhost/php101/x1.php" (as they show*) and not like "file:///var/www/x1.php".Landslyde wrote:The URL: http://devzone.zend.com/4/php-101-part- ... bbit-hole/
That means your PHP code isn't being executed. How did you install PHP?Landslyde wrote:Yes, when I view the page source, I see the PHP.
Odd. You shouldn't be able to see it at all, even with a Select All. It should only appear in the page source. But whatever, that's not important.Landslyde wrote:Also, when I seclect all on the page, the PHP part of the source is highlited.
That's the problem. The URL must be http://something. With just file://something you're going to get the file as-is - if your browser knows what to do with it, or else you'll get that download prompt. PHP doesn't get involved anywhere in there.Landslyde wrote:URL I see is: file:///home/woogi/Desktop/BlueFish/index.php
Yeah. I narrowed it down before I went to bed last night. I have apache2 running on my Linux here, but I think I may have to reinstall it.requinix wrote:You need a web server. Like Apache. Take a look at this tutorial. When that is set up your PHP files will go in /var/www and you'll use a URL like http://localhost/index.php.