logo
Published on Code2Design (http://www.code2design.com)

Newbie stuck - php doesn't seem to want to work

By quadlo
Created May 6 2008 - 3:36pm

Hi all,

Just found this site - hope you can help this newbi out.

I am just learning (or trying to) PHP. I have installed apache, php5, etc on my machine, and when i bring up a browser (firefox or ie) nothing seems to work.

Here is the simple code i copied from a tutorial...

<?php
$site_name 
"This is the site name area";
$paragraph_text "Welcome to my site";
$email 'type me@email.com';
?>


<html>
<body>
<h2><?php echo $site_name?></h2>
<p><?php echo $paragraph_text?></p>
<p>Email me: <a href="mailto:<?php echo $email?>"><?php echo $email?></a>
</body>
</html>

====================================================

When i try to run it, the only thing displayed is "Email me:" - without the quotes.

===========================================

When i display the page source (and correct me if i'm wrong, but the php code should not show up - it displays the following....

<?php
$site_name 
"This is the site name area";
$paragraph_text "Welcome to my site";
$email 'type me@email.com';
?>


<html>
<body>
<h2><?php echo $site_name?></h2>
<p><?php echo $paragraph_text?></p>
<p>Email me: <a href="mailto:<?php echo $email?>"><?php echo $email?></a>
</body>
</html>

========================================

I'm sure there's a very simple explanation for this, but it's my first ever try at doing anything on the web (been an application / system programmer for 35 years) and I'm at a loss.

Thanks in advance,
Q

‹ Something like iFrames? [0] PHP Mail Function › [0]

Source URL:
http://www.code2design.com/forums/newbie_stuck_php_doesnt_seem_to_want_to_work