php inside my html code ok?

Hi,
I’m trying to build a contact form for users to send emails to my practice website on my pc.
I have all the html with a little javascript working nicely, however the php won’t work.

Do I have to start the code with <?php and end with ?>
or
can I have

then my code
then <?php
?>
then more code

Hello,

When ever you want to include PHP code in your HTML, you will have to encase your code between the <?php and the ?> tags. You can either have them in the middle of your HTML, at the beginning before the HTML, our on a separate file that you include using the “include_once()” function that you would include inside of the PHP tags. Let me know if you need anything else.

Good luck!

You also need to have a local XAMPP/WAMPP/LAMPP environment installed and be using a .php file extension

Sponsor our Newsletter | Privacy Policy | Terms of Service