unemployment Posted October 27, 2010 Share Posted October 27, 2010 When I click the save changes button, I want the user to be brought back to profile.php. Right now they are being brought to editprofile.php. I currently have the form action set to editprofile.php . When the I change it to profile.php my fields won't update. Any thoughts as to where I went wrong? Here is the editprofile.php code. <form action='editprofile.php' method="POST" id="form"> Quote Link to comment https://forums.phpfreaks.com/topic/217014-form-action-help/ Share on other sites More sharing options...
mannyee Posted October 27, 2010 Share Posted October 27, 2010 your form processing script is probably in your editprofile.php page. once you are done with the script and if everything goes as planned , you need to redirect to the page using the header() function,...like header('Location:profile.php'); Be sure to exit() the script after the header function Quote Link to comment https://forums.phpfreaks.com/topic/217014-form-action-help/#findComment-1127147 Share on other sites More sharing options...
Pikachu2000 Posted October 27, 2010 Share Posted October 27, 2010 You need to either A) use a header() redirect back to profile.php after the editprofile.php script completes successfully, or B) submit profile.php to itself, and conditionally incorporate the code from editprofle.php either directly or via an include() if the form has been submitted. Option A is probably the best bet as it will also help prevent accidental double submission. Quote Link to comment https://forums.phpfreaks.com/topic/217014-form-action-help/#findComment-1127148 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.