frames and $_GET
Moderator: General Moderators
frames and $_GET
Firstly, I don't know whether this belongs here or in Client Side.
I have a framepage that loads two basic frames. A top frame, and a bottom frame. What I'm wanting to do is have the bottom page stay the same, but the user should be able to navigate in the top frame. It works good except when a link in the top page uses $_GET.. such as they click on a link like page.php?foo=bar.. it then breaks my page out of frames and loads that page as the whole page.
I expected this.. because it has to know the URL in order to execute the PHP.. but is there any way around this? Is it possible to do?
I have a framepage that loads two basic frames. A top frame, and a bottom frame. What I'm wanting to do is have the bottom page stay the same, but the user should be able to navigate in the top frame. It works good except when a link in the top page uses $_GET.. such as they click on a link like page.php?foo=bar.. it then breaks my page out of frames and loads that page as the whole page.
I expected this.. because it has to know the URL in order to execute the PHP.. but is there any way around this? Is it possible to do?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
the bottom frame doesn't have any links... just the links in the top frame.. and i want them to open in the top frame.. not another 'target' frame.. if you know what I mean
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
so give your frame an id and a name and then use the target attribute to tell it where to open the page:
ex:
ex:
Code: Select all
<a href="whatever.php" target="topFrame">whatever</a>whoa.. I thought you were way off base with your answer.. and didn't understand my question.. but it worked beautifullly
congrats to you burrito man!
Now, on to a tougher question.. sometimes the top frame will be in a framed page, and other times it will be on a page by itself ( the user has the option to choose frames, or just view the top page of the frames in a page of its own)
Now, I'd hate to go through my WHOLE site, giving every link a target attribute.. that would be hard.. and very time consuming.
Is there a piece of code I can write.. or something.. that can check to see if there is frames, then if there is, give all A tags, a target attribute..
or would I have to do that manually?
Now, on to a tougher question.. sometimes the top frame will be in a framed page, and other times it will be on a page by itself ( the user has the option to choose frames, or just view the top page of the frames in a page of its own)
Now, I'd hate to go through my WHOLE site, giving every link a target attribute.. that would be hard.. and very time consuming.
Is there a piece of code I can write.. or something.. that can check to see if there is frames, then if there is, give all A tags, a target attribute..
or would I have to do that manually?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
here's what I'd do:
I'd create a "preferences" section that allows the user to choose whether they want frames or not then store that preference in a session var.
you could then do an extended find and replace for all of your <a> tags and add something like this:
I'd create a "preferences" section that allows the user to choose whether they want frames or not then store that preference in a session var.
you could then do an extended find and replace for all of your <a> tags and add something like this:
Code: Select all
<a href="blah.php" <?php echo ($_SESSION['frames'] == 'yes' ? "target=\"topFrame\"" : "");?>>link</a>okay.. well I basically gave you a general scenario earlier.. so here's the real situation.
I'm implementing a 'chatbar' feature of my website.. for users who want to chat and browse the site at the same time. when they go to the frame page (chatbar.html) the top frame is the rest of the site, and the bottom page is the chat.. so they can chat and browse at the same time.. so I don't really think a session would be fit because it's not really their 'preference' so to speak..
I guess when they load chatbar.html I could update a field in my database that would tell the php page it's using frames.. then how would I do the find and replace on a whole page, without manually editing each link?
What about CSS, can you give links a target in the css?
I'm implementing a 'chatbar' feature of my website.. for users who want to chat and browse the site at the same time. when they go to the frame page (chatbar.html) the top frame is the rest of the site, and the bottom page is the chat.. so they can chat and browse at the same time.. so I don't really think a session would be fit because it's not really their 'preference' so to speak..
I guess when they load chatbar.html I could update a field in my database that would tell the php page it's using frames.. then how would I do the find and replace on a whole page, without manually editing each link?
What about CSS, can you give links a target in the css?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I'll be blunt.. what exactly does this do? how do I use it, and where do I put it? =/ I've never used something like this in my code. Would someone please explain it to meCode: Select all
<a href="blah.php" <?php echo ($_SESSION['frames'] == 'yes' ? "target=\"topFrame\"" : "");?>>link</a>
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
it's the ternary operator:
go here and look about a sixth of the way down the page for "Ternary Operator".
Basically it's an if / else but much more concise.
in the case that I wrote it would compare to this:
go here and look about a sixth of the way down the page for "Ternary Operator".
Basically it's an if / else but much more concise.
in the case that I wrote it would compare to this:
Code: Select all
if($_SESSION['frames'] == "yes")
echo "target=\"topFrame\"";
else
echo "";ah, understood.
so i'd have to place this code manually into all of the link tags?
so i'd have to place this code manually into all of the link tags?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
I could do that.. but not all links look the same.. I guess I could do
a bit backwards from how I usually do things, but it should work.
Code: Select all
<a <? insert your ternary operator here ?> href="blah.php">link</a>Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact: