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
https://forums.phpfreaks.com/topic/191134-variable-scope-i-am-sad/
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.

Archived

This topic is now archived and is closed to further replies.

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