bookdk

Log ind system

Mar 25th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.11 KB | None | 0 0
  1. <?php
  2.             if(!empty($_POST))
  3.             {
  4.                 $email = mysql_real_escape_string($_POST["email"]);
  5.                 $password = mysql_real_escape_string($_POST["password"]);
  6.                 $gentag = mysql_real_escape_string($_POST["gentag"]);
  7.                 $djnavn = mysql_real_escape_string($_POST["djnavn"]);
  8.                 $profiltekst = mysql_real_escape_string($_POST["profiltekst"]);
  9.                 $facebook = mysql_real_escape_string($_POST["facebook"]);
  10.                 $club = mysql_real_escape_string($_POST["club"]);
  11.                 $booking = mysql_real_escape_string($_POST["booking"]);
  12.                 $hemmelig = mysql_real_escape_string($_POST["hemmelig"]);
  13.                 $pris = mysql_real_escape_string($_POST["pris"]);
  14.                
  15.                
  16.                 $billedefilnavn = null;
  17.    
  18.                     include("include/class.upload.php");
  19.                         $handle = new Upload($_FILES['file']);
  20.                        
  21.                         if($handle->uploaded){
  22.                                 //lidt mere store billeder
  23.                                 $handle->image_resize = true;
  24.                                 $handle->image_ratio_y = true;
  25.                                 $handle->image_x = 220;
  26.                                 $handle->Process("profil/big_img");
  27.                                     //til profil billede lign..
  28.                                     $handle->image_resize = true;
  29.                                     $handle->image_ratio_crop = true;
  30.                                     $handle->image_y = 75;
  31.                                     $handle->image_x = 75;
  32.                                     $handle->Process("profil");                
  33.                             $billedefilnavn = $handle->file_dst_name;
  34.  
  35.                                 echo '<p>Billedet: '.$billedefilnavn.'<br></p>';
  36.                                 echo "<p>Dit billede blev upload<br></p>";
  37.                            
  38.                         }else{
  39.                                 $billedefilnavn = 'bruger_intet.png';
  40.                             }
  41.                
  42.                 $bruger = mysql_query("SELECT NULL FROM brugere WHERE email='$email'");
  43.                 if(mysql_num_rows($bruger) > 0)
  44.                 {
  45.                     echo "<p style=\"color:#f00;\">Email er optaget, Prøve igen</p>";
  46.                 }
  47.                 else
  48.                 {
  49.                    
  50.                     $errors = array
  51.                 (
  52.                     "email" => "Husk du skal indtaste en email som brugernavn.",
  53.                     "password" => "Husk du skal indtaste et password.",
  54.                     "gentag" => "Husk de to passwordfelter skal have ens indhold og password.",
  55.                     "djnavn" => "Husk at indsæt Djnavn.",
  56.                     "profiltekst" => "Husk at tilføj noget profil tekst.",
  57.                     "facebook" => "Husk at tilføj ritgit facebook.",
  58.                     "booking" => "Husk Booking Email.",
  59.                     "hemmelig" => "Husk hemmelig kode ord.",
  60.                     "pris" => "Husk en pris.",
  61.                     "club" => "Husk club sted."
  62.                     );
  63.                    
  64.                     if(!empty($pris))
  65.                     {
  66.                         unset($errors["pris"]);
  67.                     }
  68.                     if(!empty($club))
  69.                     {
  70.                         unset($errors["club"]);
  71.                     }
  72.                     if(!empty($email))
  73.                     {
  74.                         unset($errors["email"]);
  75.                     }
  76.                     if(!empty($password))
  77.                     {
  78.                         unset($errors["password"]);
  79.                     }
  80.                     if(!empty($gentag) && $gentag == $password)
  81.                     {
  82.                         unset($errors["gentag"]);
  83.                     }
  84.                     if(!empty($djnavn))
  85.                     {
  86.                         unset($errors["djnavn"]);
  87.                     }
  88.                     if(!empty($profiltekst))
  89.                     {
  90.                         unset($errors["profiltekst"]);
  91.                     }
  92.                     if(!empty($facebook))
  93.                     {
  94.                         unset($errors["facebook"]);
  95.                     }
  96.                     if(!empty($booking))
  97.                     {
  98.                         unset($errors["booking"]);
  99.                     }
  100.                     if(!empty($hemmelig))
  101.                     {
  102.                         unset($errors["hemmelig"]);
  103.                     }
  104.                    
  105.                     if(empty($errors))
  106.                     {
  107.                         $password = sha1($password);
  108.                         $insert = mysql_query("INSERT INTO brugere (email,password,profilbillede,djnavn,profiltekst,facebook,club,pris,booking,hemmelig)
  109.                         VALUES ('$email', '$password','$billedefilnavn','$djnavn','$profiltekst','$facebook','$club','$pris','$booking','$hemmelig')");
  110.                        
  111.                         if(!$insert)
  112.                         {
  113.                             header('Location: fejl.php');
  114.                             exit();
  115.                         }
  116.                         else
  117.                         {
  118.                             header('Location: index.php');
  119.                             exit();
  120.                         }
  121.                     }
  122.                     else
  123.                     {
  124.                         echo "<div id=\"box\"><h4>HUSK DET HER!!</h4><ul><li>" . implode("</li><li>", $errors) . "</li></ul></div>";
  125.                     }
  126.                 }
  127.             }
  128.         ?>
  129.     <form action="" method="post" enctype="multipart/form-data">
  130.     <input type="email" name="email" placeholder="Email Adresse" id="brugerinfomation">
  131.     <br>
  132.     <input type="password" name="password" placeholder="Adgangskode" id="brugerinfomation">
  133.     <br>
  134.     <input type="password" name="gentag" placeholder="Gentag Adgangskode" id="brugerinfomation">
  135.     <br>
  136.     <h3>Privat Infomation Indhold</h3>
  137.     <input type="text" name="djnavn" placeholder="Djnavn" id="brugerinfomation">
  138.     <br>
  139.     <input type="text" name="club" placeholder="Club steder" id="brugerinfomation">
  140.     <br>
  141.     <input type="text" name="pris" placeholder="Pris" id="brugerinfomation">
  142.     <br>
  143.     <input type="email" name="booking" placeholder="Booking email" id="brugerinfomation">
  144.     <br>
  145.     <input type="text" name="facebook" placeholder="Facebook Fan side" id="brugerinfomation">
  146.     <br>
  147.     <h3>Profil Tekst</h3>
  148.     <textarea name="profiltekst" style="width:605px; height:155px;"></textarea><br />
  149.     <input type="file" name="file"><br>
  150.     <input type="text" name="hemmelig" placeholder="Hemmelig kodeord" id="brugerinfomation">
  151.     <br>
  152.     <input type="submit" value="Godkendt Profil">
  153.     <script>
  154.         $(function(){
  155.             $('#box').hide().fadeIn(3000);
  156.         });
  157.     </script>
Advertisement
Add Comment
Please, Sign In to add comment