Solved

iframe external linking issue.

Posted on 2004-09-14
19
188 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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 

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 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

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…
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…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

724 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