Welcome to WebmasterWorld Guest from 3.227.208.153

Forum Moderators: coopster & jatar k

PHP to Pass variable to next page

I am trying to track visitors locations and pass that info on to a 2nd page

     
10:23 pm on Aug 15, 2019 (gmt 0)

Full Member

10+ Year Member Top Contributors Of The Month

joined:Jan 3, 2004
posts: 321
votes: 39


I am trying to track visitors locations and pass that info on to a 2nd page but do not have php knowledge to do so. I feel this is really simple for those in the know.

Say I have a visitor to my "Los Angeles" page, and they click over to apply page that has the following link...

<iframe src="https://website.com/app/iframe?aff_id=5&aff_utm_source=MY_CODE_HERE&product_names=product1,&bgcolor=%23ef4541" frameborder="0" scrolling="no"></iframe>

I would like to have this iframe link change to show the city location to change
"&aff_utm_source=MY_CODE_HERE" to show "&aff_utm_source=Los_Angeles_CA"

1- what code do I need to place on say the "Los Angeles" page?
2- what code do I need to insert the "city name" into the "&aff_utm_source=MY_CODE_HERE" part of the url.

Any help would be much appreciated, I am new to php so would need sample (cut & paste) type of answers, thanks.
11:04 pm on Aug 16, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


The easier is to store the location in a cookie, then each of your PHP scripts can read this cookie and do whatever you want from this information.
1:40 pm on Aug 17, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


or you can use PHP Sessions to store it : [php.net...]
2:39 pm on Aug 17, 2019 (gmt 0)

Full Member

10+ Year Member Top Contributors Of The Month

joined:Jan 3, 2004
posts:321
votes: 39


I know what was needed to do it, but I did not know how to code it to work.

Anyways I did find someone to get this done so we can close this thread.
1:17 pm on Aug 18, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


Good for you. May be you can post the code, so it can help someone else ?