Web Resources |
DataExpressions inc |
Website Development Resources |
Bookmark our site |
|
|
In this example I am going to show you how to create a Php page that uses the IFRAME tag to host various content that only used to be possible using frames. The ScriptFirst, lets examine the code for this example. php_and_iframe.php
If you examine the url links you will notice that they are linking back to the page we are on. We are passing back to the page a url argument named "xurl", setting it to some desired value. PHP-IFRAME.php?xurl=textfile In our Php code we are evaluating the returned argument. if($_GET['xurl'] == "textfile") Based upon this we set our variable to the desired url location. $url = 'Excel2a.txt'; After we have determined which url we want we execute the Php code that will populate the IFRAME echo I was more concerned with showing technique itself. As such you will need to use the scroll bars once the page reloads to go see that the new entity has loaded in the frame. Script in ActionClick on any of the actions below and watch the contents load into the frame. Note: If your browser cannot display PDF or Excel files these will not work.
Click here to get the files in the using the IFRAME tag with Php. With a bit of extra effort you can build pages that allow you to include external sites and non html content without the need for using frames. Also, using this technique you do not have to worry about the search engines not being able to properly index your site. As you can see the page holds enough content to be properly indexed. If you look at the ads that appear at the bottom of the page you will notice that they are unaffected by using this technique. All in all this is an awesome technique to include non html content to your site.
|
|
|
|
|
Copyright 2006-2007 by Data Expressions inc --- All Rights Reserved |