img.htm

来自「套中小型企业网站建设」· HTM 代码 · 共 62 行

HTM
62
字号
<HTML>
<HEAD>
<TITLE>插入图片</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE TYPE="text/css">
 td {font-size: 9pt}
 body {font-size: 9pt}
 BUTTON {width:5em}
</STYLE>
<SCRIPT LANGUAGE=JavaScript>
function returnPath()
{
  	var uploadFrame = window.dialogArguments;
  	if (uploadFrame.document.all.path != null && document.form1.img.value != "")
  	{
  		window.returnValue = uploadFrame.document.all.path.innerText;
		uploadFrame.document.write("");
  		window.close();
  	}
	else
	{
		alert("请选择要上传的图片!");
	}
}
function checkForm(form)
{
	if (form.img.value.replace(/^\s+|\s+$/) == "")
	{
		alert("请选择要上传的图片!");
		return false;
	}
	return true;
}
</SCRIPT>

</HEAD>
<BODY bgcolor=menu style='margin-left:8px;margin-top:8px;margin-botton:0px;'>
<table width="100%" height="70" border="0" cellpadding="10" cellspacing="0">
  <tr>
    <td width="651"><fieldset>
    <legend>插入图片</legend>
    <table width="100%" border="0" align='center' cellpadding="0" cellspacing="5">
	<form name="form1" enctype="multipart/form-data" method="post" action="upload.php" target="uploadFile" onsubmit='return checkForm(this)'>
      <tr>
        <td align=left>&nbsp;</td>
        <td align=left>请选择要上传的图片</td>
      </tr>
      <tr>
        <td width="3%" align=left>&nbsp;</td>
        <td width="97%" align=left><input type="file" name="img">
          <input type="submit" name="uploadFile" value="上传图片"></td>
      </tr>
	</form> 
    </table>
    </fieldset></td>
    <td width="60"><BUTTON onclick="returnPath()">确定</BUTTON>&nbsp;<br>
    <br>
    <BUTTON onclick="window.close();">取消</BUTTON></td>
  </tr>
</table>
</BODY>   
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?