小编Ama*_*kar的帖子

将默认值放在<input type = file ....>中

注意:

下面的答案和评论反映了2009年遗留浏览器的状态.现在,您可以在2017年使用JavaScript动态/编程地设置文件输入元素的值.

有关详细信息和演示,请参阅此问题中的答案:
如何以编程方式设置文件输入值(即:拖放文件时)?

我想更新一张桌子.因此,当用户想要更新它时,将出现插入表单,其中默认值显示在输入框中.但我无法载入<input type=file....>.

这是代码:

    <?php
    session_start();
    if(!isset($_SESSION['user']))
        {
            header("Location:index.php");
            exit();
        }
      include("./include/dbc.php");
      $a=$_REQUEST['apt'];
    $qry="select * from flats where app_name = '$a'";
    $result=mysql_query($qry) or die(mysql_error());
    while($res = mysql_fetch_array($result))
    {
     $ai=$res[0];
     $an=$res[1];
     $bn=$res[2];
     $lc=$res[3];
     $st=$res[4];
     $nf=$res[5];
     $ct=$res[6];
     $mp=$res[7];
     $lm=$res[8];
    }

    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <form id="form1" action="details1.php?ar=<?php echo $a;?>&api=<?php echo $ai;?>" method="post" enctype="multipart/form-data">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Welcome To Prime Properties</title>
    <link rel="stylesheet" href="style.css" type="text/css"/>

    </head>

    <body>
       <div …
Run Code Online (Sandbox Code Playgroud)

html javascript php upload input

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

html ×1

input ×1

javascript ×1

php ×1

upload ×1