Problem w/ isset($_REQUEST['form_submitted'])

40 views Asked by At

I have a isset($_REQUEST['form_submitted']) with these 4 entries (among other) in the form:

 <div class="formLeft">
                    <input name="comic" type="checkbox" id="comic" value="1" <?php if (isset($auswahl)){if($dbcomic =='1'){ echo "checked";}} ?> />
                  </div>
                  <div class="formLeft">
                    <input name="comic" type="checkbox" id="comic" value="0" <?php if (isset($auswahl)){if($dbcomic =='0'){ echo "disabled";}} ?> />
                  </div>
                  <div class="formLeft">
                    <input name="onoff" type="checkbox" id="onoff" value="0" <?php if (isset($auswahl)){if($dbonoff =='0'){ echo "disabled";}} ?> />
                  </div>
                  <div class="formLeft">
                    <input name="onoff" type="checkbox" id="onoff" value="1" <?php if (isset($auswahl)){if($dbonoff =='1'){ echo "checked";}} ?> />
                  </div>

$auswahl is called before here:

$query = mysqli_query($link, "SELECT  * from aktuelles where id = '$auswahl'");
        while ($zeile = mysqli_fetch_assoc($query)) {
                $dbonoff = $zeile['onoff'];
                $dbcomic = $zeile['comic']; ... }

If the form is sent it uses:

if(isset($_POST['submit'])){$submit = $_POST['submit'];}
if(isset($_REQUEST['auswahl'])){$auswahl = $_REQUEST['auswahl'];}

and

if ($submit == 'aktualisieren'){
        if (isset($_REQUEST['form_submitted'])) {
...
    if(!empty($img)){$img = $img;} else {$img = $dbimg;}
    mysqli_query($link, "UPDATE aktuelles set title = '$title',...,  ablaufdatum = '$ablaufdatum', onoff = '$onoff', comic = '$comic' where id = $id");

}

It mainly works, but if just $dbonoff is checked and $dbcomic is disabled and not checked or the other way, I can not just disable $dbonoff as well, it turns into a white error. It works as soon I turn also $dbcomic as is checked or the other way. There must be an action on both sides.

Don't know how to solve this problem.

help for my problem and acknowledge...

0

There are 0 answers