I have run it on the local server and it worked perfectly, but when I uploaded it to my web hosting, it stopped working. Basically when I submit the form the browser just keeps loading and when I check the database no data was inserted. I checked my database connection and I was able to connect it but can't get data from it.
This is my php:
<?php
$servername   = "localhost";
$username     = "itclubac_root";
$password     = "*******";
$dbname       = "itclubac_itclub";
$tnp          = 0;
$name         = $_POST['name'];
$email        = $_POST['email'];
$gender       = $_POST['gender'];
$phone        = $_POST['phone'];
$id           = $_POST['id'];
$section      = $_POST['section'];
$skills       = $_POST['skills'];
$interests    = $_POST['interests'];
$expectations = $_POST['expectations'];
$tnp          = $_POST['tnp'];
$ip           = $_SERVER['REMOTE_ADDR'];
if ( $tnp == 0 ) { 
  header('Location: ../../get_involved.php'); 
} else {    
  // Create connection
  $con = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($con->connect_error) {
    die("Connection failed: " . $con->connect_error);
  }
  $query = mysqli_query($con, "SELECT * FROM member_registration WHERE email = '".$email. "'"); 
  if ( mysqli_num_rows($query) > 0 ) {
    header('Location: ../../get_involved.php?status=exist');
  } else {    
    $query = mysqli_query($con, "SELECT * FROM member_registration WHERE college_id = '".$id. "'"); 
    if ( mysqli_num_rows( $query) > 0 ) { 
      header('Location: ../../get_involved.php?status=exist'); 
    } else { 
      $sql = "INSERT INTO member_registration (name, email, gender, phone_no, college_id, section, skills, interests, expectations, ip_address) VALUES ('$name', '$email', '$gender', '+880$phone', '$id', '$section', '$skills', '$interests', '$expectations', '$ip')";
      if ($con->query($sql) === TRUE) {
        header('Location: ../../get_involved.php?status=success'); 
      } 
    } 
  } 
} 
$con->close();
?>
Edit
This is the site: Form Pagehttp://itclub.acc.edu.bd/get_involved.php if you register here, the page will just keep loading. However if you try to access the registration.php directly it sends you to the form page page as I said it to. When I tested it on local, it worked perfectly but after uploading to the host this problem is occurring.
 
    