Doinproxy.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. include_once("../../untils/conn.php");
  3. $proxy_acc = $_POST['proxy_acc'];
  4. $proxy_pass = $_POST['proxy_password'];
  5. $proxy_phone =$_POST['proxy_phone'];
  6. $proxy_name = $_POST['proxy_name'];
  7. $proxy_rename = $_POST['proxy_rename'];
  8. $proxy_uid = $_POST['proxy_uid'];
  9. $proxy_rename_sta = 1;
  10. $proxy_type = $_POST['proxy_type'];
  11. $group_id =$_POST['group_id'];
  12. $cr_time = $_POST['cr_time'];
  13. // 查询proxy数据表中是否存在相同的proxy_acc值
  14. $sql = "SELECT * FROM proxy WHERE proxy_acc = '$proxy_acc'";
  15. $result = mysqli_query($con, $sql);
  16. if(mysqli_num_rows($result) > 0) {
  17. // 如果查询结果不为空,则说明该账号已存在,返回提示信息
  18. echo "<script>alert('该账号已存在,请重新添加');</script>";
  19. echo ("<script>window.location.href='../proxylist.php'</script>");
  20. } else {
  21. // 如果查询结果为空,则可以执行INSERT语句将数据写入数据库
  22. $sql = "INSERT INTO proxy (proxy_acc, proxy_pass, proxy_phone, proxy_name, proxy_rename, proxy_uid, proxy_rename_sta, proxy_type, cr_time, group_id) VALUES ('$proxy_acc', '$proxy_pass','$proxy_phone','$proxy_name','$proxy_rename','$proxy_uid','$proxy_rename_sta','$proxy_type','$cr_time','$group_id')";
  23. if(mysqli_query($con, $sql)) {
  24. $proxy_id = mysqli_insert_id($con); // 获取刚刚插入数据的自增ID
  25. // 将proxy_id插入到shopsy表中的puid字段中
  26. $sql = "INSERT INTO shopsy (puid) VALUES ('$proxy_id')";
  27. mysqli_query($con, $sql);
  28. echo "<script>alert('提交成功');</script>";
  29. echo ("<script>window.location.href='../proxylist.php'</script>");
  30. } else {
  31. echo "<script>alert('好像发送了意外,请稍后再试');</script>";
  32. echo ("<script>window.location.href='../proxylist.php'</script>");
  33. // echo "Error updating record: " . $con->error;
  34. }
  35. }
  36. ?>