Page 1 of 1

path modification problem

Posted: Tue Jun 27, 2006 3:27 am
by itsmani1
here is a page url :

localhost/sitemap.htm

i want to fetch its its html and wanted to display its html at

localhsot/site_edit/open.php

but i don't want to loos my links, and images, i wanted all the image and css should work fine.


Please help me. what happens is : i can't see the image as the path shows something like : localhost/site_edit/images/spacer.gif it should be localhost/images/spacer.gif so that i can see the correct image.

I am doing like this:

Code: Select all

if(isset($_GET['log']))
		{
			$tmp = $_GET['log'];
			$tmp = str_replace("..//","../",$tmp);
			$contents = fopen("../www/$tmp","r");
			
			while (!feof($contents))
			{
				$read = fread($contents,999999);
			}
			
			fclose($contents);
		}
it opens correct file and work fine but i dont 's how the correct paths.
then I tried :

Code: Select all

$read = str_replace("src=\"","src=\"../",$read);
but its not work? please help me

thanks.

Posted: Tue Jun 27, 2006 4:09 am
by itsmani1
Problem is solved by removing

"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> " from my web pages, now there is one more problem.

i tried

Code: Select all

str_replace("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">"," ","<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> sdf asdf asdf")
but its not working

Posted: Tue Jun 27, 2006 6:41 am
by JayBird
itsmani1 wrote:Problem is solved by removing

"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> " from my web pages, now there is one more problem.

i tried

Code: Select all

str_replace("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">"," ","<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> sdf asdf asdf")
but its not working
Hmmm, i wonder why...maybe try escaping your double quotes.

The syntax highlighter kinda gave it away dont ya think!?