I want to display images based on what user checked from number of checkboxs. I'm trying this code, but it not working <!Doctype html> <html><body> <form method="post" action="" id="myForm"> <div class="opt-first"> <h1><b>Subject</b></h1> <input type="checkbox" value="Account/Finance" name="subject[]" /> Account/Finance<br /> <input type="checkbox" value="Marketing" name="subject[]" /> Marketing<br /> <input type="checkbox" value="" name="subject[]" /> Other </div> <div class="opt"> <h1><b>Type</b></h1> <input type="checkbox" value="Exam" name="Type[]" /> Exam<br /> <input type="checkbox" value="Project" name="Type[]" /> Project<br /> <input type="checkbox" value="Assignment" name="Type[]" /> Assignment </div> <div > <h1><b>Tasks</b></h1> <input type="checkbox" value="Report" name="Task[]" /> Report<br /> <input type="checkbox" value="Presentation" name="Task[]" /> Presentation<br /> <input type="checkbox" value="Assay" name="Task[]" /> Assay<br …

Member Avatar
Member Avatar
+0 forum 1

this code will display all courses user has <h1>YOUR COURSES</h1> <form action="delete.php" method="POST"><ol> <?php $con=mysqli_connect("localhost","FYP","123","FYP"); $sql= mysqli_query($con, "SELECT C_Code FROM F_COURSES WHERE F_ID=".$_SESSION['userid']); while($row = mysqli_fetch_array($sql)){ echo "<li name='course'>".$row['C_Code']."<input type='submit' value='Delete'>";} ?></ol></form> I need when user click on delete button that course delete from F_courses <?php session_start(); if (! empty($_SESSION['logged_in'])) { $con=mysqli_connect("localhost","FYP","123","FYP"); $id=$_SESSION['userid']; $course=$_POST["course"]; $sql="DELETE FROM F_COURSES WHERE F_ID='$id' AND C_Code='$course'"; mysqli_query($con,$sql); header ("location: mycourses.php"); } else { echo 'You are not logged in. <a href="login.html">Click here</a> to log in.'; } Could you please help me how to correct my code Thank you

Member Avatar
Member Avatar
+0 forum 1

I'm trying to addrow onclick button, and I need that new row would have the diffrent ids for "keyword" and "chapter" so I can pass the values of these two field in CLO(key, chap) I can only call the CLO() function in orginal row I need to be able to call it in added row and get that row keyword and chapter this my code, could you please help me with the code .thank you <html><head> <script> function addRow(tableID){ var table=document.getElementById(tableID); var rowCount=table.rows.length; var row=table.insertRow(rowCount); var colCount=table.rows[1].cells.length; var cell1=row.insertCell(0); cell1.innerHTML= rowCount+1; for(var i=0;i<colCount;i++){ var newcell=row.insertCell(i+1); newcell.innerHTML=table.rows[1].cells[i+1].innerHTML; }} function CLO() { …

Member Avatar
Member Avatar
+0 forum 3

I'm trying to determine the value of $level based on the keyword user provide using If statement but whatever was the user entry the value of $level always giving as 1 this is my code I need your help to find the error <?php $q1 = $_GET['q1']; $con = mysqli_connect("localhost","FYP","123","FYP"); if (!$con) { die('Could not connect: ' . mysqli_error($con));} mysqli_select_db($con,"ajax_demo"); if ($q1=="Cite"||"Define"||"Enumerate"||"Index"||"Indicate"){ $level=1;} elseif($q1=="Add"||"Approximate"||"Articulate"||"Associate") { $level=2; } elseif($q1=="Acquire"||"Adapt"||"Allocate"||"Alphabetize") { $level=3; } elseif($q1=="Analyze"||"Analyse"||"Audit"||"Blueprint"||"Breadboard" ) { $level=4; } elseif($q1=="Abstract"||"Animate"||"Arrange"||"Assemble" ) { $level=5; } elseif($q1=="Appraise"||"Assess"||"Conclude"||"Counsel") { $level=6; } else{$level=0;} echo $level; ?>

Member Avatar
Member Avatar
+0 forum 2

I have this code to add row to my table function addRow(tableID){ var table=document.getElementById(tableID); var rowCount=table.rows.length; var row=table.insertRow(rowCount); var colCount=table.rows[0].cells.length; var cell1=row.insertCell(0); cell1.innerHTML= rowCount+1; for(var i=0;i<colCount;i++){ var newcell=row.insertCell(i+1); newcell.innerHTML=table.rows[0].cells[i+1].innerHTML; }} and this for AJAX function function CLO() { var a=document.getElementById("keyword").value; var b=document.getElementById("chapter").value; if (a == ""&& b == "") { document.getElementById("CLO").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("CLO").innerHTML = …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to do something like this $level=0; if($a=="x"){ $level=1; } Else{ $level=2;} How I can use the new value of $level outside the scope of IF Statement

Member Avatar
Member Avatar
+0 forum 1

I have images generated by while loop php based on how many course user have when user press on one of those images it will send him to that course page but all images send to one course page this my php code in** home page ** <?php $con=mysqli_connect("localhost","FYP","123","FYP"); $sql= mysqli_query($con, "SELECT C_Code FROM F_COURSES WHERE F_ID=".$_SESSION['userid']); while($row = mysqli_fetch_array($sql)){ echo " <a href='course.php'><div class='cc' id='tres'><img class='icon' src='bookicon1.png'><p class='pra'>".$row['C_Code']."</p></div></a>&nbsp;"; $C_Code = $row['C_Code']; $_SESSION['course'] = $C_Code;} ?> and this code for **course page ** this is <?php echo $_SESSION['course']; ?> course. I hope my question make sense and I appreciate your …

Member Avatar
Member Avatar
+0 forum 3

I'm trying to create a webpage to help teacher determine CLO and PLO for exam questions First user will type the keyword in text box and select the chapter CLO() function will start the AJAX the result should be a CLO Number in CLO column and PLO options in PLO column. it is my first time using AJAX so I'm not should what is wrong this is my code **HTML Page** <! Doctype html> <head> <script>function CLO() { var a=document.getElementById("keyword").value; var b=document.getElementById("chapter").value; if (a == ""&& b == "") { document.getElementById("CLO").innerHTML = ""; document.getElementById("PLO").innerHTML = ""; return; } else { …

Member Avatar
Member Avatar
+0 forum 1

The End.