I'm working with a page that has multiple <form>
tags in it. One of the forms in question looks something like:
<form name="frm6910" action="ind_profile.php?ind_id=" method="POST">
<input type="hidden" name="action" value="update">
<input type="hidden" name="auto_change" value="1">
But, when I go to var_dump()
the POST variables in ind_profile.php
, my array is empty. I'm not sure how to provide more insight on this question, but I'm looking for possibilities on why POST variables may not be passing correctly.
Would having multiple <form>
tags within one page be the cause of incorrectly passing values?
As requested, here is a snipit evaluating one of the POST variables:
ob_start()
require('crm_common.php');
var_dump($_POST);
switch(@$_POST['action']) {
case 'update':
Thanks.
As explained in the comments, no content gets sent until the output buffer (ob_start()) is either flushed or closed. See the manual for details on output buffering.
The multiple forms shouldn't be an issue.
I noticed you start an output buffer. Do you get the content or flush it out afterwards? Try to do
echo "<pre>";
print_r($_POST);
As the first thing in the file.
Are you posting from a specific submit button?
if(isset($_POST['nameOfSubmitButtom'])){
var_dump();
}