Jump to content

POST data empty


cmike

Recommended Posts

Hi

I am having a terrible time trying to sort this out. Hope somebody can help me.

 

My problem is, POST data being empty from a form submission. I tried many things I found on the web.

My error trapping code clearly points out that the POST date is empty. So I tried the function file_get_contents('php:input') which again I got from the web. I thought this will dump the raw data for me(that is how I have coded the script) even if the POST data is empty. However it is not doing it. If the POST data is empty the output of this function is also empty.

 

The worst thing is-during my testing I never come across such an error. Only when the clients are using it, this error happens. Most of the time the submissions are fine and the data comes through. And whenever this error happens I get notifications through the error trapping code. For instance today I lost 15 records from a client;when I checked the database I have got submissions from the same user which have come through without any problem. That is what is troubling me-if the script works most of the time, why does it fail sometimes.

 

Please, can somebody give me some suggestions

 

Many thanks

Carol

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/204848-post-data-empty/
Share on other sites

You need to show us code (both the form & the processing script) if we are to help you. The way to dump the $_POST array is to put

<?php
echo '<pre>' . print_r($_POST,true) . '</pre>';
?>

at the start of the processing script. If you're using sessions, put it after the "session_start()".

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/204848-post-data-empty/#findComment-1072354
Share on other sites

Thanks for the replies.

Sorry about this. Because of the nature of the project I am not allowed to show the form. It is created using Quask which is a form generating software. Once the user clicks the submit button on the form, a php script processes the data.

Please find attached my php script.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/204848-post-data-empty/#findComment-1072489
Share on other sites

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.