In my edit page of my cms I am writing the form and populating it if there is content existing, but how do I check if the checkbox has a value of 1, if so then echo 'checked'?
Here is what I am doing
So I need to check if pool has a value of 1, then echo checked but can I do this inside an echo?
Here is what I am doing
Code:
$query1=" SELECT * FROM properties where id = '{$_GET['id']}' ";
$result1=mysql_query($query1);
$rs = mysql_fetch_array($result1, MYSQL_ASSOC);
echo "<form method='post' action='editscript.php'>" .
"<input type='hidden' name='id' value='{$rs['id']}'>" .
"<span class='MainText'>Property Name: </span><br /><input type='text' name='name' value='{$rs['name']}' class='admininputs'>" .
"<br /><span class='MainText'>Property Address: </span><br /><input type='text' name='address' value='{$rs['address']}' class='admininputs'>" .
"<br />pool <input type='checkbox' value='1' name='pool' />.
"<br /><input type='submit' value='submit'></form>" ;
So I need to check if pool has a value of 1, then echo checked but can I do this inside an echo?