Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!empty($_POST))
- {
- $email = mysql_real_escape_string($_POST["email"]);
- $password = mysql_real_escape_string($_POST["password"]);
- $gentag = mysql_real_escape_string($_POST["gentag"]);
- $djnavn = mysql_real_escape_string($_POST["djnavn"]);
- $profiltekst = mysql_real_escape_string($_POST["profiltekst"]);
- $facebook = mysql_real_escape_string($_POST["facebook"]);
- $club = mysql_real_escape_string($_POST["club"]);
- $booking = mysql_real_escape_string($_POST["booking"]);
- $hemmelig = mysql_real_escape_string($_POST["hemmelig"]);
- $pris = mysql_real_escape_string($_POST["pris"]);
- $billedefilnavn = null;
- include("include/class.upload.php");
- $handle = new Upload($_FILES['file']);
- if($handle->uploaded){
- //lidt mere store billeder
- $handle->image_resize = true;
- $handle->image_ratio_y = true;
- $handle->image_x = 220;
- $handle->Process("profil/big_img");
- //til profil billede lign..
- $handle->image_resize = true;
- $handle->image_ratio_crop = true;
- $handle->image_y = 75;
- $handle->image_x = 75;
- $handle->Process("profil");
- $billedefilnavn = $handle->file_dst_name;
- echo '<p>Billedet: '.$billedefilnavn.'<br></p>';
- echo "<p>Dit billede blev upload<br></p>";
- }else{
- $billedefilnavn = 'bruger_intet.png';
- }
- $bruger = mysql_query("SELECT NULL FROM brugere WHERE email='$email'");
- if(mysql_num_rows($bruger) > 0)
- {
- echo "<p style=\"color:#f00;\">Email er optaget, Prøve igen</p>";
- }
- else
- {
- $errors = array
- (
- "email" => "Husk du skal indtaste en email som brugernavn.",
- "password" => "Husk du skal indtaste et password.",
- "gentag" => "Husk de to passwordfelter skal have ens indhold og password.",
- "djnavn" => "Husk at indsæt Djnavn.",
- "profiltekst" => "Husk at tilføj noget profil tekst.",
- "facebook" => "Husk at tilføj ritgit facebook.",
- "booking" => "Husk Booking Email.",
- "hemmelig" => "Husk hemmelig kode ord.",
- "pris" => "Husk en pris.",
- "club" => "Husk club sted."
- );
- if(!empty($pris))
- {
- unset($errors["pris"]);
- }
- if(!empty($club))
- {
- unset($errors["club"]);
- }
- if(!empty($email))
- {
- unset($errors["email"]);
- }
- if(!empty($password))
- {
- unset($errors["password"]);
- }
- if(!empty($gentag) && $gentag == $password)
- {
- unset($errors["gentag"]);
- }
- if(!empty($djnavn))
- {
- unset($errors["djnavn"]);
- }
- if(!empty($profiltekst))
- {
- unset($errors["profiltekst"]);
- }
- if(!empty($facebook))
- {
- unset($errors["facebook"]);
- }
- if(!empty($booking))
- {
- unset($errors["booking"]);
- }
- if(!empty($hemmelig))
- {
- unset($errors["hemmelig"]);
- }
- if(empty($errors))
- {
- $password = sha1($password);
- $insert = mysql_query("INSERT INTO brugere (email,password,profilbillede,djnavn,profiltekst,facebook,club,pris,booking,hemmelig)
- VALUES ('$email', '$password','$billedefilnavn','$djnavn','$profiltekst','$facebook','$club','$pris','$booking','$hemmelig')");
- if(!$insert)
- {
- header('Location: fejl.php');
- exit();
- }
- else
- {
- header('Location: index.php');
- exit();
- }
- }
- else
- {
- echo "<div id=\"box\"><h4>HUSK DET HER!!</h4><ul><li>" . implode("</li><li>", $errors) . "</li></ul></div>";
- }
- }
- }
- ?>
- <form action="" method="post" enctype="multipart/form-data">
- <input type="email" name="email" placeholder="Email Adresse" id="brugerinfomation">
- <br>
- <input type="password" name="password" placeholder="Adgangskode" id="brugerinfomation">
- <br>
- <input type="password" name="gentag" placeholder="Gentag Adgangskode" id="brugerinfomation">
- <br>
- <h3>Privat Infomation Indhold</h3>
- <input type="text" name="djnavn" placeholder="Djnavn" id="brugerinfomation">
- <br>
- <input type="text" name="club" placeholder="Club steder" id="brugerinfomation">
- <br>
- <input type="text" name="pris" placeholder="Pris" id="brugerinfomation">
- <br>
- <input type="email" name="booking" placeholder="Booking email" id="brugerinfomation">
- <br>
- <input type="text" name="facebook" placeholder="Facebook Fan side" id="brugerinfomation">
- <br>
- <h3>Profil Tekst</h3>
- <textarea name="profiltekst" style="width:605px; height:155px;"></textarea><br />
- <input type="file" name="file"><br>
- <input type="text" name="hemmelig" placeholder="Hemmelig kodeord" id="brugerinfomation">
- <br>
- <input type="submit" value="Godkendt Profil">
- <script>
- $(function(){
- $('#box').hide().fadeIn(3000);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment