Jump to content

Returning error codes


php_guy

Recommended Posts

I am using a sloppy 3rd party API  that doesn't return error codes, just error messages. See below

$err = $object->getErrorMessage();

if( strlen($err) > 0 ) {
header("Location: step1.php?err=$err");
}

As you can see this is sloppy because anyone can just modify the address bar of step1.php and inject their own error message, or javascript or their own HTML buttons, etc.

 

As a work around, I thought maybe I could use POST instead of GET... At least then the "err" variable would be hidden for the most part

 

Any ideas how I can work around this?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/227819-returning-error-codes/
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.