A php frames solution?
Moderator: General Moderators
A php frames solution?
This is another thing I've been wondering about.
I think we're all familliar with the problems we all get with frames... especially with people linking directly into a content page.. which could mean that they do get the content they want but not the menu of your site which would usually be in another frame.
Is there a good way to perhaps solve that in php? I know of a dodgy java script that could do it... but php? Can php check the browser name? Or I think that is what the javascript does.
I think we're all familliar with the problems we all get with frames... especially with people linking directly into a content page.. which could mean that they do get the content they want but not the menu of your site which would usually be in another frame.
Is there a good way to perhaps solve that in php? I know of a dodgy java script that could do it... but php? Can php check the browser name? Or I think that is what the javascript does.
PHP can infact detect the browser that the user is using. Check this page out, it kinda gives a good description on how it works. http://www.php.net/manual/en/function.get-browser.php From there you can use include() to get the page you want. Hope that helps.
Okiedokie that doesn't work.
Which brings me to another thought.
In frames a source is usually set at
Now that's all nice but apparently variables aren't carried in a frameset. Meaning say my index.php holds a frameset and I set a variable in index.php that variable is lost for the content of it's frames.
And I don't want to create links and src with ?data=blabla
Anyone have an idea of how to solve this? Am I rambling?
Basicly I want to post data to a page without a form or ?data=blabla links.
And I want the post not to be seen by search engines and such.. possible?
Which brings me to another thought.
In frames a source is usually set at
Code: Select all
src=frame.htmlAnd I don't want to create links and src with ?data=blabla
Anyone have an idea of how to solve this? Am I rambling?
Basicly I want to post data to a page without a form or ?data=blabla links.
And I want the post not to be seen by search engines and such.. possible?
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
what i do is have my little layout template, which has the menu and all that, and in it has like
echo "$content";
where i want all the content,
and in my pages i have:
$content = <<<HTML
-STUFF-GOES-HERE-
HTML;
include('layout.php');
so the layout and menu and everything always pops up with the content,
also on dynamicdrive.com they have a javascript that checks if the file is in frames, or not in frames, or something...that was probably what you were talking about though
echo "$content";
where i want all the content,
and in my pages i have:
$content = <<<HTML
-STUFF-GOES-HERE-
HTML;
include('layout.php');
so the layout and menu and everything always pops up with the content,
also on dynamicdrive.com they have a javascript that checks if the file is in frames, or not in frames, or something...that was probably what you were talking about though
Session support in PHP consists of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site. (link)
This is done by either sending a (inpersistent) cookie or the parameter SID/session_name=<session id>. Take a look at the manual section.
This is done by either sending a (inpersistent) cookie or the parameter SID/session_name=<session id>. Take a look at the manual section.
Goblin yes that was what I was talking about and the way you do your sites is in a way like mine as well, but that's not how to circumvent the frames issues.
I think you either do need to use that sort of javascript or sessions. neither one really suits my needs very well. And thx Volka.. I read it.
I still feel as if there must be a better way.
I think you either do need to use that sort of javascript or sessions. neither one really suits my needs very well. And thx Volka.. I read it.
I still feel as if there must be a better way.
actually know what... I think I give up and will just create sites with iframes for frames from now on and I'll stick on a tiny little text menu that'll be invisible inside the iframe cause of the width and no scrolling.
Still think it's silly no one ever came up with a simple standard solution for this. cause all you really need is the ability for a page to check what the name of the frame it's loaded in is.
Still think it's silly no one ever came up with a simple standard solution for this. cause all you really need is the ability for a page to check what the name of the frame it's loaded in is.
-
ShrineMaster
- Forum Newbie
- Posts: 7
- Joined: Mon May 20, 2002 5:33 am
A few ways to prevent people from linking to a page in frames is to either check the referer and bounce them to the framed index page if the referer isn't your site or use javascript to check if the page is in Javascript (Annoying, check out this page on Microsoft's documentation site to see just how annoying it is. Open other pages in new windows).
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact: