Jump to content

Form Action Help


unemployment

Recommended Posts

 

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">

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
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.