Is it possible to submit a checkbox form without submit button in php?

后端 未结 2 504
感动是毒
感动是毒 2021-01-25 01:50

I am a php newbie and i am trying to create a price range system for my ecommerce website project.

so I did a checkbox form:

2条回答
  •  伪装坚强ぢ
    2021-01-25 02:47

    I implemented the submission of multiple checkbox value by using php as follows. It works perfectly for me and hope that it will work for everyone .

    ";
    
    $apple=NULL;
    if(!empty($_POST['apple']))
    $apple = $_POST['apple'];
    $_SESSION["apple"] = $apple;
    $apple1 = $_SESSION["apple"];
    echo $apple1."
    "; $low=NULL; if(!empty($_POST['low'])) $low = $_POST['low']; $_SESSION["low"] = $low; $low1 = $_SESSION["low"]; echo $low1."
    "; ?> Checkbox Samsung> Apple> 5000-1000>

    Here I use session variable so that once I checked Samsung it will persist even if I checked apple . Hope this example will help you.

提交回复
热议问题