redirect in wordpress after query?

In WordPress, after form submission I am trying to redirect to another page, but I cannot with the following:

if(isset($_POST['name']))
{
      $q=mysql_query("INSERT INTO `contactsus` (name, email, location, mobile, subject, comment, created) VALUES('$name', '$email', '$location', '$mobile', '$subjct', '$comment',  '".time()."') ");
      if($q)
      {
          echo '{"responce":"1","message":"Thanks for the registration","url":"'.$_SESSION['SITE_URL'].student.'"}';
      }
      else
      { 
        echo '{"responce":"0","message":"Your registration request has been failed due to system error"}';
      }
}

The result of this code is:

{
  "responce":"1",
  "message":"Thanks for the registration",
  "url":"http://localhost/manishatutors/student"
}

Related posts

Leave a Reply

2 comments