Solved

iframe external linking issue.

Posted on 2004-09-14
19
182 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
  • 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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 250 total points
ID: 12069319
Any server side language should be able to the do job.
0
 
LVL 5

Assisted Solution

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
The viewer will learn how to dynamically set the form action using jQuery.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now