Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-17-2009, 02:53 PM   PM User | #1
Tynan
Regular Coder

 
Join Date: Oct 2004
Location: London E4 UK
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Tynan is an unknown quantity at this point
Importing/incorporating code from an external web page?

Hello

Basic php/html/mysql skills here

I do code for a website, they have sold a page to an advertiser that needs to show material from a daily html newsletter, I initially said it would work on the basis that anyone doing a complex html newsletter daily would be able to also produce a block of code that could act as an include

It now turns out that all the advertiser is able to provide is the html email itself.

I'm still squinting at this project from a long way off but I'd be grateful for a rough idea of how this would be tackled.

The html email has the usual 'email not displaying properly?' so there is a webpage for each newsletter, it uses relative links for the css and images

Is it as simple as my webpage reading their code from their website, and then some manipulation to make their links absolute paths and top and tail out their headers and footer so it can appear within my headers and footers? That said how would I load up actual code from someone else's web page?

Can anyone see problems ahead or suggest any handy dos and don'ts?

Many thanks
Tynan

Last edited by Tynan; 03-17-2009 at 03:19 PM.. Reason: awful thread title
Tynan is offline   Reply With Quote
Old 03-17-2009, 03:17 PM   PM User | #2
Tynan
Regular Coder

 
Join Date: Oct 2004
Location: London E4 UK
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Tynan is an unknown quantity at this point
googled this, look ok?
................
PHP Code:
<?php
$handle 
fopen ("http://www.example.com/""rb");
$contents "";
do {
$data fread($handle8192);
if (
strlen($data) == 0) {
break;
}
$contents .= $data;
} while(
true);
fclose ($handle);
?>
I haven't tested those but from what I saw, $content will be the exact source of the index file in example.com (parts that is shown to the world of course - not the serverside scripts)

so now we can look for some pattern in $content
.............
Tynan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:00 PM.


Advertisement
Log in to turn off these ads.