Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CURL, Client URL Library Functions-  Problem with URL

Posted on 2006-11-30
3
Medium Priority
?
208 Views
Last Modified: 2008-03-17
I use simple CURL code:

in main.php page:
<?php
$c=curl_init();

curl_setopt ($c, CURLOPT_URL, "loadsite.php");
curl_setopt ($c, CURLOPT_REFERER, "referersite");
curl_exec ($c);
curl_close ($c);

?>

When the loadsite.php uses CSS defined in an extern file ( <link rel=StyleSheet href="css/style.css" type="text/css" media=screen>
), then the extern file is not loaded because the URL of the page in the browser is main.php and NOT loadsite.php.

How can I solve this problem?
0
Comment
Question by:jodavid
[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
3 Comments
 
LVL 13

Accepted Solution

by:
rhickmott earned 1000 total points
ID: 18044380
You could always use an preg_replace to replace all links with their full alternatives ie http://<site>/page.css

CURL will only pull one page at a time the only way you would be able to do it is rewrite the urld to css and images so they point at the ones on the original location or search for CSS links and then issue a seprate CURL to pull the style sheet and insert the source of that stylesheet inline into the page.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

705 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