473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Curl - Absolute Path Problem. Require Help

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
ma***********@gmail.com
Aug 9 '08 #1
1 2937
On Aug 9, 10:36*am, Maanav Jackson <maanavjack...@gmail.comwrote:
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.
Aug 9 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: machodev | last post by:
Hello Friends, Getting a bit fuzzy on the Authorize.net and the Curl Integration. I have the script using the for the authorize.net Integration with the curl command exec("/usr/local/bin -m...
1
by: Haluk Durmus | last post by:
Hello I checked out openssl,mm,apr,apr-util,apache 2,curl,libxml and php from cvs. php couse an ERROR I did the following steps:
0
by: Ville Mattila | last post by:
Hello readers, I'm trying to install the latest PHP4 version from the scratch. The configure string is following: ../configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl...
3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
6
by: Jon Slaughter | last post by:
do I have to prefix every absolute path with document root to get it to work? For some reason I thought that prefixing a path with '/' or './' with make it absolute w.r.t to document root but I...
3
by: k.rollman | last post by:
I am having a problem using cURL to create an https connection on a non-standard port (440). Using curl_setopt to set the port to 440 has no effect, and I get the following from curl's verbose...
1
by: stillnight | last post by:
My web host has disabled fopen and now uses curl. I am a newbie to php so I am at a complete loss. I am trying to change the code in sendcard at sendcard.org to use curl. The beginning login will...
3
by: Sarah | last post by:
I was wondering if someone might be able to help me with this issue. I have a feeling this has something to do with my host's server settings as I used to be able to get CURL to follow redirects by...
3
by: buzz2050 | last post by:
Hi all, I am using cURL for the first time. I need to login to a site and my cURL code to do the same is as follows: //curlScript.php <?php function getContent($url, $referer,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.