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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:19:17+00:00 2026-06-14T22:19:17+00:00

Hello my dears you always help me go further. I have a problem with

  • 0

Hello my dears you always help me go further.

I have a problem with a form.

How can I protect it from user manipulation after being submitted?

FORM

<form method="post" action="/selling.php" />
<input type="hidden" name="user" value="{$_SESSION['session_username']}" />
<input type="hidden" name="price" value="$price" />
<input type="hidden" name="nick" value="$nick" />
<input type="hidden" name="class" value="$class" />
<input type="hidden" name="amount" value="$amount" />
<input type="submit" name="reset" class="input_submit" value="Submit" />
</form>";

How does it work?

The user logs in on my website, then based on his “$username”, I retrieve his info from DB (nickname,class) and based on some conditions I create a “$amount” and “$price” for it.

Everything goes automatically, all the user has to do is to click the “Submit” button.

But I found out that he can manipulate the whole form and change for example the “$price” to 0…

What should I do and how?

  • 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-14T22:19:18+00:00Added an answer on June 14, 2026 at 10:19 pm

    Wherever you might derive $amount and $price from, it seems to be calculated before outputting the form. This means you can also just store those two values in a session like

    $_SESSION['amount'] = $amount;
    $_SESSION['price'] = $price;
    

    and get rid of them in the form completely. You will be able to access these sessions in selling.php so long as you start the session before trying to access it by doing:

    session_start();
    

    Through this, none of the sensitive information will be shown in the form/source code, but it will still be available in selling.php.

    Remember to always do validations in the backend, i.e. php code, never in the front end.

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

Sidebar

Related Questions

Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
We have a Website where a user can reject something from another user with
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
Hello again Stack Overflow. you probably remember me from my unit spawning problem in
can anyone help me solve this problem? i've been trying to query this but
Hello all I hope you can help me understand why getopt used an int
hello all i am working on a project in which i have a webpage
Hello i'm doing a application in php, and i have a list of items
Hello dear users of the stackoverflow! I really like the search form on this
For example I have the text. $text = 'Hello dear friend, my name 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.