I have been working on a registration form for a website. The form gets user data, validates it and adds it to mysql database. For user to avoid sending data again I have used header redirection method. It redirects to the same page with additional variables. I have included the form in the index page. This works fine except for some additional reasons. The index page has div element in which entire page is included. The form redirects until the div element doesn't have style attrib set. I can't understand the problem. Is this a CSS issue? Please help.
1
-
4We cannot help you just from this vague description. You have not adequately described the problem (what does happen after submitting the form? why is this wrong? what is the expected result?). Once we have that, we need to examine your code to determine why that is the case, but you've provided no code.Dan Grossman– Dan Grossman2010-12-10 09:48:52 +00:00Commented Dec 10, 2010 at 9:48
Add a comment
|
2 Answers
You should look that there is no html ouput before you user header()
4 Comments
Sanket Raut
The code works fine when there is no style attribute set for a div element. what could ne the possible cause
Sarah West
Do you use inline css or do you have an extra file for css?
Mr_Chimp
You cannot issue a header('Location: ####') command after outputting anything. Even a single space outputted will prevent the the redirect from working. If you have output a div - with or without a style attribute - then you won't be able to redirect. It's hard to give any more help without seeing your code.
El Yobo
@Sanket, Sarah & Mr_Chimp are correct, this is the reason it is not redirecting. How are you outputting the style? Are you sure it's not before the
header is sent?