odpoa Posted March 4, 2009 Share Posted March 4, 2009 I am making a proxy. One major problem though is that the html links all refer to their original location. for example /watch?v=DS383_U goes to http://odpoa.com/watch?v=DS383_U when it should go to http://odpoa.com/BETAlab/compress/compress.php?site=http://youtube.com/watch?v=DS383_U Its hard to explain exatly what I am trying to do but I want all links in the html to go to http://odpoa.com/BETAlab/compress/compress.php?site={HOST SITE}/{LINK} so this way all links clicked will stay inside the proxy. Link to comment https://forums.phpfreaks.com/topic/147997-help-with-string-functions/ Share on other sites More sharing options...
dt192 Posted March 5, 2009 Share Posted March 5, 2009 why dont you just find all the links using preg_replace and match it to itself each time but add the http://odpoa.com/BETAlab/compress/compress.php?site= at the start, there are lots of examples of regex that find links on the PHP site look under preg_replace and there should be some stuff there explaining how to take the result and use it in the replace Link to comment https://forums.phpfreaks.com/topic/147997-help-with-string-functions/#findComment-776882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.