Jump to content

[SOLVED] Retain variables after form submit redirect HELP!!


Recommended Posts

Hey All,

 

This is problem either a stupid or very easy question, any suggestions are greatly apreciated.

I have a section on my website where only users that are "logged in" can view and I'm using the following syntax at the top of verify that they are logged in and that they can only view their profile:

 

if((!$session->logged_in) || (($session->num != $_GET[num]) && ($session->num != $_POST[num])))
{
header("Location:websiteaddresshere");
exit;
}

 

This works great. The get to your account you have to be logged in and use the user: account.php?num=# or else you are redirected.

 

My problem is as follows. I have a section to edit your account details that uses the same code as above.

However, once you submit the form on accountedit.php, it redirects to the main website address instead of displaying some text saying the edit worked successfully.

 

How do I submit a form and add "?num=$usernum" to the end of the website url so they aren't redirected?

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.