Jump to content

[SOLVED] How to set Iframe variable from recordset item of parent?


A JM

Recommended Posts

I have an Iframe variable that I want to be set from a recordset populating my parent form and am having a problem with this.

 

The parent form uses the following as a label:

<?php echo htmlentities($row_rstocdetail['formnumber'], ENT_COMPAT, 'utf-8'); ?>

 

I want my Iframe to be able to use the same information but I cant seem to get the variable to pass. Since the form on the parent is not submitted I can't use $_POST so I'm at a bit of a loss... this has to be easy I'm just missing something obvious here.

 

Any help would be appreciated.

 

Thanks.

 

A JM,

Link to comment
Share on other sites

I'm still pretty new to the game... how would you go about using it?

 

On the parent

 

if (!isset($_SESSION)) {
  session_start();
}

$_SESSION['myvar']='123456';

 

 

Then can I simply use the variable on the Iframe?

 

echo "Our color value is ".$_SESSION['myvar'];

 

What happens if the user uses the back button, etc? do I need to worry about clearing the $_SESSION?

 

Thanks.

 

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.