I am making a forum using the software vb, exactly like this place. I am also designing a hack for it, and this hack needs to have the urls encoded in order to make sure no one cheats the system. Now, i thought i was doing a good job with setting up a parser for the template system. It just goes through the whole template and picks out all the <a href= and replaces it with <a href=target.php?elink=$code&blabla... My test script did a great job and i thought i was in the clear but not surprising it didnt work with the board. Through my testings i found out that it wont work with html...which is kinda weird and im am at a loss with what to do. Below is my code that im using. Be gentle, im still a n00b at all this stuff:
$newtext = "<center>
<table border=0 width=40% height=100%><tr><td bgcolor=#000099 height=1>
HEY YOU!!!
</td></tr>
<tr><td>
What are you doing? Where are you going? Let me see that ID Card!
What? You dont have one?!? You left it in your other pants?? Whats your name? ... ok ... mmm ... Looks like your not on my list! What do you want to do about that?<br><br>
<a href=rpgregister.php?action=register&step=1&userid=$bbuserinfo[userid]>Um...can I register with you sir?</a>
</table>
</center>
<br>";
preg_match_all("/(<([a]+)[^>]*>)(.*)(<\/\\2>)/", $newtext, $matches);
for ($i=0; $i< count($matches[0]); $i++) {
$matches[1][$i] = str_replace("<a href=","",$matches[1][$i]);
$matches[1][$i] = str_replace(">","",$matches[1][$i]);
$elink = md5($matches[1][$i].$rpgpassword);
$newtext = str_replace("<a href=".$matches[1][$i].">","<a href=".$matches[1][$i]."&elink=".$elink.">",$text);
}
echo $newtext;
exit;
the var $rpgpassword you can change to whatever you want but the whole idea is to go through the page, find the link code, add the security check and put the page up.
Put a fork in me im done.