Jump to content

Help with string functions


odpoa

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.