Use PHP to create a new page
Moderator: General Moderators
Use PHP to create a new page
Is it possible to use a html form and then have php take that information and create a new html page? If so, does anyone have any experience with this? Thanks.
- tasteslikepurple
- Forum Commoner
- Posts: 46
- Joined: Thu Jan 26, 2006 3:38 am
- Location: Bath, UK
that's one of the best things about PHP 
try this form:
put this in page2.php
just a VERY simple example to try.
try looking on google for php form handling or php form processing
try this form:
Code: Select all
<form action="page2.php" method="post">
<input type="text" name="firstname">
<input type="submit">
</form>Code: Select all
Hello
<?php
echo $_POST["firstname"];
?>
, welcome to my website.try looking on google for php form handling or php form processing
Um, I think he might have been talking about actually creating a file with html inside it...
If so, take a look at the filesystem functions within the manual.
And a tutorial like this: http://www.onaje.com/php/article.php4/18
Though that is for text file, you can modify it easily for html.
I am wondering though, what were you going to use this ability for?
If so, take a look at the filesystem functions within the manual.
And a tutorial like this: http://www.onaje.com/php/article.php4/18
Though that is for text file, you can modify it easily for html.
I am wondering though, what were you going to use this ability for?
I am currently setting up a page to sell electronics online, and I would like to be able to build a page for each item after I have entered it in the database. My current plan is to have the page built through forms and the copy the generated html code and save it as a new file. If the information you have provided will make that process simpler, that would be great. Thanks for the input.