iversonm Posted November 5, 2008 Share Posted November 5, 2008 i read previously about user submitted data on phpfreaks in a random topic awhile back and it was just about validating all submitted data. they said use magic_quotes???? not sure what is the best function(s) to use to check user submitted data incase the data should just be numbers or alpha numeric or whatever you can think of Link to comment https://forums.phpfreaks.com/topic/131540-submitted-data/ Share on other sites More sharing options...
Yesideez Posted November 5, 2008 Share Posted November 5, 2008 I use addslashes() when using data in a MySQL query and never use the variables directly within calls, eg. I never do this: mysql_query("SELECT data FROM table WHERE `field`='$mydata'"); But I do this instead: mysql_query("SELECT data FROM table WHERE `field`='".$mydata."'"); Depending on what the data field is, I might add this: mysql_query("SELECT data FROM table WHERE `field`='".addslashes($mydata)."'"); Link to comment https://forums.phpfreaks.com/topic/131540-submitted-data/#findComment-683195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.