Jump to content
php.lv forumi

Iframe on piekluve skriptam pa tiešo


neo

Recommended Posts

Sveiki!

 

Ir sekojosha problema:

 

ir divi faili index.php un home.php

 

index.php

<iframe name="home_form" src="home.php" width="100%" height="600" scrolling="no" frameborder="0"> </iframe>

 

ir japanak lai nevaretu versties pa taisno pie home.php no browsera. Respektivi kaut ka janocheko, ka viss tas pasakums strada caur iframe.

 

Ir kadas idejas?

Edited by neo
Link to comment
Share on other sites

Varbūt:

 

index.php

$_SESSION['iframe'] = random skaitlis;

<iframe name="home_form" src="home.php?id=<?php echo $_SESSION['iframe']?>" width="100%" height="600" scrolling="no" frameborder="0"> </iframe>

 

 

home.php

if($_GET['id']!=$_SESSION['iframe']){
die();
}

Link to comment
Share on other sites

Mosh kaut kaa taa.

 

// index.php
$_SESSION['super-secret'] = 'super-secret';
render_iframe();

// home.php
if(!isset($_SESSION['super-secret']))
 die;

unset($_SESSION['super-secret']);

continue_to_do_things();

 

Vispirms tiks uzstaadiits sesijas mainiigais. Tad naakamais solis buus iframe ielaade, kas ielaadees to home.php, kursh nochekos vai tas sesijas mainiigais ir pieejams un izdzeesiis to. Taatad ejot pa taisno uz home.php sesijas mainiigais nebuus pieejams.

 

+ veel var skatiities referer'us un taa...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...