如何根据变量更改输入值?

我试图根据变量更改输入值,但代码不起作用:


<form action="czekboks.php" method="post">

<input type="submit" name="przycisk" <?php echo 'value="$keepchecked"'?>>

</form>

我也尝试过这个,但结果相同:


<form action="czekboks.php" method="post">

<input type="submit" name="przycisk" <?php echo ($keepchecked == "OBEJRZANE") ? 'value="OBEJRZANE"' : '';?>>

</form>


千巷猫影
浏览 102回答 2
2回答

收到一只叮咚

尝试这个:<form&nbsp;action="czekboks.php"&nbsp;method="post"> &nbsp;&nbsp;&nbsp;&nbsp;<input&nbsp;type="submit"&nbsp;name="przycisk"&nbsp;<?=&nbsp;($keepchecked&nbsp;==&nbsp;"OBEJRZANE")&nbsp;?&nbsp;'value="OBEJRZANE"'&nbsp;:&nbsp;'';?>> </form>或这个:<form&nbsp;action="czekboks.php"&nbsp;method="post"> &nbsp;&nbsp;&nbsp;&nbsp;<input&nbsp;type="submit"&nbsp;name="przycisk"&nbsp;value="<?=&nbsp;$keepchecked;&nbsp;?>"> </form>

海绵宝宝撒

<form&nbsp;action="czekboks.php"&nbsp;method="post"> &nbsp;&nbsp;&nbsp;&nbsp;<input&nbsp;type="submit"&nbsp;name="przycisk"&nbsp;value="<?php&nbsp;echo&nbsp;$keepchecked;?>"> </form>
打开App,查看更多内容
随时随地看视频慕课网APP