Jump to content

rediredt on form finish?


delphi123

Recommended Posts

When I'm coding asp/.net I frequently want to redirect users after I've run some code - eg for a news posting system I'd have a form send to an asp page that'd insert to the database and then redirect them back where they were.

 

Can anyone tell me what the command is for php? Have dug around, but most redirects seem to be limited to 301-style execution (ie at top of the page before code)

Link to comment
https://forums.phpfreaks.com/topic/171809-rediredt-on-form-finish/
Share on other sites

header is, I guess what you called a 301 style execution. it needs to be executed before any output is sent (IE at the top of the page). Beyond that, I don't think PHP has any other ways to redirect a user. You can use meta tags to redirect a user, as well as javascript, (but both of those can be disabled, so these may want to be avoided).

that's strange - so I'd normally have a form on a page that sends the data in post to a 'processing' page which then bounces the user back to the original page.

 

Would you normally use the header option for this? (or is there some other method entirely in php?)

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.