Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8086945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:36:29+00:00 2026-06-05T18:36:29+00:00

I am trying to generate an HTML page using data gathered in a form

  • 0

I am trying to generate an HTML page using data gathered in a form on another page. I have this tag on the html page with the form:

<html>
<body>

<meta http-equiv="cache-control" content="private" > 
<link rel="stylesheet" type="type/css" href="vytran_css.css" />


<head> New Product Introduction </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="html_data.php" id=from1 method="post"> 
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 type="text"> </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 on the html_data.php page I have the following:

<?php 
    ob_start(); // start trapping output 
    $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> 
Description: <?php echo $Description; ?> 
</p> 
</body> 
</html> 
<?php 
    $output = ob_get_contents();  
    $newfile="output.txt";  
    $file = fopen ($newfile, "w");  
    fwrite($file, $output);  
    fclose ($file);   
    ob_end_clean();  
?> 

This should do what I am asking it to do. The form submits with no problem, but I cannot find the page once it submits. Any idea what I need to change?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:36:32+00:00Added an answer on June 5, 2026 at 6:36 pm

    In your form

    Change from

    <textarea name="Team-members" rows=10 cols=40 type="text">

    to

    <textarea name="Team_members" rows=10 cols=40 type="text">

    In your html_data.php

    Change from

    <?php echo $Team-members; ?>
    to
    <?php echo $Team_members; ?>

    There is obviously an issue with the dash between Team and members.

    • PHP is treating the hyphen as a mathematical operation, being a minus.

    • I.e.: Team minus members

    Then, if you wish to echo the data to screen after submission, add

    echo $output;
    

    underneath ob_end_clean();

    This worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As I mentioned here , I'm trying to generate HTML from an ASPX page
I'm trying to generate a dynamic table using CSS: <html> <head> <style> div.el1, div.el2
I'm trying to generate a small part of the page using jquery which is
I'm trying to scrape the data off a web page using the python Windmill
I'm trying to have table borders in my PDF using pisa to generate the
I am trying to generate a html page with css that works as an
I'm trying to generate a form using the form_for helper in RoR but I
I am trying to use Google Docs Form in a custom HTML page. So
I am trying to generate pdf using Dompdf. I have the following script for
I am trying to generate an html div in asp.net. Since a div is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.