Inline frame PHP Alternative?

Permabanned
Joined
7 Nov 2006
Posts
6,134
Location
Nottingham
Hey i'm just wondering if anyone knows any sites detailing alternatives to inline frames or could explain to me what they are. As i am currently using them on my site but would like each window to load to the exact same size to the page so there is no scrolling.

Thanks
 
As above.

What I usually do is create an index page and put something similar to the following where I would have put the frame:
PHP:
<?php
if(is_file("./" . $_GET['page'] . ".php"))
	{
	include_once($_GET['page'] . ".php");
	}
else
	{
	include("home.php");
	}
?>
This provides protection to a certain extent to injection-based attacks as it checks that the file exists before displaying it. If the file does not exist, the script just displays the 'home.php' file.
Obviously you now have to include the variable "page" in all of your links so they look something like index.php?page=favmusic.

As for displaying the information generated by this little script, try googling for "CSS Tutorials" and you'll find pleanty of resources on how to lay out your website really well.

HTH,
Freakish_05
 
Freakish_05 said:
As above.

What I usually do is create an index page and put something similar to the following where I would have put the frame:
PHP:
<?php
if(is_file("./" . $_GET['page'] . ".php"))
	{
	include_once($_GET['page'] . ".php");
	}
else
	{
	include("home.php");
	}
?>
This provides protection to a certain extent to injection-based attacks as it checks that the file exists before displaying it. If the file does not exist, the script just displays the 'home.php' file.
Obviously you now have to include the variable "page" in all of your links so they look something like index.php?page=favmusic.

As for displaying the information generated by this little script, try googling for "CSS Tutorials" and you'll find pleanty of resources on how to lay out your website really well.

HTH,
Freakish_05
Can I suggest you modify that slightly so that the page that contains the code (index.php) can't be called? PLEASE. It will avoid an infinite loop.

*I'm tried - I could be wrong*
 
Back
Top Bottom