Take links from a form
Posted: Fri Jul 02, 2010 2:22 pm
Hello. I have a form in my website where people will put their html code. What I want to do is to be able to take all the links in that html and swap them with something else. So that would be 2 processes, first get all the links and then swap them. For example
If i submit:
That would become
If i submit:
Code: Select all
<html>
Hello <br />
<a href="http://www.google.com" > Google</a>
<a href="http://www.yahoo.com" > Yahoo</a>
</html>
That would become
Code: Select all
<html>
Hello <br />
<a href="http://www.link_1" > Google</a>
<a href="http://www.link_2" > Yahoo</a>
</html>