PHP development corporate website tutorial: Add contact us information

First we look at the html code of the following add page:

    添加公司信息  
公司地址:

公司电话:

技术支持:

售后电话:

公司传真:

公司主页:

电子邮件:

Looking at the above code, the form is submitted to the addcontact.php file, which receives the parameters submitted by the form, and then adds it to the database according to the sql statement

Let’s take a look at the addcontact.php part of the code:

alert('请填写地址');history.go(-1);"; }else if(empty($tel)){ echo ""; }else if(empty($suppot)){ echo ""; }else if(empty($nexttel)){ echo ""; }else if(empty($fax)){ echo ""; }else if(empty($home)){ echo ""; }else if(empty($email)){ echo ""; }else{ $sql = "insert into `contact`(site,tel,suppot,nexttel,fax,home,email) values('$site','$tel','$suppot','$nexttel','$fax','$home','$email')"; $res = mysql_query($sql); if($res){ echo ""; }else{ echo ""; } } ?>

As shown in the above code, we have made a simple verification for the form information. It cannot be empty. When it is empty and submitted, it will Give prompt information

Continuing Learning
||
添加公司信息
公司地址:

公司电话:

技术支持:

售后电话:

公司传真:

公司主页:

电子邮件:

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!