User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
when i try adding a new row of the 'syllabus' table it works fine but when i try to update that same table, the table is not updated. Instead it is redirected to a blank page.I've used this same idea in adding and updating various other tables.Adding is fine but in case of updating its the same story.
phprequire('filehandler.php');//file handlerrequire('adminDB/sql_connect.php');//password cleanfunction clean($string){
$string = str_replace(" ","", $string);//Deletes the spaces.
$string = preg_replace('/[^A-Za-z0-9\-]/','', $string);//Removes special chars.return preg_replace('/-+/','', $string);//Replaces multiple hyphens with single one.}function sqli($string){
$string = str_replace(";","",$string);
$string = str_replace("OR","",$string);
$string = str_replace("SELECT","",$string);
$string = str_replace("FROM","",$string);
$string = str_replace("DELETE","",$string);
$string = str_replace("TRUNCATE","",$string);
$string = str_replace("OR 1","",$string);
$string = str_replace("UPDATE","",$string);return $string;}
$_POST = sqli($_POST);if(($_POST['add']=="SUBMIT")||($_POST['addpic']=="UPLOAD")){switch($_POST['data']){case'syllabus':if($_SESSION['auth']=="special"){if(($_POST['syllabusReg']!="")&&($_FILES['syllabusLink']['name']!="")){//call to file handler for DOC
$link=fileHandler($_FILES['syllabusLink'],"doc");if($link!="1"){
$sql="INSERT INTO cse.syllabus (syllabus_reg,syllabus_link)
VALUES ('".$_POST['syllabusReg']."','".$link."');";}}}else{header('Location:../home.php');exit;}
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that
you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice
sessions to improve your knowledge and scores.
manpreet
Best Answer
3 years ago
when i try adding a new row of the 'syllabus' table it works fine but when i try to update that same table, the table is not updated. Instead it is redirected to a blank page.I've used this same idea in adding and updating various other tables.Adding is fine but in case of updating its the same story.