doChannel.php 848 B

1234567891011121314151617181920
  1. <?php
  2. // $channel_id = $_POST["channel_id"];
  3. $channel_name = $_POST['channel_name'];
  4. $channel_type = $_POST['channel_type'];
  5. $channel_leader = $_POST['channel_leader'];
  6. $channel_phone = $_POST['channel_phone'];
  7. $channel_ctime = $_POST['channel_ctime'];
  8. include_once("../../untils/conn.php");
  9. if ($con) {
  10. mysqli_query($con, "set names utf8");
  11. $data = mysqli_query($con, "insert into channel(channel_name,channel_type,channel_leader,channel_phone,channel_ctime) values('$channel_name','$channel_type','$channel_leader','$channel_phone','$channel_ctime')");
  12. if ($data) {
  13. echo ("<script>alert('添加渠道成功')</script>");
  14. echo ("<script>window.location.href='../channel.php'</script>");
  15. } else {
  16. echo ("<script>alert('添加渠道失败');history.back();</script>");
  17. // echo "Error updating record: " . $con->error;
  18. }
  19. }