How to embed the contact form in your web pages

A quick and easy tutorial on how to embed the contact form in your web page.

Embed using IFrame

Iframe gives you the option of using an external URL to load its contents to create a box on your web page.  Iframe is one of the easiest ways to embed a contact form on your web page.

Here is a sample iframe code:

<iframe src='/contact/contactus.php' frameborder='0'
width='100%' height='600' allowtransparency='true'></iframe>

Use the scr attribute to update the URL path to your contact form, change the value of the ‘height’ attribute to stop the box from scrolling.

Including a header and footer in the contact form page.

Embed the contact form using a common header and footer on your website. You can include the header and footer in the contactform.php.

This method allows you to preserve the same look across the website.

Here is some sample code that illustrates this method.

Including the header:

<body>
<!--Note: The header is included here -->
<?php include('../includes/header.php'); ?>
<!-- The form start from here-->
<form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>'  
method='post'>
<fieldset >
  
Including the footer:
</script>
<!-- Note: Here we include the footer -->
<?php include('../includes/footer.php'); ?>
</body>
</html>