simpli Posted March 24, 2009 Share Posted March 24, 2009 Hi, I am having problems with the header function. I think I dont understand it and I'm stepping back a little to see if I can learn it better. Here is my situation: I have a form that calls itself back when the submit is pressed. After the data is validated and I have written on the database I want to go to another page and that's where it doesnt work. Now I know one thing: If I have output anything to the web page I know that header will not work. My question is this: Since the form calls itself back does that mean the header function will inherently not work in this situation? Can you propose me an alternative or a workaround? Thank you, J-R Link to comment https://forums.phpfreaks.com/topic/150801-header-problem-please-help/ Share on other sites More sharing options...
lonewolf217 Posted March 24, 2009 Share Posted March 24, 2009 you can submit to the same page, just validate everything , submit to the database and redirect before outputting anything to the client (i.e. outputting your form) Link to comment https://forums.phpfreaks.com/topic/150801-header-problem-please-help/#findComment-792243 Share on other sites More sharing options...
simpli Posted March 24, 2009 Author Share Posted March 24, 2009 We are agreed however that the first time I go through the file my form is going to be output (as I show it to the user)? So for it to work I must make sure that in the validation process nothing whatsoever is returned to the user before I use the header function is this correct? J-R Link to comment https://forums.phpfreaks.com/topic/150801-header-problem-please-help/#findComment-792261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.