It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

iframe problem

Moderator: Malcolm

iframe problem

Postby Phate on Thu Dec 01, 2005 5:40 pm

The site that I am currently working on, http://thejewishcollection.com , is composed completely of iframes.

My question to you is that if someone were to link directly to one of the pages that should be in the iframe, is there a script that can check to see if that page is in the iframe?

And if it isnt, can it link to that page in the iframe?
Web-Developing since '03
Image
User avatar
Phate
500+ Club
 
Posts: 826
Joined: Sun Nov 21, 2004 4:12 am
Location: 127.0.0.1

Postby webmaster on Thu Dec 01, 2005 7:45 pm

I know a way to do it if your server supports PHP.
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby Phate on Fri Dec 02, 2005 2:03 am

it sure does

:)

(I just didnt know what forum to put this in)
Web-Developing since '03
Image
User avatar
Phate
500+ Club
 
Posts: 826
Joined: Sun Nov 21, 2004 4:12 am
Location: 127.0.0.1

Postby webmaster on Fri Dec 02, 2005 12:54 pm

Then you can make a script to see if they link URL in their URL-field is not / or /index.php and if it's not, redirect them to /index.php and show the page they were supposed to look at, in the frame. Is thif how you would like to do it?
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby Phate on Fri Dec 02, 2005 4:17 pm

sure, whatever works!

:)
Web-Developing since '03
Image
User avatar
Phate
500+ Club
 
Posts: 826
Joined: Sun Nov 21, 2004 4:12 am
Location: 127.0.0.1

Postby webmaster on Sat Dec 03, 2005 12:03 am

I'm going to bed now, remember me tomorrow and I will build something for you. (I will try to remember it myself, but you never know :D)
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby Phate on Sun Dec 04, 2005 5:02 am

you write that script yet?
Web-Developing since '03
Image
User avatar
Phate
500+ Club
 
Posts: 826
Joined: Sun Nov 21, 2004 4:12 am
Location: 127.0.0.1

Postby webmaster on Mon Dec 05, 2005 10:36 am

Now I have, try this:

[php]<?php

if(strpos($_SERVER['REQUEST_URI'], ".php") != false) {
$to = "http://www.yourdomain.com/?page=".substr($_SERVER['REQUEST_URI'],1);
header("Location: $to");
exit;
}

?>

<html>
<head></head>
<body>

<?php if (isset($_GET['page'])) { ?>
<iframe src="<?php echo $_GET['page']; ?>" width="200" height="200"></iframe>
<?php } else { ?>
<iframe src="standard.html" width="200" height="200"></iframe>
<?php } ?>

</body>
</html>[/php]
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden


Who is online

Users browsing this forum: No registered users and 1 guest