Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-26-2004, 06:59 PM
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Spain
Posts: 344
computergenius RepRank 1
Default PHP in a IFRAME

I want to make my content available on other sites, and I was wondering if PHP pages (changing the format via CSS to match some sites) with an IFRAME was a good way to go. I have seen this done before, and it seems simple to install on the receiving site - just about 3 lines of code required, then nothing more for the receiving sites webmaster to do at all, and I would have no problem writing the PHP for the broadcasting site.

Any thoughts on whether or not this is a good route to take would be appreciated, before I waste too many brain cells...
__________________
Pete Clark
Advertise events locally in Spain for free - http://hotcosta.com/events.php
Reply With Quote
  #2 (permalink)  
Old 03-26-2004, 07:11 PM
splinter's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 261
splinter RepRank 0
Default

Well, IFRAMES are not supported in XHTML Strict and this may clash with some peoples sites.

I would recommend using PHP include files, but I know this is not practical as not everyone has PHP on their site.

You could use a Javascript to open a popup window that links to your site?

This isn't entirely what you had in mind but I'm not sure.
Reply With Quote
  #3 (permalink)  
Old 03-27-2004, 02:09 PM
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Spain
Posts: 344
computergenius RepRank 1
Default So individual pages, perhaps...

Thanks for that - I haven't got around to figuring out DOCTYPES in detail.

But I suppose that the receiving site could just change the doctype for that page...

I really want to allow receiving sites to have formatted content within their pages. When I have seen RSS, it has just been a series of links. What I really want to do is have my catalogue on other peoples sites. But I would want pictures and a little text on the "menu" page, rather than just links, with links going to detail pages. It would be nice to have the "menu" and "detail" appearing within the receiving site.

Using IFRAMES, I wouldn't have to show a full page to match the receiving sites style, just the content. Any suggestions would be welcome.
__________________
Pete Clark
Advertise events locally in Spain for free - http://hotcosta.com/events.php
Reply With Quote
  #4 (permalink)  
Old 03-27-2004, 03:19 PM
WebProWorld Member
 

Join Date: Aug 2003
Location: Wales
Posts: 68
rawdist RepRank 0
Default

You can do want you want with a combination of javascript and php.

What you do is get your user to include a piece of javascript where the src= is the location your php page, just set the php page to output:

doucment write (" whatever you want to appear in the way of products including html code ");

To see this in action take a look at my site http://www.blogfuel.com Make yourself a bit of code and stick it on a page and see the result. Then enter the url part of the code into the browser address bar and see what comes up then.

There is a little bit more to it than this as you have to escape a few codes when passing to the doc write, but that's the gist of it.
Reply With Quote
  #5 (permalink)  
Old 03-27-2004, 04:25 PM
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Spain
Posts: 344
computergenius RepRank 1
Default Now THATS a different idea...

When I say "different", I mean both the coding and the 'sales concept'. I tend to ignore Javascript, if only because I hear that so many paranoid surfers switch it off. But I will look at your concept.

I also like the graphics on the right of your home page, which hang "outside the box".

Can I critize (politely)- your home page starts of by saying 'what does it cost?', then 'how can I use it?' Surely, since the idea is so novel, you should start with 'what is it?'. And you mention Listmania, without any reference to what that is, either.

Thanks for the input, it gives me a new direction to go in. I wonder if the php page on the broadcasting site will be the same, whether using Javascript or iframes...
__________________
Pete Clark
Advertise events locally in Spain for free - http://hotcosta.com/events.php
Reply With Quote
  #6 (permalink)  
Old 03-27-2004, 05:17 PM
WebProWorld Member
 

Join Date: Aug 2003
Location: Wales
Posts: 68
rawdist RepRank 0
Default

The reason I start the page with "what does it cost?" Is that amazon web services wanted to include blogfuel in their monthly newsletter, but insisted I clarify my revenue sharing model. The "what does it cost" was inserted to satisfy them and will drop out of the front page in due time. Thanks for pointing out my assumption that the users will know all the amazon features, I will link the listmania reference to the help file.
I have also had experience of using php output in an iframe see example here:
http://www.rawdistribution.co.uk/pages/decks.html
The iframe is in the middle of the topcrud section at the bottom, but just my luck, the feed from affiliate window is down at the moment so there is not much to look at right now.
Reply With Quote
  #7 (permalink)  
Old 03-28-2004, 08:26 AM
WebProWorld Member
 

Join Date: Aug 2003
Location: Wales
Posts: 68
rawdist RepRank 0
Default

The feed is up again now here is an example of it in an iframe:
http://www.rawdistribution.co.uk/pages/trucks.html
Reply With Quote
  #8 (permalink)  
Old 04-22-2004, 02:26 AM
inkblot's Avatar
WebProWorld New Member
 

Join Date: Apr 2004
Location: Ottawa, ON
Posts: 21
inkblot RepRank 0
Default IFRAME-like for XHTML

If you want to make it make compiant with XHTML strict and still wanted to give it the IFRAME look you could have them use the CSS overflow property.

Code:
.myContent {
	overflow: auto;
	width: 200px;
	height: 300px;
}
Then the HTML to be included on the other site's would be:

if they can use PHP:
Code:
<div class="myContent">
    <?php include("http://yoursite.com/youfile.php"); ?>
</div>
Avoiding the PHP only issue
Code:
<div class="myContent">
    <script type="text/javascript" src="http://yoursite.com/yourscript.js"></script>
</div>
This javascript would have to output the content of the inner frame but it would not execute as PHP. This may not help at all... but I thought the alternative to IFRAME (which is not compliant) was pertanent.[/code]
__________________
Inkblot
D2 Digital Media
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0