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

  • SEARCH
  • Home
  • 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 8361245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:39:20+00:00 2026-06-09T11:39:20+00:00

page1.php echo ‘<form action=page2.php name=myform><table> <tr><td>name:<input type=text name=n></td></tr> <tr><td>Choose Desc<select name=desc value=0> $descriptions =

  • 0

page1.php

  echo '<form action="page2.php" name="myform"><table>
        <tr><td>name:<input type="text" name="n"></td></tr>
        <tr><td>Choose Desc<select name="desc" value="0">
                  $descriptions = mysql_query('SELECT desc FROM desc_table');
                  while($row=mysql_fetch_array($descriptions))
                  {
                     $des = $row['desc'];
                     echo '<option>'.$des.'</option>';
                  }
                  </select>
       </td></tr>';
          <tr><td>Description:<textarea rows="10" cols="10" name="desc" value="1"></textarea></td>  </tr>     
 <tr><td><input type="submit" value="submit"></td></tr>
 </table>
  </form>';

Page2.php

 $n = $_POST['n'];
 $desc = $_POST['desc'];
 $sql = "INSERT INTO new (name,desc)
                VALUES ($n,$desc)";
 mysql_query($sql);

I need to store either one description either by selecting the description or typing the description in the textarea, but only one description should get stored to database.

  • 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-09T11:39:21+00:00Added an answer on June 9, 2026 at 11:39 am

    enter image description hereChange into this:

    $n = $_REQUEST['n'];
    $desc = $_REQUEST['desc'];
    $sql = "INSERT INTO new (name,desc)
                VALUES ("$n","$desc")";
    mysql_query($sql);
    

    And add a method to your tag

    <FORM action="resultscript.php" method="POST"></FORM>
    

    And try again 😉

    BTW: If the variables you are putting in your SQL might contain strings, you need to put them in double quotes (“)

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

Sidebar

Related Questions

php page1 --> below bit is pure html: <form action=page2.php method=post> <input type=text name=name
Page1 : test.php (open in popup) <script type=text/javascript> function addFiles(aFiles) { if ($('#addfiles').length==0) $('#addfiles').html;
I have the existing code: <form action=page.php?id=<?= $_GET['id'] ?> method=post> <fieldset> <p id=edit_name><label for=name>Page
I have 2 pages : page1.php : - has a form with text box
I have a php page server1.com/page1.php (not real) and another page server2.com/page2.php page1.php response
I have a main div on two pages ie page1.php and form.php page1.php <div
I have the following pages: page1.php, page2.php and page3.php. Code in each of them
If I have $var defined in Page1.php and in Page2.php I have //Page2.php include('Page1.php');
Page1.php: <?php session_start(); if ($_POST['password'] == testpass) $_SESSION['authenticated'] = true; ?> Page2.php <?php session_start();
In index.php, I have created a form and in the action attribute of the

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.