doSms.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. $appid = $_POST['appid'];
  3. $appkey = $_POST['appkey'];
  4. $te_id = $_POST['te_id'];
  5. $te_ids = $_POST['te_ids'];
  6. $sign = $_POST['sign'];
  7. $admin_phone = $_POST['admin_phone'];
  8. include_once("../../untils/conn.php");
  9. if ($con) {
  10. mysqli_query($con, "set names utf8");
  11. $result = mysqli_query($con, "SELECT * FROM sms WHERE id=1");
  12. if (mysqli_num_rows($result) > 0) {
  13. $data = mysqli_query($con, "UPDATE sms SET appid='$appid', appkey='$appkey', te_id='$te_id', te_ids='$te_ids', sign='$sign', admin_phone='$admin_phone' WHERE id=1");
  14. if ($data > 0) {
  15. echo "<script>alert('修改信息成功');window.location.href='../Smsytem.php'</script> ";
  16. } else {
  17. echo ("<script>alert('修改失败');window.location.replace(document.referrer)</script>");
  18. }
  19. } else {
  20. $data = mysqli_query($con, "INSERT INTO sms (appid, appkey, te_id, te_ids, sign, admin_phone) VALUES ('$appid', '$appkey', '$te_id', '$te_ids', '$sign', '$admin_phone')");
  21. if ($data > 0) {
  22. echo "<script>alert('添加信息成功');window.location.href='../Smsytem.php'</script> ";
  23. } else {
  24. echo ("<script>alert('添加失败');window.location.replace(document.referrer)</script>");
  25. }
  26. }
  27. }
  28. $con->close();
  29. ?>