Link Details

The more, the merrier! Login and vote now.
Link 69209 thumbnail
User 225135 avatar

By skoop
via php.dzone.com
Published: Mar 05 2008 / 16:32

After form submission or a page redirect is triggered, it's commonplace to redirect the user to a different page or to the same page, formatted in a different way. Usually, you'd complete this by coding: header('Location: destination.php'); exit(); This is a completely acceptable way to code your pages, but I prefer to use a redirect function instead. Why? It's much more readable, and quite honestly, I'm tired of writing the header('Location: …') code.
  • 8
  • 1
  • 2236
  • 595

Comments

Add your comment
User 220751 avatar

bosmeeuw replied ago:

0 votes Vote down Vote up Reply

Voted down because I don't think a trivial 4 line PHP function warrants a blog post.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (1)