Alternate: Use an iframe to host the php File


An iframe (Inline Frame) is an HTML document embedded inside another HTML document on a website.

 

The common way (a) is to upload the php file e.g. webform.php to your web and open it in the browser.

The HTML host page (HTML template) file (if you have loaded a template) is not required - the HTML code of the template file is embedded in the php file. Sample: Open "http://www.mydomain.tld/webform.php" in your browser.

 

In some situations it might be helpful to use an <iframe> (b) to host the php form.

The difference is, that you need to upload the a modfied HTML file together with the php File and open the HTML file in your browser.
Sample: Open "http://www.mydomain.tld/iframepage.htm" in your browser.

Its also possible to combine both, e.g. create a php webform which contains a HTML host page (a template) and host it in an iframe!

The following graphic should illustrate the difference:

php or iframe

 

* Click on "Create php Web Form"

Now the program will create the php form and save it to your local disk or upload it directly to your web.

 

* Add an <iframe> to your web page

Sample code to include an <iframe> into an existing web page:
(You need to adjust the filename, width and heigth, so that your form will be shown completely!)
...
<html>
<body ...>
....
<iframe src="webform.php" width="800" height="800" frameborder="0">
Sorry, your browser does not support iframes!
</iframe>
...
</body>
</html>

 

* Upload the php file AND the modified web page (HTML file) to your web

Open the HTML file in your browser after you have uploaded both files. The form will be loaded automatically in the iframe area.
Sample: Open "http://www.mydomain.tld/iframepage.htm" in your browser.