Home > php教程 > php手册 > php简单数据保存程序

php简单数据保存程序

WBOY
Release: 2016-06-13 10:11:33
Original
1512 people have browsed it

php简单数据保存程序

php简单数据保存程序


 
 


   
 
 
 
 



include(dirname(__FILE__).'./inc/gg_function.php');

if( $_POST)
{
 $_cname = Get_value('cname',1);
 $_address = Get_value('caddress',1);
 $_tel = Get_value('ctel',1);
 $_fix = Get_value('cfix',1);
 $_mail = Get_value('cmail',1);
 
 
 if( empty($_cname) || strlen( $_cname )>200 )
 {
  ShowMsg('请输入公司名称!');
 }
 elseif( empty( $_address ) || strlen( $_address )>200 )
 {
  ShowMsg('请输入公司地址!');
 }
 elseif( empty( $_tel ) || strlen($_tel)>12 )
 {
  ShowMsg('请输入正确的电话号码');
 }
 elseif( empty($_fix) || strlen( $_fix )>20 )
 {
  ShowMsg('输入传真号');
 }
 elseif( empty( $_mail ) || strlen( $_mail )>254 )
 {
  ShowMsg('输入正确的邮件地址');
 }
 else{
  $_sql = "Insert into gx_coo(c_name,c_address,c_tel,c_fix,c_maile)value('$_cname','$_address','$_tel','$_fix','$_mail')";
  if( mysql_query( $_sql ) )
  {
   ShowMsg('信息保存成功!');
  }
  else
  {
   
   ShowMsg('操作失败请重试一次!');
  }
 }
}
?>

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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template