Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for 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
2 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.