Lets say that i have 2 pages: index.php and service.php
index.php sends an http-post to service.php, containing a datestamp once every 5th minute.
How would i debug the post variables on service.php? Obviously i cant just do a
if(isset($_POST['key'])) {
var_dump($_POST['key']);
}
since it wont exist when i enter the page.
In ASP.NET i would just create a breakpoint, but how would i inspect the posted data in php?
Thanks
Save the status of the $_POST
array to a file using var_export
(with the current time()
to avoid overwrites), and inspect the file later.
file_put_contents( 'debug' . time() . '.log', var_export( $_POST, true));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With