-1

menus.php

<?php
$con=mysqli_connect("localhost","root","","mmogezgini");
$menuler = mysqli_query($con,"SELECT * FROM menuler");
while($menu = mysqli_fetch_array($menuler)) {
   $isim = $menu["isim"];
   $url = $menu["url"];
?>
<form method="post">
    Menü İsmi :<input name="menu_isim" value="<?php echo $isim; ?>" disabled> | 
    Menü URL : <input name="menu_url" value="<?php echo $url;?>"disabled> 
    <button type="submit" formmethod="post" formaction="menu_duzenle.php">Düzenle</button>
    <button formaction="menu_sil.php">Sil</button>
</form>
<br>
<?php
 }
?>

edit_menu.php

<form method="post" action="menu_duzenle_islem.php">
Şuanki İsim : <input name="menu_isim" value="<?php echo $_POST['menu_isim'] ?>"disabled>
Yeni İsim : <input name="yeni_menu_isim" placeholder="yeni menü ismini giriniz.">
</form>

My Problem is form in menus.php wont send $_POST['menu_isim'] to *edit_menu.php*.need more to write for details

4

2 回答 2

2

禁用的输入不被视为通过表单传递的“有效”。

要将输入设为只读,请改用该readonly属性。

但是请记住,这种事情是不可信的。您应该将值保存在$_SESSION变量中并从那里检索它。

于 2013-10-02T08:35:52.657 回答
-1

删除disabled属性。如果您不希望用户编辑input使用readonly属性。

于 2013-10-02T08:37:07.313 回答