JS function
<script>
function m(i){
var url=i.value;
url=url.split("\\");
var n = url[url.length-1];
n = n.substring(0,n.lastIndexOf(‘.‘));
document.getElementById(‘title‘).value = n;
}
</script>
资质描述<input type="text" name="ztitle" id="title"><br>
资质上传<input type="file" name="zzfile" onChange="m(this)"><br>
Fill in the qualification description with the file name of the qualification upload directly
<!doctype html>
<meta charset="utf-8">
<title>无标题文档</title>
<body>
企业荣誉资质
<form action="zzsave.php" method="post" enctype="multipart/form-data">
类别:<select name="cname">
<?php
include ‘../inc/db_mysqli.php‘;
$rows=query(‘hnsc_zzclass‘);
foreach($rows as $v){
printf("<option value=‘%s‘>%s</option>",$v[0],$v[0]);
}
?>
</select>
<button onClick="location.href=‘zzclassadmin.php‘;">新增类别</button><br>
qualification description <input type = "text" name = "Ztitle" id = "title" ><BR>
资质上传<input type="file" name="zzfile" onChange="m(this)"><br>
是否在网站上显示
< Label><input type = "Radio" name = Span class= "ATV" > "flag" value = "y" checked > show </LABEL>
<label><input type="radio" name="flag" value="n">不显示</label><br>
<input type="submit" value="提交">
<script>
function m(i){
var url=i.value;
url=url.split("\\");
var n = url[url.length-1];
n = n.substring(0,n.lastIndexOf(‘.‘));
document.getElementById(‘title‘).value = n;
}
</script>
</form>
</body>
From for notes (Wiz)
Get the input value of the uploaded file directly