Chrisislost86 Posted June 2, 2011 Share Posted June 2, 2011 Hello people I am a complete novice to code and any help would be appreciated. I am trying to get a check box to move the process to the next step. I have the check box on my test server but need to get the submit button to link do something now. if($level==60){mysql_query("insert into project_status (status_id, status_project_id, status_claim_number)values('80', '$project_id', '0')");$new_status=80;} Level 60 is the stage it is at now and don't want it to go to level 80 till the check box is ticked. Really hope this is making sense to someone. This is my HTML code for my check box, probably not the best but I’m completely new to this. <br /> <input type="checkbox" name="personal" value="checkbox" method="post"> All figures In? <INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Submit"> </td> Quote Link to comment https://forums.phpfreaks.com/topic/238180-check-box-to-go-to-next-step-help/ Share on other sites More sharing options...
revraz Posted June 2, 2011 Share Posted June 2, 2011 So are you saying you don't want to INSERT 80 into STATUS_ID field unless a checkbox is checked? Else enter 60? Quote Link to comment https://forums.phpfreaks.com/topic/238180-check-box-to-go-to-next-step-help/#findComment-1223951 Share on other sites More sharing options...
JonnoTheDev Posted June 2, 2011 Share Posted June 2, 2011 Give the checkbox a more appropriate value and then test for it. Also check your HTML, there is no method attribute in a checkbox element. <?php if($_POST) { /* is the checkbox checked? */ if($_POST['personal'] == 'checked') { /* yes it has */ } else { /* no it hasn't */ } } ?> <input type="checkbox" name="personal" value="checked" /> Quote Link to comment https://forums.phpfreaks.com/topic/238180-check-box-to-go-to-next-step-help/#findComment-1223954 Share on other sites More sharing options...
Chrisislost86 Posted June 2, 2011 Author Share Posted June 2, 2011 on my SQL data base the field is called level so i don't want it to go to the next level. I still want it to do all the stuff that’s in the code just not till this check box is ticked and submitted. Sorry if i sound bum but i really i am compared to you guys. Quote Link to comment https://forums.phpfreaks.com/topic/238180-check-box-to-go-to-next-step-help/#findComment-1223955 Share on other sites More sharing options...
JonnoTheDev Posted June 2, 2011 Share Posted June 2, 2011 Look at my code again. It is clearly commented. Fit your logic into the appropriate bits. I strongly suggest a book if you are a complete novice. Without actually writing the whole thing for you, there is not much more to put in a response. This is so simple. Quote Link to comment https://forums.phpfreaks.com/topic/238180-check-box-to-go-to-next-step-help/#findComment-1223960 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.