Jump to content

Check box to go to next step ..help..


Chrisislost86

Recommended Posts

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>

 

Link to comment
https://forums.phpfreaks.com/topic/238180-check-box-to-go-to-next-step-help/
Share on other sites

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" />

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.

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.