Jump to content

Absolute Beginners Question


Meistro

Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[!--quoteo(post=369946:date=Apr 29 2006, 03:34 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 29 2006, 03:34 PM) [snapback]369946[/snapback][/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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.