I want to have an option to put up an image if $level >= 7.
How can I do that without giving them complete HTML control?
if ($level > 7) {
print ("<img src=\"image.jpg\" />");
}
Like that you mean? Else explain more what you want...
Its a message board, and I want it, if they are over lvl 7 then they can put up whatever image they want.
To allow them to UPLOAD any image they want? CHOOSE any image they want?
// show the form to allow them to upload an image
} else {
// don't show the form
Not upload. Normal users cant use HTML (other than <b> and <i>) but when they reach level 7 I want them to be able to use <img src='theirsite.com/pic.jpg'>
But I only want them to use <img>
Use regular expressions or some string matching to see if it matches the pattern or not.
www.php.net/eregi www.php.net/ereg www.php.net/preg_match
www.php.net/stristr www.php.net/strpos
I can never understand preg_replace. Can someone give a basic code snippet or something?
if ($level > 7) { $html = $row["html"]; } else { $html = strip_tags ($row["html"], "<i><b>"); }