Jump to content

php not getting post data


sniperscope

Recommended Posts

Hello all

Recently i have posting problem.

 

I transfer my web page to new hosting server and since then i am facing problem with post data.

I have a schedule form with 83 user which is posting one week schedule which means my form is posting

581 + (3 hidden form data) when i click Submit form.

 

So far i have changed

max_execution_time  => 300

max_input_time => 600

memory_limit => 100M

post_max_size => 80M

upload_max_filesize => 80M

 

in my previous server's values was 1/4 of above value and didn't have any problem even once.

 

Output of my hidden value return NULL for testing purpose

 

var_dump($_POST['test']);  returns NULL even before and after form submission.

 

Thank you for any help and/or idea

 

Regards

Link to comment
https://forums.phpfreaks.com/topic/279492-php-not-getting-post-data/
Share on other sites

any chance the new server has the Suhosin hardened php patch installed? if so, the suhosin.post.max_vars default is 200.

 

edit: also starting in php5.3.9, there is a php.ini setting max_input_vars. default is 1000, but perhaps your server has it set to a lower value.


if(isset($_POST['id']))
{

mysql_query("TRUNCATE TABLE work");

$sql = "INSERT INTO work(staff_id, Mon, Tue, Wed, Thu, Fri, Sat, Sun) VALUES ";

$counter = count($_POST['id']);
for($i=0; $i<$counter; $i++)
{
$Mon = ($_POST['From1'][$i] == $_POST['To1'][$i]) ? '~' : $_POST['From1'][$i] .'~'. $_POST['To1'][$i];
$Tue = ($_POST['From2'][$i] == $_POST['To2'][$i]) ? '~' : $_POST['From2'][$i] .'~'. $_POST['To2'][$i];
$Wed = ($_POST['From3'][$i] == $_POST['To3'][$i]) ? '~' : $_POST['From3'][$i] .'~'. $_POST['To3'][$i];
$Thu = ($_POST['From4'][$i] == $_POST['To4'][$i]) ? '~' : $_POST['From4'][$i] .'~'. $_POST['To4'][$i];
$Fri = ($_POST['From5'][$i] == $_POST['To5'][$i]) ? '~' : $_POST['From5'][$i] .'~'. $_POST['To5'][$i];
$Sat = ($_POST['From6'][$i] == $_POST['To6'][$i]) ? '~' : $_POST['From6'][$i] .'~'. $_POST['To6'][$i];
$Sun = ($_POST['From7'][$i] == $_POST['To7'][$i]) ? '~' : $_POST['From7'][$i] .'~'. $_POST['To7'][$i];

$sql .= "('" .$_POST['id'][$i]. "', '" .$Mon. "','" .$Tue. "','" .$Wed. "','" .$Thu. "','" .$Fri. "','" .$Sat. "','" .$Sun. "'),";

}
$sql = substr($sql, 0, (strlen($sql) - 1));
$sql .= ";";

mysql_query($sql);
header('location: index.php');
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.