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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:05:41+00:00 2026-06-13T09:05:41+00:00

If the user Fake a form and change an input to ROLE, he can

  • 0

If the user Fake a form and change an input to ROLE, he can change that field in database.
How can I protect Yii Forms over fake inputs?

Model Users.php

array('role', 'numerical', 'integerOnly'=>true),
  • 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-13T09:05:41+00:00Added an answer on June 13, 2026 at 9:05 am

    You can’t ‘protect forms’. You need to move that data away from the client (ie. forms) and on to the server (ie. php) via a session or some other method of storing state.

    As long as the user’s machine is responsible for setting the data (ie. through a form) then they can change it to whatever they want. If you don’t have a way of independently verifying that on the server-side, then don’t expect the form to send you something you can trust.

    Regarding sessions, see: http://www.yiiframework.com/doc/api/1.1/CHttpSession

    Verbose blurb from the Common Weakness Enumeration project (http://cwe.mitre.org/data/definitions/807.html):

    Store state information and sensitive data on the server side only.
    Ensure that the system definitively and unambiguously keeps track of
    its own state and user state and has rules defined for legitimate
    state transitions. Do not allow any application user to affect state
    directly in any way other than through legitimate actions leading to
    state transitions.

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

Sidebar

Related Questions

User inserts a string in a html form input on browser. This string is
User Defined Function (UDFs) are functions that one can program and can be dynamically
I'm creating an html form that will allow a user to specify a variable-length
Simple question I hope. I have a function that keeps prompting for user input
Facebook allows you to create test user accounts that can only be used for
I have a function that reads user input from std::cin, and I want to
I'm trying to verify that a filename and path input by the user is
I have a database of 3D models. I want user can rotate the model
IN PHP: Is there a way for the user to fake a session variable?
What operating system and UI toolkit is this? It's not some fake Hollywood user

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.