why this code work on local host and not work on hosting
<pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
    &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" lang="ar"&gt;
    &lt;head&gt;
            &lt;meta http-equiv="content-type" content="text/html;charset= utf-8" /&gt;
                &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
        &lt;title&gt;ahmed fakhr el din&lt;/title&gt;
    &lt;/head&gt;


    &lt;body&gt;

&lt;div id="regform"&gt;
&lt;h2&gt; Ù†Ù…ÙˆØ°Ø¬ ØªØ³Ø¬ÙŠÙ„&lt;/h2&gt;
&lt;?php

    if(isset($_POST['submit'])){// Click on complete button

        $error=array();
        if(empty($_POST['uname']) || trim($_POST['uname'])=="")
            $error[]="Ø®Ø·Ø£ : Ø®Ø§Ù†Ø© Ø§Ø³Ù… Ø§Ù„Ù…Ø³ØªØ®Ø¯Ù… ÙØ§Ø±ØºØ©";
        if(empty($_POST['fname']) || trim($_POST['fname'])=="")
            $error[]="Ø®Ø·Ø£:Ø®Ø§Ù†Ø© Ø§Ù„Ø§Ø³Ù… Ø§Ù„Ø§ÙˆÙ„ ÙØ§Ø±ØºØ©";
        if(empty($_POST['password']) || trim($_POST['password'])=="")
            $error[]="Ø®Ø·Ø£ : Ø®Ø§Ù†Ø© Ø§Ù„ÙƒÙ„Ù…Ø© Ø§Ù„Ø³Ø±ÙŠØ© ÙØ§Ø±ØºØ©";
        if(empty($_POST['password2']) || trim($_POST['password2'])=="")
            $error[]="Ø®Ø·Ø£ Ø®Ø§Ù†Ø©  ØªØ£ÙƒÙŠØ¯ Ø§Ù„ÙƒÙ„Ù…Ø© Ø§Ù„Ø³Ø±ÙŠØ© ÙØ§Ø±ØºØ©";
        if(empty($_POST['email'])|| trim($_POST['email'])=="")
            $error[]="Ø®Ø·Ø£ : Ø®Ø§Ù†Ø© Ø§Ù„Ø¨Ø±ÙŠØ¯ Ø§Ù„Ø§Ù„ÙƒØªØ±ÙˆÙ†ÙŠ ÙØ§Ø±ØºØ©";
        if(empty($_POST['email2'])|| trim($_POST['email2'])=="")
            $error[]="Ø®Ø·Ø£ : Ø®Ø§Ù†Ø© ØªØ£ÙƒÙŠØ¯ Ø§Ù„Ø¨Ø±ÙŠØ¯ Ø§Ù„Ø§Ù„ÙƒØªØ±ÙˆÙ†ÙŠ ÙØ§Ø±ØºØ©";
        if(empty($_POST['age'])|| trim($_POST['age'])=="")
            $error[]="Ø®Ø·Ø£ :Ø®Ø§Ù†Ø© Ø§Ù„Ø¹Ù…Ø± ÙØ§Ø±ØºØ©";

        if(strlen($_POST['uname'])&lt;4)
            $error[]="Ø­Ø·Ø£ :  ÙŠØ¬Ø¨ Ø§Ù† ÙŠØªÙƒÙˆÙ† Ø§Ø³Ù… Ø§Ù„Ù…Ø³ØªØ®Ø¯Ù…Ù† Ø§ÙƒØ«Ø± 4 Ø­Ø±ÙˆÙ";

        if(strlen($_POST['password'])&lt;4 || strlen($_POST['password2'])&lt;4)
            $error[]="Ø®Ø·Ø£ Ø§Ù„ÙƒÙ„Ù…Ø© Ø§Ù„Ø³Ø±ÙŠØ© ÙŠØ¬Ø¨ Ø§Ù† ØªØªÙƒÙˆÙ† Ù…Ù† Ø§ÙƒØ«Ø± Ù…Ù† 6 Ø­Ø±ÙˆÙ";

        if($_POST['password']!=$_POST['password2'])
            $error[]="Ø®Ø·Ø£ : Ø§Ù„ÙƒÙ„Ù…Ø§Øª Ø§Ù„Ø³Ø±ÙŠØ© ØºÙŠØ± Ù…ØªØ·Ø§Ø¨Ù‚Ø©";
            //Validating Emails 

            if(!preg_match("/^[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9](.[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])+$/",$_POST['email'])
                ||
                !preg_match("/^[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9](.[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])+$/",$_POST['email2']))
        $error[]="Ø®Ø·Ø£: Ø§Ù„Ø¨Ø±ÙŠØ¯ Ø§Ù„Ø§Ù„ÙƒØªØ±ÙˆÙ†ÙŠ ØºÙŠØ± ØµØ§Ù„Ø­";



        if($_POST['email']!=$_POST['email2'])
            $error[]="Ø®Ø·Ø£ : Ø§Ù„Ø¨Ø±ÙŠØ¯ Ø§Ù„Ø§Ù„ÙƒØªØ±ÙˆÙ†ÙŠ ØºÙŠØ± Ù…ØªØ·Ø§Ø¨Ù‚";

        if(!is_numeric($_POST['age']))
            $error[]="Ø®Ø·Ø£ : Ø§Ù„Ø¹Ù…Ø± Ø§Ù„Ù…Ø¯Ø®Ù„ Ù„ÙŠØ³ Ù‚ÙŠÙ…Ø© Ø±Ù‚Ù…ÙŠØ©";


if(sizeof($error)&gt;0){
            echo "&lt;div id=\"error\"&gt;";
            echo "&lt;ul&gt;";                
    foreach($error as $k=&gt;$v){
            echo "&lt;li&gt; ";
            echo $v;
            echo "&lt;/li&gt;";           
        }
            echo "&lt;/ul&gt;";
            echo "&lt;/div&gt;";

        }


            else{
        include "conf.php";
                // Random confirmation code
                $confirm_code=uniqid(rand());
                $username=$_POST['uname'];
                $fname=$_POST['fname'];
                $password=$_POST['password'];
                $email=$_POST['email'];
                $age=$_POST['age'];
                $gender=$_POST['gender'];
                $adduser= mysql_query("INSERT INTO USERS VALUES('$confirm_code','$username','$fname','$password','$email','$age','$gender')");
                 // send e-mail to ...
                  $to=$email;

                 // Your subject
              $subject="Your confirmation link here";

                   // From
              $header="from: your name &lt;your email&gt;";

                   // Your message
              $message="Your Comfirmation link \r\n";
              $message.="Click on this link to activate your account \r\n";
              $message.="http://www.sufiacademy.net/confirmation.php?passkey=$confirm_code";
                        // send email
              $sentmail = mail($to,$subject,$message,$header);
                if($adduser and $sentmail){

                    echo "&lt;div id=\"succes\"&gt;";
                    echo "  register succesfully";
                    echo "&lt;/div&gt;";

                }

            }

        }



?&gt;
    &lt;ul&gt;
    &lt;form method="post" action="index.php"&gt;
        &lt;li&gt;&lt;label&gt;Ø§Ø³Ù… Ø§Ù„Ù…Ø³ØªØ®Ø¯Ù… :&lt;/label&gt; &lt;span&gt;&lt;input type="text" name="uname" /&gt;&lt;/span&gt; &lt;/li&gt;
        &lt;li&gt;&lt;label&gt; Ø§Ù„Ø§Ø³Ù… Ø§Ù„Ø§ÙˆÙ„: &lt;/label&gt; &lt;span&gt;&lt;input type="text" name="fname" /&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;label&gt; Ø§Ù„ÙƒÙ„Ù…Ø© Ø§Ù„Ø³Ø±ÙŠØ©: &lt;/label&gt; &lt;span&gt;&lt;input type="password" name="password" /&gt;&lt;/span&gt; &lt;/li&gt;
        &lt;li&gt;&lt;label&gt; ØªØ£ÙƒÙŠØ¯ Ø§Ù„ÙƒÙ„Ù…Ø© Ø§Ù„Ø³Ø±ÙŠØ©: &lt;/label&gt;  &lt;span&gt;&lt;input type="password" name="password2" /&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;label&gt; Ø§Ù„Ø¨Ø±ÙŠØ¯ Ø§Ù„Ø§Ù„ÙƒØªØ±ÙˆÙ†ÙŠ: &lt;/label&gt;  &lt;span&gt;&lt;input type="text" name="email" /&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;label&gt; ØªØ£ÙƒÙŠØ¯ Ø§Ù„Ø¨Ø±ÙŠØ¯ Ø§Ù„Ø§Ù„ÙƒØªØ±ÙˆÙ†ÙŠ: &lt;/label&gt;  &lt;span&gt;&lt;input type="text" name="email2" /&gt;&lt;/span&gt; &lt;/li&gt;
        &lt;li&gt;&lt;label&gt; Ø§Ù„Ø¹Ù…Ø±: &lt;/label&gt;  &lt;span&gt;&lt;input type="text" name="age" /&gt;&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;label&gt; Ø§Ù„Ø¬Ù†Ø³: &lt;/label&gt;&lt;span&gt;&lt;select name="gender"&gt;&lt;option&gt;Ø°ÙƒØ±&lt;/option&gt; &lt;option&gt;Ø§Ù†Ø«Ù‰&lt;/option&gt; &lt;/select&gt; &lt;/span&gt; &lt;/li&gt;
        &lt;li&gt; &lt;input type="submit" class="submit" value="Ø§ÙƒÙ…Ø§Ù„" name="submit"/&gt; &lt;/li&gt;
        &lt;/form&gt;
    &lt;/ul&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
