how i can pass checkbox value using href in php?

Madhusudan

I want to do multiple delete using href link, how can i done ?

This code generate given below error.

Notice: Undefined index: action in
C:\xampp\htdocs\montu\montu\multiple.php on line 32

Warning: implode() [function.implode]: Invalid arguments passed in
C:\xampp\htdocs\montu\montu\multiple.php on line 32



<body>
    <form method="post" action="<?php $_PHP_SELF ?>">
        <table>
            <tr>
                <td>
                    <input type="checkbox" name="action[]" value="1">1
                </td>
                <td>
                    <input type="checkbox" name="action[]" value="2">2
                </td>
            </tr>
            <tr>
                <td>
                    <a href="?id">Click Me..</a>
                </td>
            </tr>

        </table>
    </form>

<?php 
    if(isset($_REQUEST['id']))
    {
        $action=implode(',',$_REQUEST['action']);//convert array value to string values
        echo $action;
    }
?>
Hiren Raiyani

Please try like this..

<?php 
    if(isset($_POST['action']))
    {
        //print_r($_REQUEST);
        $action=implode(',',$_REQUEST['action']);//convert array value to string values
        echo $action;
    }
?>
<body>
    <form name="frm" id="frm" method="post">
        <table>
            <tr>
                <td>
                    <input type="checkbox" name="action[]" value="1">1
                </td>
                <td>
                    <input type="checkbox" name="action[]" value="2">2
                </td>
            </tr>
            <tr>
                <td>
                    <a onclick="document.forms['frm'].submit()" href="#">Click Me..</a>
                </td>
            </tr>

        </table>
    </form>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Pass checkbox value to Edit (using href)

How to pass checkbox name and value to href

how to pass value to another php page using href

How can i pass multiple parameters in location.href in php?

How can I pass a url to an android app using href?

How can I pass value to FacebookRedirectLoginHelper in PHP

how can i get multiple value checkbox using modal

How can i print checkbox value on Text() Widget using Flutter

How can I assign a boolean value to a checkbox using React and Typescript?

How can I delete records using checkbox in php?

How can I pass JavaScript variable value in php with same page using modal window

How can I pass the value coming from a jQuery variable to PHP?

how can i create and pass value in multidimensional array in php?

How can i pass the jquery value to php function

How can I pass PHP variables value to Client Code for Paypal

How can I pass dynamic value to href property in table created with vue,js

How I can pass a value in localStorage to InAppBrowser using executescript event

How can I validate in bootstrap that at least one checkbox is marked and pass this information to php?

How do I pass a value to a PHP script using AJAX?

How can i get a checkbox value?

How can I reset the checkbox to the default value?

pass value to php script using location.href

how to set value of a checkbox using a php variable?

How can I can a checkbox to pass through a string into MySQL?

PHP pass value of checkbox to query

how to pass php value as parameter in anchor tag href

how do i pass a hash into input checkbox value in angular 6

How to pass Checkbox value 0 if not checked and 1 if checked using array

How to pass Multiple selected checkbox value to the server using api in android?