Announcements | Last Post | |
---|---|---|
SoC Curricula | 09/30/2017 01:08PM | |
Demarcation or scoping of examinations and assessment | 02/13/2017 07:59AM | |
School of Computing Short Learning Programmes | 11/24/2014 08:37AM | |
Unisa contact information | 07/28/2011 01:28PM |
Question regarding the practical October 18, 2012 08:16AM |
Registered: 11 years ago Posts: 62 Rating: 0 |
Re: Question regarding the practical October 18, 2012 08:17AM |
Registered: 11 years ago Posts: 78 Rating: 0 |
Anonymous User
Re: Question regarding the practical October 18, 2012 08:21AM |
Rating: 0 |
Re: Question regarding the practical October 18, 2012 08:22AM |
Registered: 11 years ago Posts: 62 Rating: 0 |
Re: Question regarding the practical October 18, 2012 08:24AM |
Registered: 11 years ago Posts: 78 Rating: 0 |
Anonymous User
Re: Question regarding the practical October 18, 2012 08:36AM |
Rating: 0 |
Re: Question regarding the practical October 18, 2012 09:29AM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 18, 2012 09:45AM |
Registered: 11 years ago Posts: 43 Rating: 0 |
Re: Question regarding the practical October 18, 2012 10:08AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Question regarding the practical October 18, 2012 10:19AM |
Registered: 11 years ago Posts: 78 Rating: 0 |
Re: Question regarding the practical October 18, 2012 11:22AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Language: PHPif form was submitted //do this and include any required html else //show form and include any required html
Anonymous User
Re: Question regarding the practical October 18, 2012 11:37AM |
Rating: 0 |
Re: Question regarding the practical October 18, 2012 12:08PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Anonymous User
Re: Question regarding the practical October 18, 2012 01:37PM |
Rating: 0 |
Re: Question regarding the practical October 19, 2012 11:00PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Anonymous User
Re: Question regarding the practical October 20, 2012 08:12AM |
Rating: 0 |
Re: Question regarding the practical October 20, 2012 10:40AM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 21, 2012 11:53AM |
Registered: 11 years ago Posts: 62 Rating: 0 |
Re: Question regarding the practical October 21, 2012 12:06PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 23, 2012 10:10AM |
Registered: 15 years ago Posts: 79 Rating: 0 |
Re: Question regarding the practical October 23, 2012 12:33PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 23, 2012 12:45PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 23, 2012 01:32PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Anonymous User
Re: Question regarding the practical October 23, 2012 01:46PM |
Rating: 0 |
Re: Question regarding the practical October 23, 2012 02:02PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 23, 2012 02:52PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Anonymous User
Re: Question regarding the practical October 23, 2012 04:12PM |
Rating: 0 |
Anonymous User
Re: Question regarding the practical October 23, 2012 04:29PM |
Rating: 0 |
Re: Question regarding the practical October 24, 2012 07:59AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Question regarding the practical October 24, 2012 07:13PM |
Registered: 11 years ago Posts: 29 Rating: 0 |
Language: PHP<?php $db_handle = mysql_connect("localhost", "root" , "") or die("Could not connect: " . mysql_error()); mysql_select_db(';registration';, $db_handle) or die(mysql_error()); switch ($_GET[';action';]) { case "add": switch ($_GET[';type';]) { case "course": $sql = "INSERT INTO course (course_name) VALUES (';" . $_POST[';course_name';] . "';)"; break; } break; } if (isset($sql) && !empty($sql)) { echo "<!--" . $sql . "-->"; $result = mysql_query($sql) or die("Invalid query: " . mysql_error()); ?>
Re: Question regarding the practical October 24, 2012 07:17PM |
Registered: 11 years ago Posts: 78 Rating: 0 |
Re: Question regarding the practical October 24, 2012 08:29PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Language: PHPif (isset($sql) && !empty($sql)) { echo "<!--" . $sql . "-->"; $result = mysql_query($sql) or die("Invalid query: " . mysql_error()); }
Re: Question regarding the practical October 25, 2012 08:01AM |
Registered: 11 years ago Posts: 99 Rating: 0 |
Re: Question regarding the practical October 25, 2012 08:40AM |
Registered: 11 years ago Posts: 29 Rating: 0 |
Anonymous User
Re: Question regarding the practical October 25, 2012 09:03AM |
Rating: 0 |
Language: PHP$id = $_GET[';id';]; $result=mysql_query("DELETE FROM table_name where id=$id"); echo "Deleted!"; ?>
Anonymous User
Re: Question regarding the practical October 25, 2012 09:09AM |
Rating: 0 |
Re: Question regarding the practical October 25, 2012 09:53AM |
Registered: 11 years ago Posts: 99 Rating: 0 |
Re: Question regarding the practical October 25, 2012 09:55AM |
Registered: 11 years ago Posts: 78 Rating: 0 |
Re: Question regarding the practical October 25, 2012 08:14PM |
Registered: 11 years ago Posts: 35 Rating: 0 |
Re: Question regarding the practical October 26, 2012 12:09PM |
Registered: 11 years ago Posts: 43 Rating: 0 |
Re: Question regarding the practical October 26, 2012 12:14PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Re: Question regarding the practical October 26, 2012 12:30PM |
Registered: 11 years ago Posts: 43 Rating: 0 |
Re: Question regarding the practical October 26, 2012 01:17PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Language: PHPif (preg_match(';/\\A(?:^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|(1[0-9])|(2[0-3]))\\:([0-5][0-9])((\\s)|(\\:([0-5][0-9])))?))?$)\\z/';, $date)) { // date is valid } else { // date is invalid }
Language: PHP<?php $date_format = ';Y-m-d';; $input = $_POST[';date';]';; // or where ever you get it from $input = trim($input); $time = strtotime($input); $is_date_valid = date($date_format, $time) == $input; print "Valid? ".($is_date_valid ? ';yes'; : ';no';); // this is like using an if/else, just another way ?>
Re: Question regarding the practical October 26, 2012 01:27PM |
Registered: 11 years ago Posts: 29 Rating: 0 |
Language: PHP<?php $db_handle = mysql_connect("localhost", "root" , "") or die("Could not connect: " . mysql_error()); mysql_select_db(';registration';, $db_handle) or die(mysql_error()); $coursesql="SELECT*FROM course"; $id = $_GET[';cid';]; $result=mysql_query("DELETE FROM course WHERE cid=$id"); echo "Deleted!"; ?> <p><a href="course.php">Delete another course</a> OR <a href="course_man.php">Back to course list</a></p>
Re: Question regarding the practical October 26, 2012 01:37PM |
Registered: 11 years ago Posts: 100 Rating: 0 |
Language: PHPfunction sanitise($reg_data){ $count = count($reg_data); for($i = 0; $i < $count; $i++){ $reg_data[$i] = strip_tags($reg_data[$i]); $reg_data[$i] = trim($reg_data[$i]); $reg_data[$i] = mysql_real_escape_string($reg_data[$i]); $reg_data[$i] = htmlspecialchars($reg_data[$i]); $reg_data[$i] = htmlentities($reg_data[$i]); if (get_magic_quotes_gpc()) { $reg_data[$i] = stripslashes($reg_data[$i]); } } return $reg_data; }
Re: Question regarding the practical October 26, 2012 01:55PM |
Registered: 11 years ago Posts: 43 Rating: 0 |
Re: Question regarding the practical October 26, 2012 02:02PM |
Registered: 11 years ago Posts: 43 Rating: 0 |
Language: PHP$result2 = mysql_query ("DELETE FROM course_student where cid = $id");
Re: Question regarding the practical October 26, 2012 02:06PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Question regarding the practical October 26, 2012 02:16PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Question regarding the practical October 26, 2012 02:32PM |
Registered: 11 years ago Posts: 100 Rating: 0 |