Jump to content

how can you have php on an HTML page?


abcdabcd

Recommended Posts

<html>
//all of your HTML stuff goes here

//anywhere you want a php statement use these
<?php you would put whatever PHP you want inside of these, it can go anywhere in your html   ?> 

 

you will have to change the extension of your page to .php though, or they will not be noticed as PHP by the browser.

like a footer?

 

// html code

 

 

<div id='footer'>

// define properties, place at bottom, etc..

 

<?php

 

// code here, displayed at bottom

 

?>

</div>

 

I think you may need to do some more reading you don't know how to place php at the bottom of a page. Sorry if that came off as rude.

Thanks for all the replies, what if the php is above the html content?  Do I use the same method:

 

<html>

//all of your HTML stuff goes here

 

//anywhere you want a php statement use these

<?php you would put whatever PHP you want inside of these, it can go anywhere in your html  ?>

Yup. Your <?php blah blah blah ?> can go anywhere on the page.  It sounds like you are about at the same stage as I am with php so keep things simple and call all your pages with php in them '.php' rather than anything else. The other comments are just showing off!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.