我有PHP脚本,我认为停止工作时,我升级到PHP 8.1从7.4 [关闭]

zbdgwd5y  于 2023-04-04  发布在  PHP
关注(0)|答案(1)|浏览(151)

**已关闭。**此问题需要debugging details。当前不接受答案。

编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
2天前关闭。
Improve this question
我是新来的。因为我不得不跳到deep end。但是,我有这个php脚本,现在它已经停止工作了....我想是因为我从7.4升级到php 8.1。我已经仔细检查了数据库表,select查询应该返回一个结果,但我一直得到第一个die语句。
有没有人看出它有什么问题?我想这和比较运算符有关。
任何帮助都很感激!谢谢。

  1. <?
  2. require("../phpsqlajax_dbinfoi.php");
  3. if(isset($_POST['usrname'])) {$usr = $_POST['usrname'];}
  4. if(isset($_POST['hash'])) {$pwd = $_POST['hash'];}
  5. $query = "SELECT * FROM members_directory where username='".$usr."' and bulkmail=1";
  6. $result = mysqli_query($connection,$query);
  7. $rows=0;
  8. $rows = mysqli_num_rows($result);
  9. if($rows==0) die("Sorry, there is a HSB username/password mismatch and/or you don't have BulkMail priviledges");
  10. $row = @mysqli_fetch_assoc($result);
  11. $correct_hash=$row['hash'];
  12. if(password_verify($pwd, $correct_hash))
  13. {
  14. session_start();
  15. $_SESSION['usr'] = $usr;
  16. $_SESSION['name'] = $row['Name'];
  17. $_SESSION['user_id'] = $row['ID'];
  18. }
  19. else die("Sorry, there is a HSB username/password mismatch and/or you don't have BulkMail priviledges");
  20. ?>`

这是能够批量向我的分发列表发送电子邮件的过程中的第一步。这是一个登录检查,以确保用户有访问/权限使用我们网站上的批量电子邮件过程。

8xiog9wr

8xiog9wr1#

首先,您的文件应该以<?php而不是<?开头
如果有条件,请确保启动$user$pwd

  1. $usr = "";
  2. $pwd = "";
  3. if (isset($_POST['usrname'])) {
  4. $usr = $_POST['usrname'];
  5. }
  6. if (isset($_POST['hash'])) {
  7. $pwd = $_POST['hash'];
  8. }

相关问题