title: PHP: Call to undefined function mssql_connect()
body: <p>I'm trying to set up a registration page for my gaming service, seems like i'm stucked here :\</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;table class='ipb_table' cellspacing="1"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td class='row2'&gt;
  
  &lt;?php 
  
  // fill in your mssql info here 
  
  $mssql = array( 
          'host' =&gt; "zzzzzzzzzz", 
          'user' =&gt; "yyyyyyyyyy", 
          'pass' =&gt; "xxxxxxxxxx" 
      ); 
  
  function anti_injection($sql) { 
     $sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|&amp;#092;*|--|&amp;#092;&amp;#092;&amp;#092;&amp;#092;)/"),"",$sql); 
     $sql = trim($sql); 
     $sql = strip_tags($sql); 
     $sql = addslashes($sql); 
     return $sql; 
  } 
  
  
  echo "&lt;center&gt;"; 
  
  if($_POST['activ'] == '1') { 
  
          $accname = anti_injection($_POST['accname']); 
          $accmail = anti_injection($_POST['accmail']); 
  
          $accpass1 = anti_injection($_POST['accpass1']); 
          $accpass2 = anti_injection($_POST['accpass2']); 
  
          $con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
  
          $result1 = mssql_query("SELECT * FROM account.dbo.USER_PROFILE WHERE user_id = '".$accname."'",$con); 
          $result2 = mssql_query("SELECT * FROM account.dbo.Tbl_user WHERE user_id = '".$accname."'",$con); 
          $result3 = mssql_query("SELECT * FROM account.dbo.Tbl_user WHERE user_mail = '".$accmail."'",$con); 
  
          $row1 = mssql_num_rows($result1); 
          $row2 = mssql_num_rows($result2); 
          $row3 = mssql_num_rows($result3); 
  
          $dk_time=strftime("%y%m%d%H%M%S"); 
           list($usec1, $sec1) = explode(" ",microtime()); 
           $dk_user_no=$dk_time.substr($usec1,2,2); 
  
  
          if(empty($accname) || empty($accpass1) || empty($accpass2)|| empty($accname) || empty($accmail)) { 
              echo "&lt;br&gt;You didnt fill in all fields&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif($row1 &gt; '0' || $row2 &gt; '0') { 
              echo "&lt;br&gt;This Account name already exists.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif($row3 &gt; '0') { 
              echo "&lt;br&gt;This E-Mail is already in use.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif($accpass1 != $accpass2) { 
              echo "&lt;br&gt;The passwords did not match&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif($accpass1 == $accname) { 
              echo "&lt;br&gt;Account name and password are the same.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif(!preg_match("/^[0-9a-zA-Z]{3,15}$/i", $accname)) { 
              echo "&lt;br&gt;Enter a account name only with 0-9 , a-z and A-Z.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif(!preg_match("/^[0-9a-zA-Z]{3,15}$/i", $accpass1)) { 
              echo "&lt;br&gt;Enter a password only with 0-9 , a-z and A-Z.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif(!preg_match("/^&amp;#092;w+([-+.]&amp;#092;w+)*@&amp;#092;w+([-.]&amp;#092;w+)*&amp;#092;.&amp;#092;w+([-.]&amp;#092;w+)*$/i",$accmail)) { 
              echo "&lt;br&gt;Your e-Mail is not correct.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif(strlen($accname) &lt; 3 || strlen($accname) &gt; 15) { 
              echo "&lt;br&gt;The Accountname must at least 3 indications long and may maximally 15 indications long.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } elseif(strlen($accpass1) &lt; 3 || strlen($accpass1) &gt; 15) { 
              echo "&lt;br&gt;The Password must at least 3 indications long and may maximally 15 indications long.&lt;a href='javascript:history.back()'&gt;Go Back&lt;/a&gt;"; 
          } else { 
  
              $accpass = md5($accpass1); 
  
              mssql_query("INSERT INTO account.dbo.USER_PROFILE (user_no,user_id,user_pwd,resident_no,user_type,login_flag,login_tag,ipt_time,login_time,logout_time,user_ip_addr,server_id) VALUES ('$dk_user_no','".$accname."','".$accpass."','801011000000','1','0','Y','".$date."',null,null,null,'000')",$con);
              mssql_query("INSERT INTO account.dbo.Tbl_user (user_no,user_id,user_pwd,user_mail,user_answer,user_question) VALUES ('$dk_user_no','".$accname."','".$accpass1."','".$accmail."','0','0')",$con);
  
              echo "&lt;center&gt;&lt;b&gt;&lt;u&gt;The account was successfully created. Have fun !&lt;/b&gt;&lt;/u&gt;&lt;/center&gt;&lt;br&gt;&lt;br&gt;"; 
              echo "&lt;center&gt;Here is your login info again:&lt;/center&gt;"; 
              echo "&lt;center&gt;Your account name is: &lt;b&gt;".$accname."&lt;/b&gt;&lt;/center&gt;"; 
              echo "&lt;center&gt;Your password is: &lt;b&gt;".$accpass1."&lt;/b&gt;&lt;/center&gt;"; 
              echo "DO NOT LOOSE THIS INFO, YOU MAY WRITE IS DOWN AND HIDE IT"; 
          } 
  
  } else { 
  
      $con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']); 
      $result1 = mssql_query("SELECT * FROM account.dbo.USER_PROFILE",$con); 
      $row1 = mssql_num_rows($result1); 
  
      echo "&lt;center&gt;&lt;b&gt;&lt;u&gt;This time we have ".$row1." Registed Accounts on our Server&lt;br&gt;Join us.&lt;/b&gt;&lt;/u&gt;&lt;/center&gt;&lt;br&gt;"; 
      echo "&lt;form action='".$_SEVER['PHP_SELF']."' method='POST'&gt;"; 
      echo "&lt;center&gt;&lt;table&gt;"; 
      echo "&lt;tr&gt;&lt;td colspan='2' align='center'&gt;&lt;b&gt;&lt;u&gt;Your Account Info&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td&gt;Account Name&lt;/td&gt;&lt;td&gt;&lt;input type='text' name='accname' maxlength='12'&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td&gt;Password&lt;/td&gt;&lt;td&gt;&lt;input type='password' name='accpass1' maxlength='12'&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td&gt;Again pass.&lt;/td&gt;&lt;td&gt;&lt;input type='password' name='accpass2' maxlength='12'&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td colspan='2' align='center'&gt;&lt;b&gt;&lt;u&gt;Other account info&lt;/u&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td&gt;Email&lt;/td&gt;&lt;td&gt;&lt;input type='text' name='accmail' maxlength='50'&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;tr&gt;&lt;td colspan='2' align='center'&gt; 
          &lt;input type='hidden' name='activ' value='1'&gt; 
          &lt;input type='submit' value='Create Account'&gt;&lt;/td&gt;&lt;/tr&gt;"; 
      echo "&lt;/table&gt;&lt;/center&gt;"; 
      echo "&lt;/form&gt;"; 
  
  } 
  
  echo "&lt;/center&gt;"; 
  
  ?&gt;
  
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This error is killing me, i really dont know whats wrong. If someone could help me by telling me how to fix this problem, i would be really happy! :D Also if someone have the time to clean as much as possible my script would be amazing :D</p>
  
  <p>Please try to be really detailed so i can learn something new ^^</p>