need help with passing of variable using $_session please

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 9, 2019   (RSS)

By daniel - January 7, 2019

Hi Willydoit,

That's an interesting issue you have there; the section you identify is inside <noscript> tags, so unless you have javascript disabled on the page, it shouldn't actually be doing anything on your page - let alone modifying the session.

How are you including/viewing test.php? Is it also in an iframe? If that's the case, it might be easier to pass in the value through a URL parameter rather than a session. So the iframe code could look something like this:

<iframe src="test2.php?email_address=<?php echo $advertisersRecord['email_address']; ?>"></iframe>

And then you could access that value in test.php with the following:

echo $_GET['email_address'];

If you'd still like to try to get the session method working, my suggestion would be to try moving the test.php iframe HTML above the coffee cups snippet; this could help rule out a couple different issues.

Hope that helps!

Cheers,

Daniel
Technical Lead
interactivetools.com

Hi Daniel,

Thanks for looking at this. Unfortunately I posted tne wrong code, it is the script element of the code that causes the issue.

By daniel - January 9, 2019

Hi willydoit, 

That solves one mystery, but I'd still recommend the same troubleshooting steps; try moving the test.php iframe above the script causing the issue, and/or try using a URL parameter to pass in the value.

Another thing that's useful for troubleshooting in a case like this is using "var_dump()" instead of "echo", like this:

var_dump($_SESSION['email_address2']);

var_dump() will always show some sort out of output, even if the variable is empty, so it can be used to tell the differences between an issue with the variable/session and issues preventing the script from executing/displaying.

Hope that helps!

Cheers,

Daniel
Technical Lead
interactivetools.com