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

The Archive Base Latest Questions

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

I have a PHP page with a form. The form has method=POST and the

  • 0

I have a PHP page with a form. The form has method="POST" and the action is another PHP file which inserts the values into MySQL. This all works properly.

My problem is that the 2nd PHP page which sends the info to the database contains the username, password, databasename and tablename where the info should go. I am concerned that someone could create their own PHP or HTML form and POST to MY 2nd PHP file and submit any values to my database.

I want to put the username, password, databasename and tablename on the 1st PHP page (with the form) and pass these as variables to the 2nd PHP form, thus eliminating the threat of someone else creating their own form and posting whatever they want. (If this is possible and the correct way to do it, can you suggest how to pass the variables?)

Is this the proper way to secure input to the 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-01T17:47:36+00:00Added an answer on June 1, 2026 at 5:47 pm

    Don’t put databasename and tablename in the form. Put some meaningful value there, and on ther serverside code, select the appropriate table name and database.

    For instance, add a select field that can take the values “bluepill” or “redpill”.
    On receiving the POST data, choose the table “good_users” for bluepill and “evil_users” for redpill.

    If the form is a registration form, you can think of other methods of verifying users, such as email link, captcha, etc.

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

Sidebar

Related Questions

I have a page like this: <form class=ajax method=post action=add_item.php> [text input] [submit button]
I have the following code - <form id=smsform class=appnitro method=post action=/form onSubmit=alert('Your message has
I have a php page which has multiple form tags. each form is dealing
I have the follwing code <form enctype="multipart/form-data" action="upload.php" method="POST"> Please choose a file: <input
I have am HTML form in a PHP page. The form has various inputs.
in the form action i have the following line\ <form action={URL} method=post target=_self id=xxx
I have a php page, which launches a popup window containing a form with
I have a form on my PHP page which performs some ajax validation (that's
I have a php page called form.php. When you go to this page it
I have a PHP page that queries a DB to populate a form for

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.