如何使用Php,Mysql,Html在页面中上传图像和显示 [英] How Do I Upload Images And Display In A Page Using Php,Mysql,Html
本文介绍了如何使用Php,Mysql,Html在页面中上传图像和显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<html>
<head>
<meta charset="UTF-8">
<title>Product Details</title>
<script src="jquery.js"></script>
<script>
/* function validate()
{
if(document.getElementById(pname) !==('^/^[a-zA-Z0-9]{3,30}$/') )
{
alert ("Enter product name");
css.in;
return false;
}
return true;
}
*/
</script>
<style>
in{
border-color: red;
}
</style>
</head>
<body>
<form name="productDetails" action="productDetails.php" method="post" onsubmit="return validate()">
<table border="0">
<tr><td><label id="l">Product Name</label></td><td id="s">:</td><td><input type="text" name="pname" id="pname"></td></tr>
<tr><td><label id="l">Manufacture Date</label></td><td id="s">:</td><td><input type="date" name="mfgDate" id="mfgDate"></td></tr>
<tr><td><label id="l">Size</label></td><td id="s">:</td><td><input type="text" name="psize" id="psize"></td></tr>
<tr><td><label id="l">MRP</label></td><td id="s">:</td><td><input type="text" name="mrp" id="mrp"></td></tr>
<tr><td><label id="l">Sale rate</label></td><td id="s">:</td><td><input type="text" name="srate" id="srate"></td></tr>
<tr><td><label id="l">Product type</label></td><td id="s">:</td><td><input type="text" name="ptype" id="ptype"></td></tr>
<tr><td><label id="l">Color</label></td><td id="s">:</td><td><input type="text" name="pclr" id="pclr"></td></tr>
<tr><td><label id="l">Warranty</label></td><td id="s">:</td><td><input type="text" name="wrnty" id="wrnty"></td></tr>
</table>
<br><br>
<input type="file" name="myimage" style="border: 1px solid blue"><br>
<input type="submit" value="UPLOAD"><input type="reset" value="RESET">
</form>
<?php
// put your code here
?>
</body>
</html>
推荐答案
/'))
{
alert(Enter产品名称);
css.in;
返回false;
}
返回true;
}
* /
< / script>
< style>
边框颜色:红色;
}
< / style>
< / head>
< body>
< form name =productDetailsaction =productDetails.phpmethod =postonsubmit =return validate()>
< table border =0>
将TR>< TD><标签ID = L >产品名称< /标签>< / TD>< TD ID = S >:其中; / TD>< ; td>< input type =textname =pnameid =pname>< / td>< / tr>
将TR>< TD><标签ID = L >制造日期和LT; /标签>< / TD>< TD ID = S >:其中; / TD>< ; td>< input type =datename =mfgDateid =mfgDate>< / td>< / tr>
< tr>< td>< label id =l>尺寸< / label>< / td>< td id =s>:< / td>< td>< input type =textname =psizeid =psize>< / td>< / tr>
< tr>< td>< label id =l> MRP< / label>< / td>< td id =s>:< / td>< td>< input type =textname =mrpid =mrp>< / td>< / tr>
< tr>< td>< label id =l>销售率< / label>< / td>< td id =s>:< / td>< ; td>< input type =textname =srateid =srate>< / td>< / tr>
将TR>< TD><标签ID = L >产品的类型< /标签>< / TD>< TD ID = S >:其中; / TD>< ; td>< input type =textname =ptypeid =ptype>< / td>< / tr>
< tr>< td>< label id =l>颜色< / label>< / td>< td id =s>:< / td>< td>< input type =textname =pclrid =pclr>< / td>< / tr>
将TR>< TD><标签ID = L >保修和LT; /标签>< / TD>< TD ID = S >:其中; / TD>< td>< input type =textname =wrntyid =wrnty>< / td>< / tr>
< / table>
< br>< br>
< input type =filename =myimagestyle =border:1px solid blue>< br>
< input type =submitvalue =UPLOAD>< input type =resetvalue =RESET>
< / form>
<?php
//将您的代码放在这里
?>
< / body>
< / html>
/') ) { alert ("Enter product name"); css.in; return false; } return true; } */ </script> <style> in{ border-color: red; } </style> </head> <body> <form name="productDetails" action="productDetails.php" method="post" onsubmit="return validate()"> <table border="0"> <tr><td><label id="l">Product Name</label></td><td id="s">:</td><td><input type="text" name="pname" id="pname"></td></tr> <tr><td><label id="l">Manufacture Date</label></td><td id="s">:</td><td><input type="date" name="mfgDate" id="mfgDate"></td></tr> <tr><td><label id="l">Size</label></td><td id="s">:</td><td><input type="text" name="psize" id="psize"></td></tr> <tr><td><label id="l">MRP</label></td><td id="s">:</td><td><input type="text" name="mrp" id="mrp"></td></tr> <tr><td><label id="l">Sale rate</label></td><td id="s">:</td><td><input type="text" name="srate" id="srate"></td></tr> <tr><td><label id="l">Product type</label></td><td id="s">:</td><td><input type="text" name="ptype" id="ptype"></td></tr> <tr><td><label id="l">Color</label></td><td id="s">:</td><td><input type="text" name="pclr" id="pclr"></td></tr> <tr><td><label id="l">Warranty</label></td><td id="s">:</td><td><input type="text" name="wrnty" id="wrnty"></td></tr> </table> <br><br> <input type="file" name="myimage" style="border: 1px solid blue"><br> <input type="submit" value="UPLOAD"><input type="reset" value="RESET"> </form> <?php // put your code here ?> </body> </html>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
conn = mysql_connect( localhost, < span class =code-string> root, 1234);
if(!
conn = mysql_connect("localhost","root","1234"); if(!
这篇关于如何使用Php,Mysql,Html在页面中上传图像和显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文