douxing9228 2014-10-24 11:10
浏览 74

使用php codeigniter创建一个电子邮件检查器

Please help me in creating a form which allows a user to submit valid email.

When someone try to enter an email id, it should be validated before submitted to data base. Some of the examples for junk email ids are test@abc.com, 123@xyz.com etc.

If an user try to enter an email id as mentioned in the above example, it should be verified whether it is a valid email id or not and also check if the user with the email id already exists?

Kindly help me building a code in php codeigniter.

  • 写回答

3条回答 默认 最新

  • duanqianwei2485 2014-10-24 11:16
    关注

    There is a build-in functionality in CI handling this for you. It is in the form validation library.

    See: https://ellislab.com/codeigniter/user-guide/libraries/form_validation.html

    $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
    

    note the valid_email rule which is already provided for you.

    Hope it helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧