Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/56549-help-with-form-action/
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/56549-help-with-form-action/#findComment-279279
Share on other sites

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/56549-help-with-form-action/#findComment-279299
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/56549-help-with-form-action/#findComment-279433
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.