原文: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. 读<阿里亿级日活网关通道架构演进>有感

    读<阿里亿级日活网关通道架构演进>时对优化方法有些概念不理解,特意搜索了一下,拓展自己的思路. 其中的优化: 优化方法中1,2比较常见,3,4我知道的比较少,很感兴趣.就继续追踪下去: 于 ...

  2. ZOJ 2679 Old Bill ||ZOJ 2952 Find All M^N Please 两题水题

    2679:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1679 2952:http://acm.zju.edu.cn/onli ...

  3. autohotkey 自动登录输入用户名密码 getElementsByTagName/getElementsByClassName/getElementById

    针对button未设置id的.可以通过getElementsByTagName获取button的对象数组,再明确其在对象数组中的位置,如第4个button,通过[3]获取.再调用此对象的click() ...

  4. shiro 中的filterChainDefinitions详解(转)

    springrain使用shiro控制权限,配置filterChainDefinitions结合数据库校验权限. 我们在web.xml中配置一个全局过滤器,也就是在springrain配置的是一个sp ...

  5. MFC的CListCtrl的使用与技巧

    http://blog.csdn.net/artechtor/article/details/2508070 列表控件可以看作是功能增强的ListBox,它提供了四种风格,而且可以同时显示一列的多中属 ...

  6. kernel-char设备的建立

    kernel下的设备分成了一些类,char block char.. 这里就贴出来一个样例能够建立一个char设备 ,抛砖引玉吧 这是kernel中的 drivers/char/msm_smd_pkt ...

  7. 高性能 Python —— vectorization

    首先来看一段判断一个整数数是否为素数的函数,然后从计算机内部计算流程的角度对其进行分析: import math def check_prime(number): sqrt_number = math ...

  8. UE4的JSON读写方式<一>

    声明:所有权利保留. 转载必须说明出处:http://blog.csdn.net/cartzhang/article/details/41009343 UE4的Json的解析博客地址: http:// ...

  9. https://github.com/zhangxianyi/Source-Insight-Plugin

    https://github.com/zhangxianyi/Source-Insight-Plugin

  10. 【u002】数列排序(seqsort)

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 给定一个数列{an},这个数列满足ai≠aj(i≠j),现在要求你把这个数列从小到大排序,每次允许你交 ...