我一直在研究一个非常大的带有重置按钮的 html 表单。重置时,会发生数据库操作。
我有一个这样的javascript函数,它在重置时被调用:
function clearDatabaseOfAnySavedForm() {
    window.name = 1;                        
    $.post('assets/scripts/reset-form.php');    
    window.location.reload();
    $(document).load().scrollTop(0);            
    return false;
}
此函数中引用的 php 文件的代码为:
<?php
    //Authcate
    $authcate = xxxxx;  
    $username = "xxxxx";
    $password = "xxxxx";
    //$hostname = "xxxxx";  
    $hostname = "xxxxx";  
    $database = "xxxxx";
    $conn = mysql_connect($hostname, $username, $password);
    mysql_select_db($database, $conn) or die( "Unable to select database");  
    if (!empty($authcate)) {        
        $table = "xxxxx";
        $sqlSelectQuery = "SELECT * FROM $table WHERE authcate = '$authcate'";
        $selectResults = mysql_query($sqlSelectQuery);
        $selectNumResults = mysql_num_rows($selectResults);
        if ($selectNumResults > 0) {
            $sqlUpdateQuery = "DELETE FROM $table WHERE authcate = '$authcate'";
            $result = mysql_query($sqlUpdateQuery);
        } 
    }
    mysql_close($conn); 
}
所有浏览器都可以正常工作,但由于某种原因,php 文件不会在 Firefox 中被调用。有没有人有任何建议的想法?