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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:49:48+00:00 2026-05-28T04:49:48+00:00

First of all, there is no code with me … I’m gathering required data

  • 0

First of all, there is no code with me … I’m gathering required data to start a project.

I will be having multiple <form>s on a website which are all linked to the same PHP page, say for example to send email or add data to DB.

Now, I can build the forms, and the PHP page to send mail or add data to DB. BUT here is the point I need to know about … If any of the forms call the PHP page, how can I know which one did to act accordingly?

Also, is it better to do double-validation to the form? I mean, client-side then server-side?

Since we are talking about validation, is it better to be, on client-side, JS or JQuery (I can write both)? And about the DB thing, how can I secure it?!! I mean, how can I assure that the user won’t enter a PHP code to mess things up and how I can detect it.

I know this seems to be like general question or a discussion, but you will be helping me a lot. And frankly, I’ve been using this website for around 3 yrs now, and you guys helped me pass my grad project with a great grade 🙂 So I’m willing to find answers here 🙂

Thanks all.

  • 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-05-28T04:49:49+00:00Added an answer on May 28, 2026 at 4:49 am

    You can use hidden fields in your form to denote which action should take place. You can also just include a parameter in the ACTION attribute of the form. Same result either way.

    <form>
      <input type='hidden' name='mode' value='save'>
      <!-- More HTML --> 
    </form>
    
    <form>
      <input type='hidden' name='mode' value='delete'>
      <!-- More HTML --> 
    </form>
    

    For validation, server side validation comes first and then add client side validation to reduce server processing and reduce round trip times. People will appreciate responsive form designs. There are plenty of form validation tools available, just look at the Related links for this question.

    For security, make sure you’re using PDO or the Mysqli extension to create your queries. The golden rule is to escape your input and encode your output. You can use methods like htmlspecialchars() to encode your output. And make use of PHP’s Filter methods. This will help you immensely – http://php.net/manual/en/book.filter.php. Also, it’s usually better to whitelist rather than blacklist when working with validation.

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

Sidebar

Related Questions

first of all here is my code: @protocol SearchTableViewControllerDelegate @required - (void)didSelectFileCardsContent:(FileCardsContent*)content; @end @interface
First of all there is a partial question regarding this, but it is not
First of all: I do know that there are already many questions and answers
First of all, there are many cases where Sleep() is misused , for example
First of all, to clarify my goal: There exist two programs written in C
First of all, let's define a few tables: Users table will store information about
First of all - I don't have a problem with bad-indentated code and I
First of all forgive me, but the code was too long and copied from
First of all, the code: template<typename Func, typename Func2> void ForEachField(Func normalHandler, Func2 arrayHandler
First of all there is probably no correct answer, but I'm sure there are

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.