Goal: Have a form on an html page generate a new page using php once the form is submitted.
I've been working on this project for over a week now, and can't seem to get the functionality I want. I'm not very familier with php, I'm usually a MATLAB or python programmer, so I've been gleaning what I can from other people's questions and solutions that worked for them.
This is my main page:
<!DOCTYPE html>
<html>
<body>
<link rel="stylesheet" type="type/css" href="vytran_css.css" />
<head
New Product Introduction
<title> Start
</title>
</head
<p> In order to begin the process of introducing a new product, please complete
the following form. Once you are satisfied with your responses to the various
prompts, please click on the submit button at the bottom of the page. If you
would like to start over, click the Reset button. If you have any questions,
Please follow the link that says "Help".
<form action="create_file.php" method="post" name="form1">
<input type="text" name="new_project">
<br>
Product Name:
<input name="Name" size="20" type="text">
<br><br>
Project Lead Name:
<input name="PLname" size="20" type="text"> <br><br>
Team-members: <br>
<textarea name="Team_members" rows=10 cols=40> </textarea> <br><br>
Product Type: <br>
<input name="Product_Type" size="20" type="text"> <br><br>
Description: <br>
<textarea name="Description" rows=10 cols=40 type="text"> </textarea>
<br>
<br> <br>
<input value="Submit" type="submit" name="formSubmit">
<input value="Reset" type="reset">
<input value="Help" type="button" onclick="window.location.href='problems.html'">
</form>
</p>
</body>
</html>
and this is the php I have right now:
<?php
ob_start();
$Name = @$_POST['Name'];
?>
<html>
<body>
<p>
Product Name: <?php echo $Name; ?> <br>
Project Lead: <?php echo $PLname; ?> <br>
Team Members: <?php echo $Team_members; ?> <br> <br>
Product Type: <?php echo $Product_type; ?> <br>
Description: <?php echo $Description; ?>
</p>
</body>
</html>
<?php
$output = ob_get_contents();
$newfile="newPage.htm";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
ob_end_clean();
echo $output;
?>
Please help me get this working.
-C