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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:25:23+00:00 2026-05-25T16:25:23+00:00

For example, I am using a $_POST variable to insert data into a DB.

  • 0

For example, I am using a $_POST variable to insert data into a DB. Just before this query I have a few tests and if they are true I want to adjust that (hidden) $_POST value.

Ex.

if($baby_dragon_eats_children){
  $_POST['hidden_value'] = "grapes";
}

Can $_POST[‘hidden_value’] be assigned a new value and then be passed to another function as $_POST and be able to access the new $_POST[‘hidden_value’]?

Thanks


$_POST[‘consolidate_answers’]

  • IF you assign a value to $_POST you should document is very clearly as it is not common nor considered “best” practice.
  • IF you have any extensions of PHP such as Suhosin Patch… it may block such actions..
  • Handle your own arrays, don’t depend on $_POST!
  • IF need be, make a copy of $_POST and work with that.
  • 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-25T16:25:24+00:00Added an answer on May 25, 2026 at 4:25 pm

    You can assign values to $_POST, but if you do so you should document it very clearly with comments both at the point of assignment and the later point of access. Manually manipulating $_POST can break future programmers’ (including your own) expectations of what is in the superglobal and where it came from.

    There may be other alternatives, like:

    $my_post = $_POST;
    $my_post['hidden_value'] = 12345;
    
    // In a function:
    function func() {
       // Emulate a superglobal
       echo $GLOBALS['mypost']['hidden_value'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked at this example using php and GD to piecewise-render a spiral
Does anyone have an example using the table object in YUI library. More specifically,
Let's have an example: using (var someObject = new SomeObject()) { var someOtherObject =
I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
Usually I was doing something like that (just a example): using (Stream xmlStream =
I am using a $_SESSION variable to send emails via AJAX (they need to
After posting this question MySQL update or insert or die query I've change to
I'm trying to insert form data into a MySQL 4.1 DB. The problem I'm
I'm using Kohana 3.0 and my task is to insert data in the database.
Can some one post an example of using syslog outputter for log4r, I am

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.