Jump to content

Dynamic Operator


ahouchens

Recommended Posts

ahouchens, if you believe you can trust admins, then thats up to you, but they can still modify input on a select statement or any kind of input for that matter. It would be a simple check for you to do this:

 

if (!preg_match("@^[+=*/-]$@", $_POST['input']) {

  die("Possible SQL Injection");

}

Link to comment
https://forums.phpfreaks.com/topic/177962-dynamic-operator/#findComment-938329
Share on other sites

Regardless, you should validate the operator in your PHP script before actually injecting it right into your SQL statement.  It's possible to change a select box's options' value fairly easily.  If you dont validate, its possibly for anybody who happens to gain access to the admin area (illegally or not) to inject SQL.

Link to comment
https://forums.phpfreaks.com/topic/177962-dynamic-operator/#findComment-938330
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.