ok very easy i believe, i have just never tried to do it and dont know how
heres what i want it to do
1) i have a login form
2) standard username and password config
3) IF a checkbox is checked i want it to save a cookie, if it isnt then i dont want it to
not sure how to do this, anyone point me in the right direction?
special "if" circumstance
Moderator: General Moderators
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
here's a rough code:
Im sure you won't use that
. But hope it gives you some ideas...
-Nay
Code: Select all
<?php
if(isSet($_POST['imposted'])) {
if(!isset($_POST['username']) || empty($_POST['username']) || !isset($_POST['password']) || empty($_POST['password'])) {
print "you missed out fileds you dofus!";
exit;
}
// bla bla query
if($mysql_num_rows($bla_bla_result) == 0) {
print "you tryng to hack?........";
exit;
}
if(isSet($_POST['give_santa_a_cookie'])) {
// set cookie
}
header("Location: my_naked_pics.php");
} else {
}
?>-Nay
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
well i wont
im pretty sure the users wont appreciate the line
im pretty sure the users wont appreciate the line
[/qoute]Code: Select all
print "you missed out fileds you dofus!";
lol, thanks for the help anyway, ive never understood how to get PHP to make a condition from checkbox (or any form elements) state.