frenly Posted June 21, 2007 Share Posted June 21, 2007 Hi, I am new php user and this is my first post here in this forum. i am doing some php coding for my website. it is for a form inside "contact.htm" which directs the action to "process.php". the processing is fine as long as the validation of form is not passed. as soon as the validation is passed, the page will have to jump to another php page "thanks.php" along with the values from the previous form showing the user's input as an output. I tried to use header function but it is not passing the input values from the form. Is there any simple way to solve this problem without using javascript? Quote Link to comment https://forums.phpfreaks.com/topic/56549-help-with-form-action/ Share on other sites More sharing options...
swoyercmk Posted June 21, 2007 Share Posted June 21, 2007 Youre going to need to explain your problem a bit better and maybe post some code examples for us to really figure out what you're asking. My impression is that you will want your form action to direct to process.php (which I believe you are doing). If validation is passed, you could set a value and than test the value with an if statement before using your header function. Are you receiving an error? Its important to remember that all headers must be sent before any other output is produced - this could be your problem and may call from some restructure of your code and placement. Again, code examples would help alot! Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/56549-help-with-form-action/#findComment-279279 Share on other sites More sharing options...
frenly Posted June 21, 2007 Author Share Posted June 21, 2007 I have tried to briefly explain the problem below- In my code, contact.htm includes file process.php from the beginning process.php handles the validation of different form fields and generates necessary errors within contact.htm when the form gets proper data, it generates successfully sent message in this "success" part, i have tried to add header function to direct to another php page. it directs to the page but without the input values. this is the main problem i am facing. if i can pass values with header function, that also might be helpful i am not sure if i have made myself clear enough to get a proper solution. hope to get one soon Quote Link to comment https://forums.phpfreaks.com/topic/56549-help-with-form-action/#findComment-279299 Share on other sites More sharing options...
swoyercmk Posted June 21, 2007 Share Posted June 21, 2007 You could use the $_GET method or set a session and pass the variable through the session. I think this thread should have the info you need - its almost the identical situation. I'll provide the link rather than retype everything, but ask more questions as needed. hope this helps! good luck... http://www.phpbuilder.com/board/showthread.php?t=10341602 Quote Link to comment https://forums.phpfreaks.com/topic/56549-help-with-form-action/#findComment-279433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.