Jump to content


Photo

Absolute Beginners Question


  • Please log in to reply
2 replies to this topic

#1 Meistro

Meistro
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 April 2006 - 07:24 PM

Hey, I am currently reading Wrox, beginning PHP5. Apache and MySQL Web Development. Their first PHP example program is :


<html>
<head>
<title> My First PHP Program</title>
</head>
<body>
<?php
echo "I'm a lumberjack.";
?>
</body>
</html>

when I run this in FireFox and I.E. It doesn't say any text in the body, just gives me the title. Is this something to do with PHP not being installed configured properly? Help! I am lost : )

To recap :
I wrote this in notepad, saved it to my desktop, opened it in IE and Firefox and got the title but nothing was said in the main box.

BTW what does everyone think of the book I am reading, any good? Are there other, better, absolute newbie guides?

Thank you

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 29 April 2006 - 07:34 PM

I'll assume you saved the file with a .php extension ...

php files are parsed on a server then sent to a browser to be rendered. In simple terms, the php script is executed on the server to generate an html file which will then display in a browser.

So, two choices: #1 is upload the file to a server to test and the preferred option would be to have a server installed as localhost (your computer). If you already have that then you can view your work by browsing to [a href=\"http://localhost/yourfiles/test.php\" target=\"_blank\"]http://localhost/yourfiles/test.php[/a] for example. If you haven't installed a server on your local machine you'll need to. My personal one-click install favorite (works on all flavours of Windows) is phpdev5 from [a href=\"http://www.firepages.com.au\" target=\"_blank\"]http://www.firepages.com.au[/a], which includes php, MySQL, phpMyAdmin, and Apache - everything you need.
Legend has it that reading the manual never killed anyone.
My site

#3 Meistro

Meistro
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 April 2006 - 07:44 PM

[!--quoteo(post=369946:date=Apr 29 2006, 03:34 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 29 2006, 03:34 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I'll assume you saved the file with a .php extension ...

php files are parsed on a server then sent to a browser to be rendered. In simple terms, the php script is executed on the server to generate an html file which will then display in a browser.

So, two choices: #1 is upload the file to a server to test and the preferred option would be to have a server installed as localhost (your computer). If you already have that then you can view your work by browsing to [a href=\"http://localhost/yourfiles/test.php\" target=\"_blank\"]http://localhost/yourfiles/test.php[/a] for example. If you haven't installed a server on your local machine you'll need to. My personal one-click install favorite (works on all flavours of Windows) is phpdev5 from [a href=\"http://www.firepages.com.au\" target=\"_blank\"]http://www.firepages.com.au[/a], which includes php, MySQL, phpMyAdmin, and Apache - everything you need.
[/quote]


Thank you, I truly appreciate you taking the time to help me with what is likely a simple answer. I did install using 'foxserv' but have not changed any of the settings.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users