I meant slashes not flashes lol my bad
and also sorry I didn't update the original post, I changed them like right after I posted this, those were just my originals:
if( preg_match( "#[^A-Za-z0-9_ -]#", $name) ) {die('Bad name.');}else if (strlen($name ) > 20) {die('Your name is too long.'); }
if( preg_match( "#[^A-Za-z0-9_-]#", $youtube) ) {die('Bad youtube.');}else if (strlen($youtube ) > 15) {die('Your youtube is too long.'); }
if( preg_match( "#['<>^$\"]#", $image_raw) ) {die('Bad image URL detected.');}else if (strlen($image_raw ) > 145) {die('Your image is too long.'); }
if( preg_match( "#['<>^$\"]#", $ava_raw) ) {die('Bad avatar URL detected.');}else if (strlen($ava_raw ) > 145) {die('Your avatar is too long.'); }
if (strlen($post_raw ) < 3) {die('No post found or post too short.'); }else if (strlen($post_raw ) > 2000) {die('Your post is too long.'); }
$post = htmlspecialchars($post_raw, ENT_QUOTES);
PHP Code:
if( preg_match( "#[^A-Za-z0-9_ -]#", $name) ) {die('Bad name.');}else if (strlen($name ) > 20) {die('Your name is too long.'); }
if( preg_match( "#[^A-Za-z0-9_-]#", $youtube) ) {die('Bad youtube.');}else if (strlen($youtube ) > 15) {die('Your youtube is too long.'); }
if( preg_match( "#['<>^$\"]#", $image_raw) ) {die('Bad image URL detected.');}else if (strlen($image_raw ) > 145) {die('Your image is too long.'); }
if( preg_match( "#['<>^$\"]#", $ava_raw) ) {die('Bad avatar URL detected.');}else if (strlen($ava_raw ) > 145) {die('Your avatar is too long.'); }
if (strlen($post_raw ) < 3) {die('No post found or post too short.'); }else if (strlen($post_raw ) > 2000) {die('Your post is too long.'); }
$post = htmlspecialchars($post_raw, ENT_QUOTES);
php brackets make them look ugly??
also sorry, but I have no idea what you're talking about in your post, can you show an example? I looked around for your base64 I am confused
anyway, to my knowledge I block out all of the bad characters that could cause problems I think?
also, the empty fields are handled elsewhere when the database is queried, but there are default print outs for blank entries
thanks for your help, I just wanted to make sure it was pretty secure, I don't really have anything on my servers this has access to that I'd care if it got hacked/stolen or whatever, I just like to learn how to make it secure