原文:Notice: Undefined index: user in D:\phpStudy\WWW\js\ls\lsmc\php\add.php on line 9

(初用数据库(mysql)做用户登录注册这一块,遇到很多问题,通过搜索找到解决方案,把问题分享出来,希望可以帮助到和我一样问题的博友们,有问题还望多多指教。)

解决方法:在add.php文件最上边加上 error_reporting(E_ALL ^ E_NOTICE);

<?php

    error_reporting(E_ALL ^ E_NOTICE);

    

    require 'config.php';  //加载config.php 

    //新增用户

    $query = "INSERT INTO lsmc_user(user,pass,yzm) VALUES ('{$_POST['user']}',sha1('{$_POST['pass']}'))";

    mysql_query($query) or die('新增失败:'.mysql_error());

    echo mysql_affected_rows(); //返回当前影响几行

    mysql_close();   //关闭数据库

?>

Notice: Undefined index: user in D:\phpStudy\WWW\js\ls\lsmc\php\add.php on line 9的更多相关文章

  1. Testlink安装:Notice:Undefined index: type in C:\inetpub\wwwroot\testlink-1.9.3\install\installCheck.php on line 41

    问题现象:

  2. wordpress5.0+中 Notice: Undefined index: HTTP_REFERER 问题解决

    都说现在搭网站很简单了,但真遇到问题了还真不一定能解决. 这次搭建的网站是用的wordpress版本5.0.4,以为操作和以前的低版本一样,结果做出来还是遇到问题了. 网站搭好后,首页总在顶端出现一行 ...

  3. Notice: Undefined index: wjs_cookie

    w执行顺序. ok <!doctype html> <html> <head> <meta charset="UTF-8"> < ...

  4. PHP中出现Notice: Undefined index的三种解决办法

    前一段做的一个PHP程序在服务器运行正常,被别人拿到本机测试的时候总是出现“Notice: Undefined index:”这样的警告,这只是一个因为PHP版本不同而产生的警告(NOTICE或者WA ...

  5. PHP Notice: Undefined index:解决方法

    PHP Notice:  Undefined index:解决方法 PHP Notice: Undefined index: 解决方法 <pre> if (empty(swoole_get ...

  6. php提示Notice: Undefined index解决方法

    php提示Notice: Undefined index问题,Undefined index:是指你的代码里存在:“变量还未定义.赋值就使用”的错误,这个不是致命错误,不会让你的php代码运行强行中止 ...

  7. 为什么会出现Notice: Undefined index: submit in D:\xampp\htdocs\test.php on line 19

    事例如下": <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/ ...

  8. ***PHP Notice: Undefined index: ..问题的解决方法

    首先,这个不是错误,是warning.所以如果服务器不能改,每个变量使用前应当先定义. 方法1:服务器配置修改     修改php.ini配置文件,error_reporting = E_ALL &a ...

  9. 屏蔽Drupal中的“Notice: Undefined index”警告

    原因:drupal默认使用E_ALL,即输出所有错误和警告.我们只需要修改错误显示级别即可. 方法: 1. 打开\sites\default\settings.php 追加一行 ini_set('er ...

随机推荐

  1. Searching with regular sentences will only get you so far – if you need to find something a bit tricky turn to these advanced yet simple methods--转

    原文地址:http://www.theguardian.com/technology/2016/jan/15/how-to-use-search-like-a-pro-10-tips-and-tric ...

  2. 全面详细介绍一个P2P网贷领域的ERP系统的主要功能

        一般的P2P系统,至少包括PC网站的前端和后端.前端系统的功能,可以参考"P2P系统哪家强,功能其实都一样" http://blog.csdn.net/fansunion/ ...

  3. RISC-V工具链环境(基于Debian/Linux操作系统)

    RISC-V工具链环境(基于Debian/Linux操作系统) 提要 Debian/Linux虚拟机导入 启动虚拟机 SiFive/Nuclei SDK运行指南 Debian/Linux虚拟机存储位置 ...

  4. UVA - 1161 Objective: Berlin(最大流+时序模型)

    题目大意:有n个城市m条航线.给出每条航线的出发地,目的地,座位数,起飞时间和到达时间(所给形式为HHMM.记得转化),再给出城市A和B.和到达城市B的最晚时间.如今问一天内最多有多少人能从A飞到B, ...

  5. RDA安装

    解压到/home/oracle下面     $ cp /home/oracle/rda $ perl rda.pl -cv   运行上面的命令,如果最后一行出现下面所示,说明没问题       No ...

  6. goland 2018.2 激活

    感谢 http://blog.sina.com.cn/s/blog_1885d23df0102ydjc.html http://www.3322.cc/soft/38102.html 下载   htt ...

  7. HDMI ARC功能详解及应用介绍

    http://www.icpcw.com/Parts/Peripheral/Skill/3260/326044_2.htm [电脑报在线]很多用户和读者购买了电视以后,都发现自己电视的HDMI接口上经 ...

  8. [Angular2Fire] Firebase auth (Google, Github)

    To do auth, first you need to go firebase.console.com to enable the auth methods, for example, enabl ...

  9. Redis主从高可用缓存

    nopCommerce 3.9 大波浪系列 之 使用Redis主从高可用缓存   一.概述 nop支持Redis作为缓存,Redis出众的性能在企业中得到了广泛的应用.Redis支持主从复制,HA,集 ...

  10. C#生成6位随机验证码

    private string VerifyCode() { Random random = new Random(); , ).ToString(); }