User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,509 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,163 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 279 | Replies: 4 | Solved
Reply
Join Date: Jul 2008
Location: Utah
Posts: 9
Reputation: eagled2 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
eagled2's Avatar
eagled2 eagled2 is offline Offline
Newbie Poster

help with Checkbox value in mysql

  #1  
Jul 19th, 2008
I'm new to php and am working on my first large scale project. I am making a custom ticketing system that requires users to login and let's technicians login to work tickets. I am trying to implement a account disabling feature so tech's that are no longer with the company don't have to have there accounts deleted when they are gone for a time. I want admins to be able to edit the users profile and use a checkbox to mark the account as disabled I have a table called profiles with the username and profile information. I have added a tinyint field called "disabled" with a 1 char limit.

I have successfully programmed my login script to only let you login if the disabled field is equal to 0 but i can't get my edit profile script to update the database with any value at all. I have searched this and other forums and can only find info on using an array for mutliple checkboxes but I have only 1 checkbox so I'm not sure that is the best way. Once the checkbox updates to the database I will also need to make so when viewing and editing the users profile you can tell whether the account is disabled already by having the checkbox marked only if the account is disabled.

Below is my adminprofile.php file. The edit profile section starts on line 59 and my database update starts on line 112. Parts of this page currently work as expected except the disabled checkbox. Any help would be appreciated.

<?php
session_start();

include 'config.php';

include 'opendb.php';
include("login.php");

echo '<link rel="stylesheet" type="text/css" href="profile.css">';

echo '<center><div id="page"><img src="images/profhead.gif" width="955" height="90" /></center>';

if($logged_in){

loggedgroup();
if($_SESSION[grptype] == 'Admin' or $_SESSION[grptype] == 'Superadmin' or $_SESSION[grptype2] == 'Admin' or $_SESSION[grptype2] == 'Superadmin'){

if ($_SESSION['uid'] == NULL){
echo '<META HTTP-EQUIV="refresh" content="0;URL=admin.php">';
}else{
displayLogin();

echo '<hr>';

if( isset($_GET['pg']) ) { 
 switch( $_GET['pg']) {
 	case 'view':

global $conn;

$sql = "SELECT * FROM `profiles` WHERE id='$_SESSION[uid]'";

$query = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_num_rows($query);
while ($row = mysql_fetch_array($query)) {echo '<div id="vwprof"><center><h2>Personal Information</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
<tr><td width="50% align="left"><h3>Username:</h3></td><td width="50% align="right"><h4><input type="text" name="user" value="'.$row['username'].'" readonly></h4>
<tr><td width="50% align="left"><h3>Disabled:</h3></td><td width="50% align="right"><h4><input type="checkbox" name="disabled" value="" readonly></h4>'; 
echo '</td></tr><tr><td width="50% align="left"><h3>Name:</h3></td><td width="50% align="right"><h4><input type="text" name="name" value="'.$row['first_name'].' '.$row['last_name'].'" readonly></h4>'; 
echo '</td><tr><tr><td width="50% align="left"><h3>Group:</h3></td><td width="50% align="right"><h4><input type="text" name="group" value="'.$_SESSION['grpname'].'" readonly></h4>';
echo '</td><tr><tr><td width="50% align="left"><h3>Group 2:</h3></td><td width="50% align="right"><h4><input type="text" name="group2" value="'.$_SESSION['grp2name'].'" readonly></h4>'; 
echo  '</td></tr><tr><td width="50% algin="left"><h3>Home Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="phone" value="'. $row['phone'].'" readonly></h4></td></tr>';
echo '<tr><td width="50% algin="left"><h3>Alt Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="altphone" value="'. $row['altphone'].'" readonly></h4></td></tr>'; 
echo '<tr><td width="50% algin="left"><h3>Alt Phone Type:</h3></td><td width="50% align="right"><h4><input type="text" name="altphn_title" value="'. $row['altphn_title'].'" readonly></h4></td></tr>';
echo '<tr><td width="50% algin="left"><h3>Email Address:</h3></td><td width="50% align="right"><h4><input type="text" name="email" value="'. $row['email'].'" readonly></h4></td></tr>
<tr align="left"><center><td><a href="adminprofile.php?pg=edit">Edit Personal Profile</a></td></center><td><a href="adminprofile.php?pg=systems">View System Profiles</a></td> <td align="right"></tr></table>

<h2>Physical Address</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
<tr><td width="50% align="left"><h3>Address:</h3></td><td width="50% align="right"><h4><input type="text" name="address" value="'.$row['address'].'" readonly></h4></td></tr>
<tr><td width="50% align="left"><h3>Address Line 2:</h3></td><td width="50% align="right"><h4><input type="text" name="address2" value="'.$row['address2'].'" readonly></h4></td></tr>
<tr><td width="50% align="left"><h3>City, State:</h3></td><td width="50% align="right"><h4><input type="text" name="city" value="'.$row['city'].', '.$row['state'].'" readonly></h4></td></tr>
<tr><td width="50% align="left"><h3>Zip Code:</h3></td><td width="50% align="right"><h4><input type="text" name="zip" value="'.$row['zip'].'-'.$row['zip4'].'" readonly></h4></td></tr>
<tr><td width="50% align="left"><h3>Cross Streets:</h3></td><td width="50% align="right"><h4><input type="text" name="cross_roads" value="'.$row['cross_roads'].'" readonly></h4></td></tr></table>
</center></div>';


}		

		break;
    case 'edit':

global $conn;

$sqle = "SELECT * FROM `profiles` WHERE id='$_SESSION[uid]'";

$querye = mysql_query($sqle, $conn) or die(mysql_error());
$rowe = mysql_num_rows($querye);

if ( !isset($_POST['submit'])) {

while ($rowe = mysql_fetch_array($querye)) {
echo '<form action="" method="post">';
echo '<div id="edtprof"><center><h2>Personal Information</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
<tr><td width="50% align="left"><h3>Username:</h3></td><td width="50% align="right"><h4><input type="text" name="username" value="'.$rowe['username'].'" readonly></h4>
<tr><td width="50% align="left"><h3>Disabled:</h3></td><td width="50% align="right"><h4><input type="checkbox" name="disabled" value=""></h4>'; 
echo '</td></tr><tr><td width="50% align="left"><h3>First Name:</h3></td><td width="50% align="right"><h4><input type="text" name="first_name" id="first_name" value="'.$rowe['first_name'].'"></h4>';
echo '</td></tr><tr><td width="50% align="left"><h3>Last Name:</h3></td><td width="50% align="right"><h4><input type="text" name="last_name" value="'.$rowe['last_name'].'"></h4>'; 
echo '</td><tr><tr><td width="50% align="left"><h3>Group:</h3></td><td width="50% align="right"><h4><input type="text" name="group" value="'.$_SESSION['grpname'].'" readonly></h4>'; 
echo '</td><tr><tr><td width="50% align="left"><h3>Group 2:</h3></td><td width="50% align="right"><h4><input type="text" name="group2" value="'.$_SESSION['grp2name'].'" readonly></h4>'; 
echo  '</td></tr><tr><td width="50% algin="left"><h3>Home Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="phone" value="'. $rowe['phone'].'"></h4></td></tr>';
echo '<tr><td width="50% algin="left"><h3>Alt Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="altphone" value="'. $rowe['altphone'].'"></h4></td></tr>'; 
echo '<tr><td width="50% algin="left"><h3>Alt Phone Type:</h3></td><td width="50% align="right"><h4><input type="text" name="altphn_title" value="'. $rowe['altphn_title'].'"></h4></td></tr>';
echo '<tr><td width="50% algin="left"><h3>Email Address:</h3></td><td width="50% align="right"><h4><input type="text" name="email" value="'. $rowe['email'].'"></h4></td></tr></table>

<h2>Physical Address</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
<tr><td width="50% align="left"><h3>Address:</h3></td><td width="50% align="right"><h4><input type="text" name="address" value="'.$rowe['address'].'"></h4></td></tr>
<tr><td width="50% align="left"><h3>Address Line 2:</h3></td><td width="50% align="right"><h4><input type="text" name="address2" value="'.$rowe['address2'].'"></h4></td></tr>
<tr><td width="50% align="left"><h3>City:</h3></td><td width="50% align="right"><h4><input type="text" name="city" value="'.$rowe['city'].'"></h4></td></tr>
<tr><td width="50% align="left"><h3>State:</h3></td><td width="50% align="right"><h4><input type="text" name="state" value="'.$rowe['state'].'"></h4></td></tr>
<tr><td width="50% align="left"><h3>Zip Code:</h3></td><td width="50% align="right"><h4><input type="text" name="zip" value="'.$rowe['zip'].'">-<input type="text" name="zip4" value="'.$rowe['zip4'].'"></h4></td></tr>
<tr><td width="50% align="left"><h3>Cross Streets:</h3></td><td width="50% align="right"><h4><input type="text" name="cross_roads" value="'.$rowe['cross_roads'].'"></h4></td></tr>
<tr><td align="left"><input type="submit" name="submit" value="Save!"></td></tr></table></center></div></form>';
}


} else {

$first_name = $_POST[first_name];
$last_name = $_POST[last_name];
$phone = $_POST[phone];
$altphone = $_POST[altphone];
$altphn_title = $_POST[altphn_title];
$email = $_POST[email];
$address = $_POST[address];
$address2 = $_POST[address2];
$city = $_POST[city];
$state = $_POST[state];
$zip = $_POST[zip];
$zip4 = $_POST[zip4];
$cross_roads = $_POST[cross_roads];
$disabled = $_POST[disabled];

if ($disabled == NULL) {
$disabled = 1;
}
else {
$disabled = 0;
}

mysql_query("update profiles set disabled='$disabled', first_name='$first_name', last_name='$last_name', phone='$phone', altphone='$altphone', altphn_title='$altphn_title', email='$email', address='$address', address2='$address2', 
city='$city', state='$state', zip='$zip', zip4='$zip4', cross_roads='$cross_roads' WHERE id='$_SESSION[gid]'");
mysql_close();

echo '<META HTTP-EQUIV="refresh" content="0;URL=adminprofile.php?pg=view">'; 


}
break;

}		}
		
}	

}else{
   echo '<br><center><h3>You must be an admin to view this page. If you feel you have reached this message in error please contact the site admin.</h3></center>';
}

}
else{
   echo '<br><center><h3>You must be logged in to view this page. Please login!</h3></center>';
displayLogin();
}



?>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 771
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 63
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Master Poster

Re: help with Checkbox value in mysql

  #2  
Jul 19th, 2008
see if this works
added value to disabled checkbox
added check if disabled isset and = disabled
added if db disabled "checked='checked' "
  1. <?php
  2. session_start();
  3.  
  4. include 'config.php';
  5.  
  6. include 'opendb.php';
  7. include("login.php");
  8.  
  9. echo '<link rel="stylesheet" type="text/css" href="profile.css">';
  10.  
  11. echo '<center><div id="page"><img src="images/profhead.gif" width="955" height="90" /></center>';
  12.  
  13. if($logged_in){
  14.  
  15. loggedgroup();
  16. if($_SESSION[grptype] == 'Admin' or $_SESSION[grptype] == 'Superadmin' or $_SESSION[grptype2] == 'Admin' or $_SESSION[grptype2] == 'Superadmin'){
  17.  
  18. if ($_SESSION['uid'] == NULL){
  19. echo '<META HTTP-EQUIV="refresh" content="0;URL=admin.php">';
  20. }else{
  21. displayLogin();
  22.  
  23. echo '<hr>';
  24.  
  25. if( isset($_GET['pg']) ) {
  26. switch( $_GET['pg']) {
  27. case 'view':
  28.  
  29. global $conn;
  30.  
  31. $sql = "SELECT * FROM `profiles` WHERE id='$_SESSION[uid]'";
  32.  
  33. $query = mysql_query($sql, $conn) or die(mysql_error());
  34. $row = mysql_num_rows($query);
  35. while ($row = mysql_fetch_array($query)) {
  36. if($row['disabled'] == "1")
  37. {
  38. $checkdisabled = 'checked="checked" ';
  39. }
  40. else
  41. {
  42. $checkdisabled = '';
  43. }
  44. echo '<div id="vwprof"><center><h2>Personal Information</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
  45. <tr><td width="50% align="left"><h3>Username:</h3></td><td width="50% align="right"><h4><input type="text" name="user" value="'.$row['username'].'" readonly></h4>
  46. <tr><td width="50% align="left"><h3>Disabled:</h3></td><td width="50% align="right"><h4><input type="checkbox" ' . $checkdisabled . 'name="disabled" value="disabled" readonly></h4>';
  47. echo '</td></tr><tr><td width="50% align="left"><h3>Name:</h3></td><td width="50% align="right"><h4><input type="text" name="name" value="'.$row['first_name'].' '.$row['last_name'].'" readonly></h4>';
  48. echo '</td><tr><tr><td width="50% align="left"><h3>Group:</h3></td><td width="50% align="right"><h4><input type="text" name="group" value="'.$_SESSION['grpname'].'" readonly></h4>';
  49. echo '</td><tr><tr><td width="50% align="left"><h3>Group 2:</h3></td><td width="50% align="right"><h4><input type="text" name="group2" value="'.$_SESSION['grp2name'].'" readonly></h4>';
  50. echo '</td></tr><tr><td width="50% algin="left"><h3>Home Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="phone" value="'. $row['phone'].'" readonly></h4></td></tr>';
  51. echo '<tr><td width="50% algin="left"><h3>Alt Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="altphone" value="'. $row['altphone'].'" readonly></h4></td></tr>';
  52. echo '<tr><td width="50% algin="left"><h3>Alt Phone Type:</h3></td><td width="50% align="right"><h4><input type="text" name="altphn_title" value="'. $row['altphn_title'].'" readonly></h4></td></tr>';
  53. echo '<tr><td width="50% algin="left"><h3>Email Address:</h3></td><td width="50% align="right"><h4><input type="text" name="email" value="'. $row['email'].'" readonly></h4></td></tr>
  54. <tr align="left"><center><td><a href="adminprofile.php?pg=edit">Edit Personal Profile</a></td></center><td><a href="adminprofile.php?pg=systems">View System Profiles</a></td> <td align="right"></tr></table>
  55.  
  56. <h2>Physical Address</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
  57. <tr><td width="50% align="left"><h3>Address:</h3></td><td width="50% align="right"><h4><input type="text" name="address" value="'.$row['address'].'" readonly></h4></td></tr>
  58. <tr><td width="50% align="left"><h3>Address Line 2:</h3></td><td width="50% align="right"><h4><input type="text" name="address2" value="'.$row['address2'].'" readonly></h4></td></tr>
  59. <tr><td width="50% align="left"><h3>City, State:</h3></td><td width="50% align="right"><h4><input type="text" name="city" value="'.$row['city'].', '.$row['state'].'" readonly></h4></td></tr>
  60. <tr><td width="50% align="left"><h3>Zip Code:</h3></td><td width="50% align="right"><h4><input type="text" name="zip" value="'.$row['zip'].'-'.$row['zip4'].'" readonly></h4></td></tr>
  61. <tr><td width="50% align="left"><h3>Cross Streets:</h3></td><td width="50% align="right"><h4><input type="text" name="cross_roads" value="'.$row['cross_roads'].'" readonly></h4></td></tr></table>
  62. </center></div>';
  63.  
  64.  
  65. }
  66.  
  67. break;
  68. case 'edit':
  69.  
  70. global $conn;
  71.  
  72. $sqle = "SELECT * FROM `profiles` WHERE id='$_SESSION[uid]'";
  73.  
  74. $querye = mysql_query($sqle, $conn) or die(mysql_error());
  75. $rowe = mysql_num_rows($querye);
  76.  
  77. if ( !isset($_POST['submit'])) {
  78.  
  79. while ($rowe = mysql_fetch_array($querye)) {
  80. if($rowe['disabled'] == "1")
  81. {
  82. $checkdisabled = 'checked="checked" ';
  83. }
  84. else
  85. {
  86. $checkdisabled = '';
  87. }
  88. echo '<form action="" method="post">';
  89. echo '<div id="edtprof"><center><h2>Personal Information</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
  90. <tr><td width="50% align="left"><h3>Username:</h3></td><td width="50% align="right"><h4><input type="text" name="username" value="'.$rowe['username'].'" readonly></h4>
  91. <tr><td width="50% align="left"><h3>Disabled:</h3></td><td width="50% align="right"><h4><input type="checkbox" ' . $checkdisabled . 'name="disabled" value="disabled"></h4>';
  92. echo '</td></tr><tr><td width="50% align="left"><h3>First Name:</h3></td><td width="50% align="right"><h4><input type="text" name="first_name" id="first_name" value="'.$rowe['first_name'].'"></h4>';
  93. echo '</td></tr><tr><td width="50% align="left"><h3>Last Name:</h3></td><td width="50% align="right"><h4><input type="text" name="last_name" value="'.$rowe['last_name'].'"></h4>';
  94. echo '</td><tr><tr><td width="50% align="left"><h3>Group:</h3></td><td width="50% align="right"><h4><input type="text" name="group" value="'.$_SESSION['grpname'].'" readonly></h4>';
  95. echo '</td><tr><tr><td width="50% align="left"><h3>Group 2:</h3></td><td width="50% align="right"><h4><input type="text" name="group2" value="'.$_SESSION['grp2name'].'" readonly></h4>';
  96. echo '</td></tr><tr><td width="50% algin="left"><h3>Home Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="phone" value="'. $rowe['phone'].'"></h4></td></tr>';
  97. echo '<tr><td width="50% algin="left"><h3>Alt Phone:</h3></td><td width="50% align="right"><h4><input type="text" name="altphone" value="'. $rowe['altphone'].'"></h4></td></tr>';
  98. echo '<tr><td width="50% algin="left"><h3>Alt Phone Type:</h3></td><td width="50% align="right"><h4><input type="text" name="altphn_title" value="'. $rowe['altphn_title'].'"></h4></td></tr>';
  99. echo '<tr><td width="50% algin="left"><h3>Email Address:</h3></td><td width="50% align="right"><h4><input type="text" name="email" value="'. $rowe['email'].'"></h4></td></tr></table>
  100.  
  101. <h2>Physical Address</h2><table width="28%" align="center" background="images/trimmtext.gif" style="border-style:groove;border-color:navy;margin-top:12px;">
  102. <tr><td width="50% align="left"><h3>Address:</h3></td><td width="50% align="right"><h4><input type="text" name="address" value="'.$rowe['address'].'"></h4></td></tr>
  103. <tr><td width="50% align="left"><h3>Address Line 2:</h3></td><td width="50% align="right"><h4><input type="text" name="address2" value="'.$rowe['address2'].'"></h4></td></tr>
  104. <tr><td width="50% align="left"><h3>City:</h3></td><td width="50% align="right"><h4><input type="text" name="city" value="'.$rowe['city'].'"></h4></td></tr>
  105. <tr><td width="50% align="left"><h3>State:</h3></td><td width="50% align="right"><h4><input type="text" name="state" value="'.$rowe['state'].'"></h4></td></tr>
  106. <tr><td width="50% align="left"><h3>Zip Code:</h3></td><td width="50% align="right"><h4><input type="text" name="zip" value="'.$rowe['zip'].'">-<input type="text" name="zip4" value="'.$rowe['zip4'].'"></h4></td></tr>
  107. <tr><td width="50% align="left"><h3>Cross Streets:</h3></td><td width="50% align="right"><h4><input type="text" name="cross_roads" value="'.$rowe['cross_roads'].'"></h4></td></tr>
  108. <tr><td align="left"><input type="submit" name="submit" value="Save!"></td></tr></table></center></div></form>';
  109. }
  110.  
  111.  
  112. } else {
  113.  
  114. $first_name = $_POST["first_name"];
  115. $last_name = $_POST["last_name"];
  116. $phone = $_POST["phone"];
  117. $altphone = $_POST["altphone"];
  118. $altphn_title = $_POST["altphn_title"];
  119. $email = $_POST["email"];
  120. $address = $_POST["address"];
  121. $address2 = $_POST["address2"];
  122. $city = $_POST["city"];
  123. $state = $_POST["state"];
  124. $zip = $_POST["zip"];
  125. $zip4 = $_POST["zip4"];
  126. $cross_roads = $_POST["cross_roads"];
  127.  
  128. if (isset($_POST["disabled"]) && $_POST["disabled"] == "disabled") {
  129. $disabled = 1;
  130. }
  131. else {
  132. $disabled = 0;
  133. }
  134.  
  135. mysql_query("update profiles set disabled='$disabled', first_name='$first_name', last_name='$last_name', phone='$phone', altphone='$altphone', altphn_title='$altphn_title', email='$email', address='$address', address2='$address2',
  136. city='$city', state='$state', zip='$zip', zip4='$zip4', cross_roads='$cross_roads' WHERE id='$_SESSION[gid]'");
  137. mysql_close();
  138.  
  139. echo '<META HTTP-EQUIV="refresh" content="0;URL=adminprofile.php?pg=view">';
  140.  
  141.  
  142. }
  143. break;
  144.  
  145. } }
  146.  
  147. }
  148.  
  149. }else{
  150. echo '<br><center><h3>You must be an admin to view this page. If you feel you have reached this message in error please contact the site admin.</h3></center>';
  151. }
  152.  
  153. }
  154. else{
  155. echo '<br><center><h3>You must be logged in to view this page. Please login!</h3></center>';
  156. displayLogin();
  157. }
  158.  
  159.  
  160.  
  161. ?>
Last edited by R0bb0b : Jul 19th, 2008 at 4:18 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
Reply With Quote  
Join Date: Jul 2008
Location: Utah
Posts: 9
Reputation: eagled2 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
eagled2's Avatar
eagled2 eagled2 is offline Offline
Newbie Poster

Re: help with Checkbox value in mysql

  #3  
Jul 19th, 2008
Thank you. That was just what I was missing. I did have a typo in my query but once I fixed that and added your changes it worked great.

I never knew you could combine 2 if statements together like that. I am a little puzzled still though on how the below code you added combined with the variable name being added to the input tag works though. As far as I can tell somehow putting the variable in there tells the script to run the below code but it doesn't quite make since to me.

The part that really puzzles me is
$checkdisabled = 'checked="checked" '; 

if($row['disabled'] == "1")

{

$checkdisabled = 'checked="checked" ';

}

else

{

$checkdisabled = '';

}
Last edited by eagled2 : Jul 19th, 2008 at 7:10 pm.
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 771
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 63
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Master Poster

Re: help with Checkbox value in mysql

  #4  
Jul 20th, 2008
$checkdisabled is pluged into the checkbox so when you pull the query, if the column "disabled" is 1 then checked="checked" is added to the checkbox making it checked else that will be left out making it unchecked. I know a lot of people just put the word checked in the checkbox tag but checked="checked" is the correct xhtml syntax.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
Reply With Quote  
Join Date: Jul 2008
Location: Utah
Posts: 9
Reputation: eagled2 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
eagled2's Avatar
eagled2 eagled2 is offline Offline
Newbie Poster

Re: help with Checkbox value in mysql

  #5  
Jul 20th, 2008
Thank you. That makes more since now.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC