Home > Backend Development > PHP Tutorial > PHP simple data saving program_PHP tutorial

PHP simple data saving program_PHP tutorial

WBOY
Release: 2016-07-13 17:09:42
Original
1174 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('操作失败请重试一次!');
  }
 }
}
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/629743.htmlTechArticlephp简单数据保存程序 php简单数据保存程序 form id=form1 name=form1 method=post action= label input type=text name=cname / /label p label input type=text name=caddress...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template