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 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 25, 2012 01:15PM |
Registered: 12 years ago Posts: 31 Rating: 0 |
Language: PHP<?php $coursesql = "SELECT * FROM course"; $courseresult = mysql_query($coursesql) or die ("Invalid query: " . mysql_error()); while ($row = mysql_fetch_array($courseresult)) { $cid = $row[';cid';]; $cname = $row[';cname';]; $checked = ""; $comparesql = "SELECT cid FROM course_student WHERE sno = ';" . $_GET[';id';] . "';"; $compareresult = mysql_query($comparesql) or die ("Invalid query: " . mysql_error()); while ($row2 = mysql_fetch_array($compareresult)) { $cidcompare = $row2[';cid';]; if ($cid == $cidcompare) { $checked = "checked"; } } ?> <input type = ';checkbox'; name =';courseselect[]'; value ="<?php echo $cid; ?>" onclick="setItems(this)" <?php echo $checked; ?>/> <?php echo $cname; ?> <br/> <?php $checked = ""; } ?>
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 25, 2012 04:36PM |
Registered: 12 years ago Posts: 116 Rating: 0 |
in my own case.Language: PHParray_push() in_array()
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 26, 2012 06:43AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 26, 2012 09:32AM |
Registered: 12 years ago Posts: 31 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 26, 2012 10:48AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 26, 2012 11:05AM |
Registered: 12 years ago Posts: 31 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 26, 2012 01:22PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 30, 2012 01:27AM |
Registered: 12 years ago Posts: 36 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes April 30, 2012 01:43PM |
Registered: 12 years ago Posts: 77 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 02, 2012 08:01AM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 03, 2012 10:29PM |
Registered: 12 years ago Posts: 36 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 04, 2012 12:12PM |
Registered: 12 years ago Posts: 77 Rating: 0 |
Language: PHPRewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^index/([^/\.]+).html/?$ index.php?module=index&controller=index$action=$1 [L] RewriteRule ^([^/\.]+).html/?$ index.php?module=index&controller=index$action=$1 [L] RewriteRule ^index/([^/\.]+).html/?$ index.php?module=index&controller=index$action=$1 [L] RewriteRule ^([^/\.]+).html/?$ index.php?module=$1 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?module=$1&controller=$2 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?module=$1&controller=$2&action=$3 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+).html/?$ index.php?module=$1&controller=$2&action=$3 [L] RewriteRule ^.*$ index.php [NC,L]
Language: PHP//Use DS to separate the directories in other defines if (!defined(';DS';)) { define(';DS';, DIRECTORY_SEPARATOR); } //The full path to the directory which holds "app", WITHOUT a trailing DS if (!defined(';ROOT';)) { define(';ROOT';, dirname(__FILE__)); } //Controls whether to display errors or not define(';DEVELOPMENT_ENVIRONMENT';, true); if (!defined(';CORE_INCLUDE_PATH';)) { define(';CORE_INCLUDE_PATH';, dirname(__FILE__)); } //Call the bootstrap file require (CORE_INCLUDE_PATH . DS . ';bootstrap.php';);
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 04, 2012 12:35PM |
Registered: 12 years ago Posts: 96 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 04, 2012 04:33PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 07, 2012 11:50AM |
Registered: 12 years ago Posts: 77 Rating: 0 |
Language: PHP#set include path $path = array(ROOT . DS . ';model'; . DS, CORE_INCLUDE_PATH . DS . ';classes'; . DS, CORE_INCLUDE_PATH . DS); set_include_path(get_include_path() . PATH_SEPARATOR . implode(PATH_SEPARATOR, $path));
Language: PHP/** Autoload any classes that are required */ function __autoload($className) { try{ if (file_exists(CORE_INCLUDE_PATH . DS . "classes" . DS . "{$className}.php") || file_exists(CORE_INCLUDE_PATH . DS . "{$className}.php") || file_exists(CORE_INCLUDE_PATH . DS . "model" . DS . "{$className}.php")) { require_once "{$className}.php"; } } }
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 07, 2012 12:26PM |
Registered: 12 years ago Posts: 96 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 07, 2012 03:49PM |
Registered: 12 years ago Posts: 77 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 09, 2012 11:13AM |
Registered: 12 years ago Posts: 77 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 09, 2012 12:28PM |
Registered: 12 years ago Posts: 31 Rating: 0 |
Language: PHP$dob = $_POST[';bod_year';] . "-" . $_POST[';bod_month';] . "-" . $_POST[';bod_day';];
Language: PHP$birthday = explode("-", $dob); $byear = $birthday[0]; $bmonth = $birthday[1]; $bday = $birthday[2];
Language: PHP<select name="bod_day"> <option value="" selected>Select a day...</option> <?php for ($day=1; $day<=31; $day++) { if ($day == $bday) { $dselected = " selected"; } else { $dselected = ""; } if ($day<10) { $day = "0" . $day; } ?> <option value="<?php echo $day; ?>"<?php echo $dselected; ?>><?php echo $day; ?></option> <?php } ?> </select>
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 09, 2012 03:02PM |
Registered: 12 years ago Posts: 77 Rating: 0 |
>Language: PHP> $dob = $_POST[';bod_year';] . "-" . > $_POST[';bod_month';] . "-" . $_POST[';bod_day';]; >
>Language: PHP> $birthday = explode("-", $dob); > $byear = $birthday[0]; > $bmonth = $birthday[1]; > $bday = $birthday[2]; >
>Language: PHP> <select name="bod_day"> > <option value="" selected>Select a > day...</option> > <?php > > for ($day=1; $day<=31; $day++) { > > if ($day == $bday) { > $dselected = " selected"; > } else { > $dselected = ""; > } > > if ($day<10) { > $day = "0" . $day; > } > ?> > <option value="<?php echo > $day; ?>"<?php echo $dselected; ?>><?php echo > $day; ?></option> > <?php } ?> > </select> >
Language: PHP($day<10) ? $day = "0" . $day : "";
Language: PHP$dob = explode("/", $students->dob);
Language: HTML<select name="day"> <option value="0" echo ($dob[0] == "0") ? " selected" : "";>Select Day</option> for ($x=1;$x<=31;$x++): <option echo ($dob[0] == $x) ? " selected":"";>echo $x;</option> endforeach; </select> But anyway thanks man
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 09, 2012 03:25PM |
Registered: 12 years ago Posts: 31 Rating: 0 |
Re: PHP Four - Working with HTML Forms - PHP and HTML Checkboxes May 10, 2012 03:08PM |
Registered: 12 years ago Posts: 77 Rating: 0 |
Language: PHP#Check for Magic Quotes and remove them * */ function stripSlashesDeep($value) { $value = is_array($value) ? array_map(';stripSlashesDeep';, $value) : stripslashes($value); return $value; } function removeMagicQuotes() { if (get_magic_quotes_gpc()) { $_GET = stripSlashesDeep($_GET); $_POST = stripSlashesDeep($_POST); $_COOKIE = stripSlashesDeep($_COOKIE); } } #Check register globals and remove them function unregisterGlobals() { if (ini_get(';register_globals';)) { $array = array(';_SESSION';, ';_POST';, ';_GET';, ';_COOKIE';, ';_REQUEST';, ';_SERVER';, ';_ENV';, ';_FILES';); foreach ($array as $value) { foreach ($GLOBALS[$value] as $key => $var) { if ($var === $GLOBALS[$key]) { unset($GLOBALS[$key]); } } } } }
Language: PHPremoveMagicQuotes(); unregisterGlobals();