I need any link that has a "a href=" tag when clicked to be received via curl. I can't hard code these links as they are from a dynamic site so could be anything. How would I achieve this?
Edit: Let me explain more. I have an app on my pc that uses a web front end. It catalogs files and gives yo options to rename delete etc. I want to add a public view however if I put it as is online then anyone can delete rename files. If I curl the pages I can remove the menu bars and editing options through the use of a different css. That part all works. The only part that isn't working is if I click on a link on the page it directs me back to the original link address and that defeats the point as the menu bars are back. I need it to curl the clicked links. Hope that makes more sense..
Here is my code that fetches the original link and curls that and changes the css to point to my own css. It points the java script to the original as I dont need to change that. I now need to make the "a href" links on the page when clicked be called by curl and not go to the original destination
<?php $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, 'http://192.168.0.14:8081/home/'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $curl_response = curl_exec($ch); curl_close($ch); //Change link url $link = $curl_response; $linkgo = '/sickbeard_public'; $linkfind = 'href="'; $linkreplace = 'href="' . $linkgo ; $link = str_replace($linkfind, $linkreplace, $link); //Change js url $js = $link; $jsgo = 'http://192.168.0.14:8081'; $jsfind = 'src="'; $jsreplace = 'src="' . $jsgo ; $js = str_replace($jsfind, $jsreplace, $js); //Fix on page link errors $alink = $js; $alinkgo = 'http://192.168.0.14:8081/'; $alinkfind = 'a href="/sickbeard_public/'; $alinkreplace = 'a href="' . $alinkgo ; $alink = str_replace($alinkfind, $alinkreplace, $alink); //Echo page back echo $alink; ?>