【问题标题】:I am trying to do a simple connection with XAMPP and MySQL server, but whenever I try to enter data or connect to the database [duplicate]我正在尝试与 XAMPP 和 MySQL 服务器进行简单连接,但是每当我尝试输入数据或连接到数据库时 [重复]
【发布时间】:2021-06-22 10:24:20
【问题描述】:

致命错误:未捕获错误:调用 C:\xampp\htdocs\codes\owy\login.php:73 中未定义的函数 verify_users() 堆栈跟踪:#0 {main} 在 C:\xampp\htdocs\ 中抛出第 73 行的代码\owy\login.php

代码:

<?php 
    if(isset($_POST['user'])){
        $error = verify_users($_POST['user'],$_POST['password']);                                   
    }else{
        echo '<div class="form-group">
                <label class="control-label col-md-3 col-md-offset-1" for="Email">Email</label>
                <div class="col-md-8">
                    <input class="form-control text-box single-line" data-val="true" data-val-required="Please enter an email" name="user"id="user" type="text" value="" />
                    <span class="field-validation-valid text-danger" data-valmsg-for="Email" data-valmsg-replace="true"></span>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-md-3 col-md-offset-1" for="Password">Password</label>
                <div class="col-md-8">
                    <input class="form-control text-box single-line password" data-val="true" data-val-required="Please enter a password" name="password" id="password" type="password" value=""/>
                    <span class="field-validation-valid text-danger" data-valmsg-for="Password" data-valmsg-replace="true"></span>
                </div>
            </div>
            <div class="form-group">
            <div class="col-md-10 col-md-offset-1 form-inline">
                <input type="submit" value="Log in" class="btn btn-primary pull-right" />
            </div>
            </div>';
    }   

【问题讨论】:

  • 您能否提供包含与数据库连接的代码,以便我进一步帮助您。谢谢。
  • 嗯,错误是直截了当的,函数verify_user 不存在。您是否忘记包含定义此功能的文件?
  • "Call to undefined function verify_users()" 似乎不言自明。您是否有理由认为应该定义该功能?如果是,那是什么原因?

标签: php mysql database


【解决方案1】:

您尝试调用 verify_users 函数,但之前未定义。请在使用该函数之前检查您的函数定义或分享您的代码行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-13
    • 2014-02-25
    • 1970-01-01
    • 2023-03-13
    • 2021-09-12
    • 2019-09-23
    • 2019-12-30
    相关资源
    最近更新 更多