?
Solved

iframe external linking issue.

Posted on 2004-09-14
19
Medium Priority
?
190 Views
Last Modified: 2013-12-25
Hi there,

I have inherited an iframes based Web site and have encountered all the downside issues that come along with a frames based site, such as search engine crawling and external linking issues.

Most importantly, I want to be able to provide third parties (other Web sites, search engines, users ...) with absolute URL's to the iframe content, however, I need to call the parent page to make the Web site usable.

Preferably I'd like to call a javascript page rather than fill up each html page with more code.

BTW., the site is many levels deep if this helps, or changes the way you think about the answer.

Cheers in advance.
0
Comment
Question by:gooner_paul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
19 Comments
 
LVL 3

Expert Comment

by:Sasho
ID: 12059638
You could put some code to take in a command based on which you would display the appropriate content.
Here is a simple example of what I have done:

<?PHP

<?// Get the command
   $cmd = $_GET['cmd'];
   $meat='page1.html';
   if ($cmd == "page1")
   {
          $meat="page1.html";
   }
   elseif($cmd != "page2")
   {
         $meat="page2.html";
   }
   
?>
<html>
<head>
<title>Meat Page</title>
</head>
        <frameset rows="20,*,20">
            <frame name="hbar_top" scrolling="no" noresize src="header.html" >
            <frame name="mainframe" noresize src="<?=$meat?>" >
            <frame name="hbar_bot" scrolling="no" noresize src="footer.html" >
        </frameset>
</html>
0
 
LVL 3

Expert Comment

by:Sasho
ID: 12059640
Oooops I have a typo...
<?PHP

// Get the command
   $cmd = $_GET['cmd'];
   $meat='page1.html';
   if ($cmd == "page1")
   {
          $meat="page1.html";
   }
   elseif($cmd != "page2")
   {
         $meat="page2.html";
   }
   
?>
<html>
<head>
<title>Meat Page</title>
</head>
        <frameset rows="20,*,20">
            <frame name="hbar_top" scrolling="no" noresize src="header.html" >
            <frame name="mainframe" noresize src="<?=$meat?>" >
            <frame name="hbar_bot" scrolling="no" noresize src="footer.html" >
        </frameset>
</html>
0
 
LVL 3

Expert Comment

by:Sasho
ID: 12059648
If you put this in index.php...you could give out URLs like:

http://www.yoursite.com/index.php?cmd=page1
http://www.yoursite.com/index.php?cmd=page2

Cheers
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:gooner_paul
ID: 12059850
Thanks for the quick response, Sasho.

Sorry, I'm not really a PHP coder so I am a little cofused as to where the index.php page would reside. Would I have an index.html page for the parent window, an index.html page for the child window and then a php index page?

Also, is this a page by page implementation?

I am really looking for something that can be called on no matter what URL is requested, i.e., pages in search engines. This site has over 200 pages and is growing all the time.

I guess what I am trying to say is; if any absolute URL (page) from this sub-directory down (including sub-folders) is requested then load main frameset (parent window) as well

Cheers
0
 
LVL 3

Expert Comment

by:Sasho
ID: 12059901
PHP is server side code (http://www.php.net). The index.php could actually replace your index.html

I understand your dillema. You don't want 200 elseif statements.

Perhaps your index.php can take the absolute URL you are talking about and display that in the mainframe of the frameset. Something like this:
<?PHP

// Get the command
   $url = $_GET['url'];
   $meat=$url;
?>
<html>
<head>
<title>Meat Page</title>
</head>
        <frameset rows="20,*,20">
            <frame name="hbar_top" scrolling="no" noresize src="header.html" >
            <frame name="mainframe" noresize src="<?=$meat?>" >
            <frame name="hbar_bot" scrolling="no" noresize src="footer.html" >
        </frameset>
</html>

That way you can link like this:
http://www.yoursite.com/index.php?url=http://www.yoursite.com/subfolder1/subfolder2/subfolder3/index.html

0
 
LVL 3

Expert Comment

by:Sasho
ID: 12059989
I agree this question would be more appropriate elsewhere...
0
 

Author Comment

by:gooner_paul
ID: 12060288
My server handles php, I just need to find out what version. Is there a way that I can test that without having to deal with waiting for the administrator to answer tomorrow?

If you'd like to move my question that would be great.

Thanks again.
0
 
LVL 3

Expert Comment

by:Sasho
ID: 12060295
You can test it. Just create the index.php I wrote and give it a try.
0
 

Author Comment

by:gooner_paul
ID: 12060844
which index page becomes the index.php?

the parent, or the child?
0
 
LVL 3

Expert Comment

by:Sasho
ID: 12065818
The parent.
0
 

Author Comment

by:gooner_paul
ID: 12066173
Actually, I just spoke with the sys admin -- where the site is hosted -- and I was NOt on a PHP enabled server. I am now in the process of moving my files over to the new server and will be waiting for a dns change.

The version of php is: 4.3.6

perhaps, COBOLdinosaur, you can move my question to a more appropriate section.

cheers
0
 

Author Comment

by:gooner_paul
ID: 12066253
I'm also wondering if there might be a CGI fix.

I just stumbled across this as an example:
http://www.woodweb.com/cgi-bin/track/trk.pl?url=http://www.woodplanet.com/main/form/comps/
0
 
LVL 3

Accepted Solution

by:
Sasho earned 1000 total points
ID: 12069319
Any server side language should be able to the do job.
0
 
LVL 5

Assisted Solution

by:ITcrow
ITcrow earned 1000 total points
ID: 12187253
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question