Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Include and Images(addressing)

Posted on 2003-11-22
2
Medium Priority
?
204 Views
Last Modified: 2013-11-18
Im having trouble with the include method and images (their addressing)

i.e If I include ("http://www.google.com"); at abc.com I'll get everything ok except for the logo, because the logo address goes from: http://www.google.com.au/intl/en_au/images/logo.gif to: http://www.abc.com/images/logo.gif 

I need it so when I include a file it includes the correct addresses, not the addressing in the html...

Is there a way to do this?
0
Comment
Question by:fairon
[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
  • 2
2 Comments
 
LVL 6

Expert Comment

by:mattjp88
ID: 9804747
well here is a way to include the googe homepage and have the logo show up:

<?php
function callback($buffer) {

// replace all the apples with oranges
  return (ereg_replace("<img src=\"/images/logo.gif\" width=276 height=110 alt=\"Google\">", "<img src=\"http://www.google.com/images/logo.gif\" width=276 height=110 alt=\"Google\">", $buffer));

}

ob_start("callback");

include "http://www.google.com/webhp?tab=iw&q=&ie=UTF-8&oe=UTF-8&hl=en";

ob_end_flush();
?>

You basicly have to go through every link and do the replace function.

-Matt
0
 
LVL 6

Accepted Solution

by:
mattjp88 earned 2000 total points
ID: 9804756
Wait, I found and easier way, here is an example:

echo "<base href=\"http://www.google.com/\">";

include "http://www.google.com/webhp?tab=iw&q=&ie=UTF-8&oe=UTF-8&hl=en";

just echo <base href=\"http://www.google.com/\"> before you include to tell the file where the links and images should point to.  

-Matt
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

610 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