8
I’m trying to change some fields of a site, what I want is to open this site at my address, only with some of its contents changed.
I’m using the file_get_contents
to open the site, but I face two problems:
- when I click on a link within the site, it is redirected to Original URL.
- I can’t make a perfect clone, because the site has a lot
content within your . js and css that are accessed internally,
example:
background: url(.../.../s/images/ui/2011/cards-bg-RN.png) 0 1px no-repeat;
what searches the root of the original website.
I wanted to know if there is a way to use Curl or another variable to open the site and manipulate certain fields, without having to save all the files. css and . js of the site.
ps; I’ve been studying PHP for 3 months, and this is a project to present in my course, but I’ve tried every way I know and can’t do it properly, using a Regex.
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: en\r\n" .
"Cookie: foo=bar\r\n"
)
);
$context = stream_context_create($opts);
;
$file = file_get_contents('https://urldosite.com/', false, $context);
echo $file
Okay, I made the page open, but it opens wrong because it searches the . css inside my server, not on the source server. My main question is this: could I use file_get or Curl to open the site without it searching the . css and . js on my server? like it was a frame? Manipulate the content of the site I can try to turn myself alone!
Put in your question the code you’ve already made.
– André Ribeiro
I put my friend there.
– Cassiano José
What the Ultimate goal, for which you want to do this, can explain the flow briefly, so you may have an alternative solution. which purpose of this navigation
– Isvaldo Fernandes
Just modify the final content of the original website, change fields, for a sample project.
– Cassiano José