shadowcastpm Posted November 8, 2006 Share Posted November 8, 2006 Hey, I am having problems with my site, I am wanting to implement a php form into a HTML document, Please can some explain how this is done/variables etc. I have tried before to do this but had to luck :(Thanks, Peter. Link to comment https://forums.phpfreaks.com/topic/26545-inserting-php-into-a-html-document/ Share on other sites More sharing options...
heckenschutze Posted November 8, 2006 Share Posted November 8, 2006 For example, you have a HTML form,myform.html[code]<html><head></head><body><form action="post.php" method="post"><input type="text" name="mytextbox" value="hello~"><input type="submit" name="submit" value="submit me"></form></body></html>[/code]post.php[code]<?php//-- see if the form is bring us to this page :)if(isset($_POST["submit"])){ echo htmlentities($_POST["mytextbox"]);}?>[/code]Now, Depending on the method used POST or GET, in this case we used POST (<form action="post.php" method="post">)... So the results will be in the $_POST superglobal, else if we used GET, they'd be in the $_GET superglobal.Hope that helps :) Link to comment https://forums.phpfreaks.com/topic/26545-inserting-php-into-a-html-document/#findComment-121443 Share on other sites More sharing options...
shadowcastpm Posted November 8, 2006 Author Share Posted November 8, 2006 Thanks heckenschutze, thats given me a much better understanding of the form :)- Peter. Link to comment https://forums.phpfreaks.com/topic/26545-inserting-php-into-a-html-document/#findComment-121445 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.