My program is not working please tell me the problum in it...

<form action = "http://localhost/third/c2.php" method = "Post">
<pre>    
<input type = 'checkbox' value = 'Stipned' name = 'chk1'/>  stipend </br>
<input type = 'checkbox' value = 'Diciplane' name = 'chk2'/>  Diciplane </br>
<input type = 'checkbox' value = 'Attandance' name = 'chk3'/>  Attandance </br>
<input type = 'checkbox' value = 'Assignment' name = 'chk4'/>  Assignment </br>
<input type = 'checkbox' value = 'Agree' name = 'chk5'/>  Agree </br>

    <input type = "submit" value = 'Go'/>
</pre>
</form>

and the php file is

<?php



    if(isset($_POST['chk5'] && ($_POST['chk5']!==Agree)){  

        echo "sorry you are failed to be selected";
    }

    else {
        $i=1;
            while(isset($_POST['chk&$i']))

            if($_POST['chk&$i']==checked $$ $i<=3 ){

             echo $_POST['chk&$i']. "</br>";

            }
    $i++;
        }




    }

?>

Recommended Answers

@Misbah khan

My program is not working please tell me the problum in it...

I don't know. What issue are you having?

When you run the code was there an error?

If there is an error then what is the error and line?

What are you trying to …

Jump to Post

All 2 Replies

Member Avatar

@Misbah khan

My program is not working please tell me the problum in it...

I don't know. What issue are you having?

When you run the code was there an error?

If there is an error then what is the error and line?

What are you trying to do?

/***************************************Client Side***************/

<form action="abc.php" method="post">
<input type=text name=c[] />
<input type =text name=c[]/>
<input type=submit name='s1' />
</form>

/*********************** SERVER SIDE ****************************/

<?php
$a= array();
$i=0;
foreach($_POST['c'] as $val)
echo $val;


?>

Enjoy.....!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.