Stacking iframe?

I’m having some issues stacking 2 iframes, and I can’t seem to find the error.

Here’s what I’ve got:

[php]var iframeids=[“myframe”]
var iframeids=[“extframe”]
var iframehide=“yes”
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf(“Firefox”)).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0[/php]

[php]if ($_SESSION[‘clientlevel’] == “Elliott-Accord”)
{
echo '<font size=“0” color="#333333>For Internal Use Only:
Allowed file types: PDF, JPG


';
{
echo '<font size=“0” color="#333333>For External Use Only:

';[/php]

I can get one iframe (myframe) to show properly when on its own, but when both iframes are entered I either get 1 or neither frame showing.

I inherited this PHP and I feel like I didn’t specify something for the “extframe” someplace, but I can’t seem to figure out where.

It should be noted that I did code in the first frame to id=“extframe” rather than having it the same as the “myframe” but it still doesn’t work.

Hi js61283,

There are a number of issues with improper html markup. Among these are depreciated elements, unclosed fieldsets, every fieldset must have a legend (must be the first thing after the fieldset tag), etc. In addition, there is a left brace instead of a right brace between the two frames.

In most cases, you should also be using isset on your $_SESSION.

Now is also a good time to move toward CSS and get rid of the depreciated elements.

I don’t quite follow what is going on with the javascript, but it definitely doesn’t look right. It looks like it is trying to set iframeids as an array, but it is actually assigning it as a simple variable twice and setting iframehide to “yes” without ever using any of them. Nothing in the javascript should interfere with anything you posted, but the two iframeids in a row is definitely illogical and the rest makes no sense unless there is additional unposted code.

I don’t know what doctype you are using, so you may need to make a few changes, but see if this works for you:[php]if(isset($_SESSION[‘clientlevel’]) && $_SESSION[‘clientlevel’] == “Elliott-Accord”)
{
echo ’


For Internal Use Only:


Allowed file types: PDF, JPG


Internal Use


';
}
echo ’
For External Use Only:
External Use ';[/php]

Please let me know if this fixes the problem. If not, could you post the rest of the code, as the code I presented above works fine on my system.

Its always hard when you inherit someone else’s code! I have no doubt we can get this working for you.

jay

This worked like a charm. Thanks a lot Jay, much appreciated.

My pleasure! Let us know if you have any other issues.

Maybe I should make a new thread for this, but I’m actually having a little more trouble with this. I tried implementing your suggestions to the “superadmin” login on my page, but now everything under that login is showing up at the very bottom of the page; with my else statement appearing above it. It seems to me that this is a simple issue with the code running the ELSE statement before my superadmin IF statement. I cannot seem to figure out how to fix it though. As a result of this error logging out no longer prevents access to the superadmin functions either.

Here’s the code for the function I’m dealing with:

[php]function f_project_documents()
{
echo ’

Project Documents

'; if(isset($_SESSION['clientlevel']) && $_SESSION['clientlevel'] == "Elliott-Accord") { echo '
For Internal Use Only:
Allowed file types: PDF, JPG
Internal Use '; } echo '
For External Use Only:
External Use '; } if(isset($_SESSION['iamthesuperadministrator']) && $_SESSION['iamthesuperadministrator'] == "ID_superadmin") { echo '
For Internal Use Only:
Allowed file types: PDF, JPG
Internal Use '; echo '
For External Use Only:
External Use '; } else { echo ' '; } echo '


';[/php]

See if this works (I can’t test it):[php]
function f_project_documents()
{
echo ’

Project Documents




';
if(isset($_SESSION[‘clientlevel’]) && $_SESSION[‘clientlevel’] == “Elliott-Accord”)
{
echo ’

For Internal Use Only:


Allowed file types: PDF, JPG


Internal Use


';
}
echo ’

For External Use Only:


External Use


';
if(isset($_SESSION[‘iamthesuperadministrator’]) && $_SESSION[‘iamthesuperadministrator’] == “ID_superadmin”)
{
echo ’

For Internal Use Only:


Allowed file types: PDF, JPG


Internal Use



For External Use Only:


External Use


';
}
else
{
echo ‘’;
}
echo '</div><BR><BR></fieldset>';

}[/php]

Half of the code was outside of the function. I moved the function closing right brace to the end of the code and made a few minor tweaks.

One thing that I am not sure of: Do you want to only perform the first if…else if the user is not superadmin? If so, we will need to change the code a little, as right now it will perform both if…else statements and render the appropriate section of each.

Let me know…

Correct, I only want the else statement to run if the user is neither superadmin nor the clientlevel. I’m having a tough time keeping track of the braces and which one pertains to what section of the code. Thanks for catching that.

So I’m seeing what you’re saying about the else statement executing within the superadministrator login, what I really don’t understand is why the else statement is executing prior to the rest as you can see here:

I would prefer to have the else statement only execute if a login other than clientlevel or superadministrator is used, so if you could show me how that would be awesome. Another question I had is in regards to the Else statement when someone other than clientlevel or superadministrator login. When I log in as someone else (which should only execute the else statement) I still see the text “External Use” surrounded by the Legend box. Since this isn’t any part of the Else statement I’m not understanding why this still shows. If you could help me hide it for logins other than the 2 I mentioned I’d really appreciate it.

Lets give this a try. I may not be fully understanding exactly what you want to happen when, but I think this may be what you are looking for:[php]function f_project_documents()
{
echo ’

Project Documents



';
if(isset($_SESSION[‘iamthesuperadministrator’]) && $_SESSION[‘iamthesuperadministrator’] == “ID_superadmin”)
{
echo ’

For Internal Use Only:


Allowed file types: PDF, JPG


Internal Use



For External Use Only:


External Use


';
}
elseif(isset($_SESSION[‘clientlevel’]) && $_SESSION[‘clientlevel’] == “Elliott-Accord”)
{
echo ’

For Internal Use Only:


Allowed file types: PDF, JPG


Internal Use


';
}
else
{
echo ’


';
}
echo ‘


’;
}[/php]

Definitely takes care of the problems I was having. Thanks again for all the help, couldn’t have done it without you.

My pleasure! Glad it’s working for you.

Sponsor our Newsletter | Privacy Policy | Terms of Service