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 7732491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:44:35+00:00 2026-06-01T06:44:35+00:00

On a previous page I have a textbox. Now the user enters in a

  • 0

On a previous page I have a textbox. Now the user enters in a number in that textbox and when the user submits the form it is posted into the next page. But what I want to know is how can I insert the number , into the database and do I place this code on the previous page when the textbox is or the next page where the number is posted?

In other words when user enters in a number in the textbox and submits the form, it navigates the user to the next page and displays the number on the next page but also inserts the number in the database.

The name of the table in the database is called ‘Session’ and the name of the field is ‘TotalMarks’

Below is the textbox on the previous page where user enters in a number:

<input type="text" id="txtMarks" name="textMarks" />

Below is the php code for the number which is posted into the next page:

if (isset($_POST['textMarks'])) {

$_SESSION['textMarks'] = $_POST['textMarks'];

}
  • 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-01T06:44:37+00:00Added an answer on June 1, 2026 at 6:44 am

    the mysql code is standard, you just need to execute with with mysql_query

    example to go on next page after submitting the form(not tested):

     $con = mysql_connect("localhost","databaseusername","databasepassword");
     mysql_select_db("databasename", $con);
    
     $textmarks=$_POST['textMarks'];
    
     $sql = "insert into session (totalmarks) values ('$textmarks')";
     mysql_query($sql,$con);
    
     mysql_close($con);
    

    I hope this helps.

    Also read tutorial http://www.w3schools.com/php/php_mysql_insert.asp

    Good Luck.

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

Sidebar

Related Questions

I have a MFMailViewController that shows what the user answered on the previous page.
Below I have an application. Now on the previous page user types in a
i have a textbox on a page, now whenever any age number is entered
I have a textbox in a form field that gets populated by the user.
I have a page that, depending on input from a previous page, lists a
I have a situation with my php code. In a previous page the user
I have a textbox for user to enter positive integer. User enters a lot
I have a form where I am getting values from previous page in $GET.
I have a JSF page that includes a tree form tag which is rendered
I have a text area page which is launched from the previous page: $message

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.