Jump to content

Variable scope, I am sad


tomkure

Recommended Posts

Hi,

 

Being a programmer in ERP systems for a decade, PHP is confusing(at least for me)

 

I guess it is a simple task, but not for me...so if you can help I will be greatful

 

1. I have 3 different pages(1.php, 2.php, 3.php) that go to same detail.php page with dynamic content.

2. If I click 'back' or use javascript.goback(-1) I get an resend window which I want to avoid

3. Therefore I want to record which page I am coming from to direct where to go from my back buttom

4. In my opion I need to use a global variable that can been read in detail.php.

 

I have tried sessions which for me dont work.

 

If you have suggestion how to solve this I will appriciate very much

 

Kind Regards

Tom

 

 

 

 

 

 

Link to comment
Share on other sites

  • 1 month later...

I'm not sure if I understand exactly what you want, but I'll give an answer a try. If you are doing something from a form "submit", you should direct the user to some "process.php" page - that does not render any HTML - to do what you want (e.g., db update, etc.) and, depending on the success/failure of the process, direct them to another page using:

 

    header("Location: ./{1,2,3}.php");
    exit;

 

I don't know if this is what you need but I hope it helps.

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.