Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Curl - Absolute Path Problem. Require Help

 
   Database Help (Home) -> PHP RSS
Next:  Blank line at beginning of XML Doc  
Author Message
Maanav Jackson

External


Since: Aug 09, 2008
Posts: 1



(Msg. 1) Posted: Sat Aug 09, 2008 1:36 am
Post subject: Curl - Absolute Path Problem. Require Help
Archived from groups: comp>lang>php (more info?)

Hi

I am displaying a third party webpage into a variable using curl
library. When i am displaying the variable in the browser using echo
command as shown below.

echo $pagecopy;

Browser is not displaying the page as it display when we visit the
page directly in browser. Instead it references all the file path,
css path, form action path to http://localhost/filenamepath OR CSS
Path or FormAction Path instead of www.xyz.com/filepath (eg,
http://www.xyz.com/books/1stGoodBook.html).

So in the browser all the css, images is not displaying properly.
since relative path is referenced to local host (http://localhost/)
instead of website domain direct path (eg. http://otherwebsite.com/).

How to rectify this problem so that it is referenced to absolute path
instead of relative path and all the css, files, webpages works
properly.

Regards
Maanav Jackson

 >> Stay informed about: Curl - Absolute Path Problem. Require Help 
Back to top
Login to vote
Sjoerd

External


Since: May 21, 2007
Posts: 34



(Msg. 2) Posted: Sat Aug 09, 2008 11:47 am
Post subject: Re: Curl - Absolute Path Problem. Require Help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 9, 10:36 am, Maanav Jackson wrote:
> I am displaying a third party webpage into a variable using curl
> library.
> [...] it references all the  file path,
> css path, form action path tohttp://localhost/filenamepathOR CSS
> Path or FormAction Path instead ofwww.xyz.com/filepath

Do you have permission from the third party to use his website?
Otherwise it may be unethical, even illegal, to show his page on your
site.

Having said that, the problem is with the HTML. If the HTML references
a file like so:
<img src="foo.jpg" alt="Picture of a Foo" />
Then the browser requests that file from the same server and the same
directory as the referencing page. So if this page is at http://www.example..com/bar/,
the image should be at http://www.example.com/bar/foo.jpg.

No need for concern, all you need to do is rewrite all file
references, such as those in image tags, or download all referenced
files to your own server.

Provided you have the approval of the site owner, off course.

 >> Stay informed about: Curl - Absolute Path Problem. Require Help 
Back to top
Login to vote
nadia

External


Since: Jul 15, 2008
Posts: 8



(Msg. 3) Posted: Sat Aug 09, 2008 8:27 pm
Post subject: Re: Curl - Absolute Path Problem. Require Help [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
Display posts from previous:   
Related Topics:
getting absolute directory path? - Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are used in multiple files, I have php files under /..

posting with cURL problem - Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't curl_setopt($curl, CURLOPT_POSTFIELDS, array('clown'=>'b...

curl timeout problem - Hi, I'm having a problem with the cURL library. It doesn't seem to obey the 'timeout' parameters. I set the CURLOPT_CONNECTTIMEOUT to, say, 1 second, and CURLOPT_TIMEOUT to whatever value. Then I'm fetching (via a GET request) some page from a..

root path problem - Hi, can anyone quickly solve this little problem please? I need to reference my $phpbb_root_path but none of the examples offered work because I'm using a subdomain. My phpbb is at root level, e.g. mydomain.com/ and the page I want to execute a call from...

include file path problem - Hello, I built a development version of a live website on my hosted account. However the development version is having problems with finding include files. After troubleshooting I was able to resolve the issue by removing the ../ from the beginning of..
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]