Click to See Complete Forum and Search --> : PHP in html?


Hooded_Villian
04-03-2008, 12:05 PM
Just started fooling around and studying PHP. Was using an old manual for PHP 4 but decided www.w3schools.com/php was the way forward. Thanks Znupi...

Question is this: Here is a snippet of the code I put together for a sample and testing/learning purposes.

When I upload the default.html page to my webserver, the php code doesn't show up, yet I thought if u embedded into the html it should.

Take a look at www.myowntestpage.com for what I been fooling aroung with so far.



<body bgcolor="#000000" leftmargin="0" topmargin="30" marginwidth="0" marginheight="0">
<center>

<font color="#FFFFFF">
<?php

echo "Hello to all of you. This is just a php test, so pls ignore";

?>
</font>

<table id="Table_01" width="801" height="500" border="0" cellpadding="0" cellspacing="0">
<tr>

Hooded_Villian
04-03-2008, 12:20 PM
Does it have to be saved as a php file?

tracknut
04-03-2008, 12:29 PM
That's dependent on your web host setup, but generally yes, if you want the php processor to read your file, then it knows that by the file being something.php

Dave

Hooded_Villian
04-03-2008, 12:37 PM
Cool... Just saved it as default.php and uploaded it to my webserver and it works.

Shot Dave!!!