Home > php教程 > PHP源码 > PHP连接mySQL

PHP连接mySQL

PHP中文网
Release: 2016-05-25 17:13:59
Original
1601 people have browsed it

< form enctype="multipart/form-data" action="hb_ggzd.php" method="post" >
< tr >
< td width="251" >< small >您 可 以 花 些 时 间 填 写 下 表 , 也 可 以 用 电
子 邮 件 联 系 ,< a href="mailto:likai333@21cn.com" >likai333@21cn.com< /a >。< /small >< /td >
< /tr >
< tr >
< td vAlign="top" width="251" height="31" >< small >您的姓名:< /small >< /td >
< td width="462" height="31" >< small >< input name="name" size="20" > < /small >< /td >
< /tr >
< tr >
< td vAlign="top" width="251" height="30" >< small >您的电子邮件:< /small >< /td >
< td width="462" height="30" >< small >< input name="usermail" size="37" >< /small >< /td >
< /tr >
< tr >
< td vAlign="top" width="251" height="25" >< small >您欲做广告的网站地址:< /small >< /td >
< td width="462" height="25" >< small >< small >< input name="userurl" size="37" value="http://" >< /small >< /small >< /td >
< /tr >
< tr >
< td vAlign="top" width="251" height="25" >< small >您欲做广告的网站站名:< /small >< /td >
< td width="462" height="25" >< small >< input name="sitename" size="20" >< /small >< /td >
< /tr >
< tr >
< td vAlign="top" width="251" height="30" >< small >您的公司名称:< /small >< /td >
< td width="462" height="30" >< small >< input name="company" size="37" >< /small >< /td >
< /tr >
< tr >
< td vAlign="top" width="251" height="25" >< small >您的联系电话:< /small >< /td >
< td width="462" height="25" >< small >< input name="phone" size="20" >< /small >< /td >
< /tr >
< tr >


  后台PHP :
< ?php
= mysql_connect(&#39;localhost:3306&#39;,&#39;root&#39;,&#39;&#39;);
mysql_select_db(&#39;HBWEB&#39;);
="insert into usemsg ( name,usermail,userurl,sitename, company,phone) values (&#39;&#39;,&#39;&#39;,&#39;&#39;, &#39;&#39;, &#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;)";
= mysql_query(, );
= mysql_error();
if(){
echo "发生错误,请通知< a href=mailto:likai333@21cn.com >我< /a >";
echo "";
}
else
{ echo "成功入库"; }
? >
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template