Hello DP members! I am looking for a simple form-based PHP script. The visitor will enter his data and the script will generate HTML code based on his input. For example, a user enters his name and e-mail address and the script creates a HTML code (a web page) with these two values. Can you please help me find the script? Thanks in advance!
You could do this with wordpress. But it depends on how complex or simple you want it to be. Another option is to find a simple forum script and maybe modify it a bit. Most people will refrain from doing something like this as it will most likely lead to spam pages.
what are you trying to do with the form? It's very easy to create a form like that in php. But you will have to modify it to suit your needs <?php if (!isset($_POST['submit'])) { ?> <form method="post" action="test2.php"> <p> Please write your name: </p> <input type="text" name="name" /> name <br> <p> Please write your email address </p> <input type="text" name="emailaddress" /> email <br> <input type="submit" name="submit" value="submit"/> </form> <?php }else{ $name1=$_POST['name']; $emailaddress1=$_POST['emailaddress']; echo $name1; echo '</br>'; echo $emailaddress1; } ?>
It is not very clear to me what the OP is asking. So you want a script that will take data from a form and create a HTML page on the server? Or does it display the page back to the user or does it store it as HTML?
No! The script will create HTML code based on the values from a form and it will display the code to a person who filled the form. This person will copy that code to some text editor, save it as a .html file and upload that page to some web host.
Hi, please try the below code : if (!isset($_POST['submit'])) { ?> <form method="post" action="test2.php"> <p> Please write your name: </p> <input type="text" name="name" /> name <br> <p> Please write your email address </p> <input type="text" name="emailaddress" /> email <br> <input type="submit" name="submit" value="submit"/> </form> <?php }else{ $name1=$_POST['name']; $emailaddress1=$_POST['emailaddress']; $message = ' <html> <head> <title>'.$name1.'</title> </head> <body> <table> <tr> <td>Name</td><td>'.$name1.'</td> </tr> <tr> <td>Email id</td><td>'.$emailaddress1.'</td> </tr> </table> </body> </html>'; echo htmlentities($message); } ?> "htmlentities" is the function in php to show all html tags