there problem show checked in checkbox on edit page. there code below:
ssc<input type="checkbox" name="ssc"class="form-control" value="ssc" <?php if(isset($ssc)) echo ($data[6] == 'ssc') ? 'checked':''; ?>/> hsc<input type="checkbox" name="hsc" class="form-control" value="hsc" <?php if(isset($hsc)) echo ($data[6] == 'hsc') ? 'checked':''; ?>/>
okay, lets go throw issues
mysqlfunctions deprecated- currently possible attacker can inject malicious sql because way pass variables
- beacuse
$datavariable containseducationcolumn - the value of checkbox sent if checked otherwise it's not set
- the
educatiocolumn can contain 3 value , none of them equals datasscssc hschsc
solutions:
- use
mysqlifunctions insteadmysql - use prepared statements , parameterized queries.
- don't check if column set if defined select query
- always check if checkbox value sent
issetor add hidden input same name , empty value above checkbox if box not checked value of hidden input sent - check if string contains "words" (
strpos($a, 'ssc') !== false- it's true when not false)
(and not use answer section give aditional data update question instead)
Comments
Post a Comment