0

I have the below php statement that gives me the exit 'error' on some initial page loads however when I refresh the page it works fine.

What I would like to do is take the exit result and make it so the script would refresh.

Would I have to store it in an array?

if (!$results || !property_exists($results, 'success')) {
    exit('Error');
}
Jess McKenzie
  • 8,345
  • 27
  • 100
  • 170
  • Do you just mean that you want to return a response that would cause the browser to re-issue the request? You can set a redirect header: https://stackoverflow.com/questions/768431/how-do-i-make-a-redirect-in-php – David May 27 '19 at 20:32
  • Also if you use a redirect to send them back to the same page, you should be careful to avoid triggering the [redirect loop warning](https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections#Redirection_loops) in browsers. – Romen May 27 '19 at 20:50

0 Answers0