Jump to content

Hampe

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Hampe

  1. Sorry, I got the mail now. Delay... But the change password still dont work
  2. This is the code right know: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php if(!isset($_GET['email'])){ // no get variable - display the form echo'<form action=""> Email: <input type="text" name="email" /> <input type="submit" value="Ändra lösenord" /> </form>'; exit(); } // the form has been submitted $email=$_GET['email']; include("settings.php"); connect(); $q=sprintf("SELECT email2 from hm_accounts where accountaddress='%s'", mysql_real_escape_string($email) ); $r=mysql_query($q); $n=mysql_num_rows($r); if($n==0) { echo "Emailadressen finns inte <br /> <button onclick='javascript:history.go(-1)'>Gå tillbaka</button>"; die(); } list($email2) = mysql_fetch_array($r); $token=getRandomString(20); $q="INSERT into tokens (token,email) values ('$token','$email2')"; mysql_query($q); mailresetlink($email2,$token); function getRandomString($length) { $validCharacters = "ABCDEFGHIJKLMNPQRSTUXYVWZabcdefghijklmnopqrstuvwxyz123456789"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result; } function mailresetlink($to,$token){ $subject = "Glömt lösenord - Website"; $uri = 'http://'. $_SERVER['HTTP_HOST'] ; $message = ' <html> <head> <title>Glömt lösenord - Website</title> </head> <body> <p>Klicka på länken för att ändra ditt lösenord, <a href="'.$uri.'/test/reset.php?token='.$token.'">LÄNK</a></p> </body> </html> '; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: NiceMail<noreply@domain.se>' . "\r\n"; $headers .= 'Cc: Admin@example.com' . "\r\n"; if(mail($to,$subject,$message,$headers)){ echo "Mailet med länken för att ändra ditt lösenord är skickat till <b>".$to."</b>"; } } ?> It finds the emailaddress, and insert a token, which is good. But I dont get any mail with the link. And even if I take the token from the database and type it in browser and change my password, I can´t login.. Something just dont want to work in some way.. I think of something.. Shouldn´t this line: $q="INSERT into tokens (token,email) values ('$token','$email2')"; be: $q="INSERT into tokens (token,email) values ('$token','$email')"; ? Because $email2 contains the mailaddress where the mail will be sent, and $email is the mailaddress that will be changed. Or am I wrong?
  3. It didn´t go so well... I´m out of ideas, and my English failed for a bit.. mac_gyver: Thank you! I´m sure you did tell me exactly how to do, but as I said... My English failed for a bit. So, any tips or helping hands would be very good! // Hampe
  4. Uhmm. I think I know what you mean, but I´m not really sure.. (My English isn´t that good) I will try to do what I think you are telling me.. // Hampe
  5. Well, still not working.. Here is the code, with the changes: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php //fil namn: forgotpassword.php //Titel: Glömt lösenord if(!isset($_GET['email'])){ echo'<form action=""> Email: <input type="text" name="email" /> <input type="submit" value="Ändra lösenord" /> </form>'; exit(); } $email=$_GET['email']; include("settings.php"); connect(); //$q="SELECT accountaddress from hm_accounts where accountaddress='".$email."'"; $q="SELECT * from hm_accounts where accountaddress='".$email."' and email2='".$email2."'"; $r=mysql_query($q); $n=mysql_num_rows($r); if($n==0){echo "Emailadressen finns inte <br /> <button onclick='javascript:history.go(-1)'>Gå tillbaka</button>";die();} $token=getRandomString(20); $q="INSERT into tokens (token,email) values ('".$token."','".$email."')"; mysql_query($q); function getRandomString($length) { $validCharacters = "ABCDEFGHIJKLMNPQRSTUXYVWZabcdefghijklmnopqrstuvwxyz123456789"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result;} function mailresetlink($to,$token){ $subject = "Glömt lösenord - NiceMail"; $uri = 'http://'. $_SERVER['HTTP_HOST'] ; $message = ' <html> <head> <title>Glömt lösenord - NiceMail</title> </head> <body> <p>Klicka på länken för att ändra ditt lösenord, <a href="'.$uri.'/test/reset.php?token='.$token.'">LÄNK</a></p> </body> </html> '; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: NiceMail<noreply@domain.se>' . "\r\n"; $headers .= 'Cc: Admin@example.com' . "\r\n"; if(mail($email2,$subject,$message,$headers)){ echo "Mailet med länken för att ändra ditt lösenord är skickat till <b>".$email2."</b>"; }} if(isset($_GET['email']))mailresetlink($email,$token); ?>
  6. You mean like this? if(isset($_GET['email']))mailresetlink($email2,$token);
  7. It is the script to create the mailaccount. I just showed you the form setup so you could see the input names.. mail.php doesn´t have anything to do with the Forgot Password function
  8. If I use $to instead of $email2, I can echo it. But then I echo the email address that I want to recover, which is wrong
  9. If the "if mail" is: if(mail($to,$subject,$message,$headers)) I can send a mail. But if I use "$to", the mail will be sent to the "created" email address. The mail should be sent to the "private" email address to recover the "created". (I hope you understand) And yes, I am able to use the mail function, IF I use: $q="SELECT accountaddress from hm_accounts where accountaddress='".$email."'"; Instead of: $q="SELECT * from hm_accounts where accountaddress='".$email."' and email2='".$email2."'"; And if(mail($to,$subject,$message,$headers)) Instead of: if(mail($email2,$subject,$message,$headers))
  10. Hi guys! I have a Forgot Password script that works, but not with the new codelines.. My create script: <b>NOTERA:</b> Fälten märkta med <span style="color:red">*</span> måste fyllas i <br /><br /> <form action="mail.php" method="POST" id="mailSetupForm" name="mailform"> <table style="font-size:14px;color:#535353;"> <tr><td><b>Ditt namn:</b></td><td><input type="text" name="name" size="10"> </td></tr> <tr><td><b>E-Mail: <span style="color:red">*</span></b></td><td><input type="text" name="user" id="user" size="10"><b> @ <select name="domain" id="domain"> <option id="1" value="domain.se">domain.se</option></select></b> </td></tr> <tr><td><b>Din privata E-Mail: <span style="color:red">*</span></b></td><td><input type="text" name="email2" id="email2" size="10"> <i>För återställning av lösenord</i></td></tr> <tr><td><b>Lösenord: <span style="color:red">*</span></b></td><td><input type="password" name="pass1" size="10"> <i>Välj ett säkert lösenord. Använd gärna både tecken och bokstäver</i></td></tr> <tr><td><b>Lösenord igen: <span style="color:red">*</span></b></td><td><input type="password" name="pass2" size="10"> <i>(Bekräftelse)</i></td></tr> <tr><td><b>Kod:</b></td><td><input type="text" name="kod" size="10" value="<?php echo $a ?>" readonly="readonly"> <i>Spara koden! Används när du requestar nytt lösenord</i></td></tr> <tr><td> <div align="left"><input type="submit" name="submit" id="button" value="Skapa"></div></td></tr></table> </fieldset> </form> The Forgot Pass form looks like this: <form action=""> Email: <input type="text" name="email" /> <input type="submit" value="Ändra lösenord" /> </form> Forgot Pass Script: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php if(!isset($_GET['email'])){ echo'<form action=""> Email: <input type="text" name="email" /> <input type="submit" value="Ändra lösenord" /> </form>'; exit(); } $email=$_GET['email']; include("settings.php"); connect(); //$q="SELECT accountaddress from hm_accounts where accountaddress='".$email."'"; $q="SELECT * from hm_accounts where accountaddress='".$email."' and email2='".$email2."'"; $r=mysql_query($q); $n=mysql_num_rows($r); if($n==0){echo "Emailadressen finns inte <br /> <button onclick='javascript:history.go(-1)'>Gå tillbaka</button>";die();} $token=getRandomString(20); $q="INSERT into tokens (token,email) values ('".$token."','".$email."')"; mysql_query($q); function getRandomString($length) { $validCharacters = "ABCDEFGHIJKLMNPQRSTUXYVWZabcdefghijklmnopqrstuvwxyz123456789"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result;} function mailresetlink($to,$token){ $subject = "Glömt lösenord - Website"; $uri = 'http://'. $_SERVER['HTTP_HOST'] ; $message = ' <html> <head> <title>Glömt lösenord - Website</title> </head> <body> <p>Klicka på länken för att ändra ditt lösenord, <a href="'.$uri.'/test/reset.php?token='.$token.'">LÄNK</a></p> </body> </html> '; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: NiceMail<noreply@domain.se>' . "\r\n"; $headers .= 'Cc: Admin@example.com' . "\r\n"; if(mail($email2,$subject,$message,$headers)){ echo "Mailet med länken för att ändra ditt lösenord är skickat till <b>".$email2."</b>"; }} if(isset($_GET['email']))mailresetlink($email,$token); ?> Now, then a user want to request a new password, they type in the "new" emailaddress. From that table it should get their private email (email2) and send the mail there, but it wont... Do you guys have any idea? PS: If the info is bad, just name it and I will try to tell you the problem better.. // Hampe
  11. That´s odd, because I´ve been using it, before I made my own reg script
  12. joshua0000 The script works without any problems. 4 easy steps: 1. Download it 2. Upload it to your webserver 3. Upload the sql_dump.txt to your database 4. Edit the "config.php" with your databaselogin Now you are up and running! // Hampus
  13. The error messages are shown on the same way like when a account is created, via "Modal" echo <<<HTML <div id="modal"> <div id="heading"> Error! </div> <div id="boxcontent"> <p>You did not fill in both passwords</p> <a href="#" class="button red close"><img src="../popup/images/cross.png">Close</a> </div> </div> HTML;
  14. Clear the form, but only when the account is successfully created, and not when it's an error message
  15. Well, it does clear the form, but I just want it to be cleared if the account is successfully created. I also use the Popupbox for the error messeges, but it should now clear the form if an error messege pop up
  16. Hi again. Sorry for the waiting.. I fixed the problem, and another one that I found at the same time I thought about one more thing... When I have created the account and press the "Close"-button, the info is still in the form (as it should be..). But I want to delete the information by automatic. A simple "Javascript Reload" doesn't do the job because you get the question if you really want to reload the page. And dont even think about: "javascript: window.history.go(-1)".. I thought more about maybe "session destroy".. Which is the best option so the user cant just go back 1 page and still see the information in the form?
  17. I will take a look at it when I'm home again. We keep in touch!
  18. Okey, I got the code to work after a few in the keyboard. But if I try to create an account that already exists, the error doesn't show up in the popupbox as I want to. Instead this text pops up on the page: Duplicate entry 'test@mywebsite.se' for key 'accountaddress The strange thing is that I can't find that textrow in the code. Is it possible that the error message comes from the database?
  19. Okey, the beta test is started for real now. The popup box is acting wierd, but I will test a few things first. I will be back in 10-30 min
  20. create.php <?php $a = mt_rand(10000000,99999999); ?> <?php $useragent=$_SERVER['HTTP_USER_AGENT']; if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))) header('Location: http://www.Website.se/mobil/mail.php'); ?> <?php if ($_REQUEST['id'] == "faq") { include('submeny/faq.php'); } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <link rel="icon" type="image/png" href="http://www.Website.se/img/favicon.ico"> <title>Website.se</title> <style type="text/css" media="all"> @import "css/global.css"; @import "css/toprightheader.css"; @import "css/anslutning.css"; @import "css/tooltip.css"; @import "popup/css/styles.css"; </style> <!--jQuery--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="http://malsup.github.com/min/jquery.form.min.js"></script> <!-- using AjaxForm JQuery plugin--> <script src="popup/js/jquery.reveal.js"></script> <script type="text/javascript"> $(document).ready(function() { var options = { url: "form_process.php", // where to submit form to type: "post", // submit method dateType: "html", // returned dataType success: showResponse // function to call on successful form submittion }; // bind form using 'ajaxForm' $('#mailSetupForm').ajaxForm(options); }); function showResponse(responseText) { console.log('success'); $('#wrapper').prepend(responseText); // prepend the modal to #wrapper dib // display modal $('#modal').reveal({ // The item which will be opened with reveal animation: 'fade', // fade, fadeAndPop, none animationspeed: 600, // how fast animtions are closeonbackgroundclick: false, // if you click background will modal close? dismissmodalclass: 'close' // the class of a button or element that will close an open modal }); } </script> </head> <body> <div id="wrapper"> <div id="header"> <img src="img/logo.png"> <!--<h1><span class="black">Web</span><span class="orange">Site</span><span class="black">.se</span></h1>--> <!--<h2>Your Slogan</h2>--> </div> <div id="anslutning"> <div id="anslutningnavi"> <ul> <!--<li><a href="#">Logga in - Kontrollpanel</a></li>--> <?php $portstatus = $_SERVER['SERVER_PORT']; if ($portstatus==80) { echo'<li><a href="https://www.Website.se' . $_SERVER['REQUEST_URI'] . '">Byt till Säker Anslutning (HTTPS)</a></li>'; } else { echo'<li><a href="http://www.Website.se' . $_SERVER['REQUEST_URI'] . '">Byt till Osäker Anslutning (HTTP)</a></li>'; } ?> </ul> </div> </div> <div id="rightheader"> <div id="rightheadernavi"> <ul> <!--<li><a href="#">Logga in - Kontrollpanel</a></li>--> <li><a href="../webmail" target="_blank"><img src="img/email-logo.png" width="20" height="20">Webmail</a></li> </ul> </div> </div> <div id="navi"> <ul> <li><a href="/">Start</a></li> <li class="active"><a href="?p=mail">Mail</a></li> <li><a href="?p=driftstatus">Driftstatus</a></li> <li><a href="?p=kontakt">Kontakta oss</a></li> </ul> </div> <div id="subnavi"> <ul> <li><a href="?p=mail&id=faq">FAQ</a></li> </ul> </div> <div id="main"> <div class="ic"></div> <div id="content"> <h1><span>Skapa Email-konto</span></h1> <div id="content"> <!-- <h2>Funktionen är avstängd tills vidare</h2> --> <!-- <script type="text/javascript" src="js/jquery.js"></script> <script> $(document).ready(function(){ $('#user').keyup(user_check); $('#domain').change(user_check); }); function user_check(){ var user = $('#user').val(); var domain = $('#domain').val(); var email = user + '@' + domain; $('#output').text(email); if(email === "" || user.length < 4){ $('#email').css('border', '3px #CCC solid'); $('#tick').hide(); }else{ jQuery.ajax({ type: "POST", url: "mail/check/check.php", data: 'email='+ email, cache: false, success: function(response){ if(response == 1){ $('#email').css('border', '3px #C33 solid'); $('#tick').hide(); $('#cross').fadeIn(); }else{ $('#email').css('border', '3px #090 solid'); $('#cross').hide(); $('#tick').fadeIn(); } } }); } } </script> --> <style> #tick{display:none} #cross{display:none} </style> <?php //MySQL Information: $mysql_host = "localhost"; //Host Name $mysql_user = "user"; //Username $mysql_pass = "password"; //Password $mysql_db = "database"; //Database //General Configuration: $account_max = "10"; //Maximum size per account (MB) $admin_notify = 0; //1 = yes & 0 = no $admin_email = "email@Website.se"; //Administrators email to send notifications) $admin_default_activate = 1; //1 = yes & 0 = no -> If no, the administrator has to authorise the account $encryption = 2; //Password encryption level //DO NOT EDIT BELOW!// // Protect the Database and MD5 the password. $strName = addslashes( $_POST['name'] ); $strUser = addslashes( $_POST['user'] ); $strDomain = addslashes( $_POST['domain'] ); $strPass1 = addslashes( $_POST['pass1'] ); $strMD5Pass = md5( $strPass1 ); $kod = addslashes( $_POST['kod'] ); error_reporting(E_ALL ^ E_NOTICE); //Next two lines connect to database using information from above. $open = mysql_connect($mysql_host, $mysql_user, $mysql_pass); $select = mysql_select_db($mysql_db); IF (!$open || !$select) { echo 'Databasfel! Felkod: "DB_NoConn"'; } ELSE { //Decide On What Path To Take SWITCH ($_GET['atgard']) { CASE "skapa": //#### PAGE IF FORM FILLED OUT ####// $q=mysql_query("SELECT * FROM `hm_domains` WHERE `domainid` = '{$strDomain}' LIMIT 1"); //Load Domain Into memory (internal use) WHILE ($v=mysql_fetch_array($q)) { $temp_domain = $v['1']; } //Apply information $q2=mysql_query("SELECT * FROM `hm_accounts` WHERE `accountaddress` = '{$strUser}@$temp_domain' LIMIT 1"); //Check if account exists $v2=mysql_num_rows($q2); //Gets number of accounts that exist with that profile (should be less than or equal to one) IF ($v2 == 1) { echo "<span style=\"color:red\">Email-adressen finns redan! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; } ELSE { IF (!$_POST['pass1'] || !$_POST['pass2']) { echo "<span style=\"color:red\">Du fyllde inte i båda lösenorden! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; } ELSEIF ($_POST['pass1'] <> $_POST['pass2']) { echo "<span style=\"color:red\">Lösenorden matchade inte varandra! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; } ELSE { $q3=mysql_query("INSERT INTO `hm_accounts` (`accountdomainid`,`accountaddress`,`accountpassword`,`accountactive`,`accountisad`,`accountmaxsize`,`accountpwencryption`,`kod`) VALUES ('1','$strUser@Website.se','$strMD5Pass','$admin_default_activate','0','$account_max','$encryption','$kod')") or die(mysql_error()); } } IF ($q3) { IF ($admin_default_activate == 0) { echo "<span style=\"color:green\">Ditt konto är skapat, <b>men kräver att administratören aktiverar det.</b> Du får snart en bekräftelse om detta.</span>"; } ELSE { echo " <div id=\"modal\"> <div id=\"heading\"> Ditt mailkonto är aktiverat! </div> <div id=\"boxcontent\"> <p><b>Uppgifter:</b><br>Email: $strUser@Website.se<br />Lösenord: (Dolt av säkerhetsskäl)</p> <a href=\"#\" class=\"button red close\"><img src=\"popup/images/cross.png\">Stäng</a> </div> </div> "; $subject = "<span style=\"color:green\">Välkommen till Website!</span>"; $message = "<span style=\"color:green\">Detta är en bekräftelse på att ditt email-konto är skapat.</span>"; //mail("$strUser@Website.se", $subject, $message); //Send welcome message } } ELSE { //echo "<span style=\"color:red\">Database fel, kunde inte skapa email-kontot. Kontakta administratören!</span>"; } IF ($admin_default_activate == 0 && $admin_notify == 0) { $admin_mail_subject = "Account Requires Activation!"; $admin_mail_message = "{$_POST['user']}@$temp_domain has been created by {$_POST['name']} and needs to be activated!"; mail($admin_email, $admin_mail_subject, $admin_mail_message); } ELSEIF ($admin_default_activate == 1 && $admin_notify == 1) { $admin_mail_subject = "New Account Created!"; $admin_mail_message = "{$_POST['user']}@$temp_domain has been created by {$_POST['name']}!"; mail($admin_email, $admin_mail_subject, $admin_mail_message); } ELSEIF ($admin_default_activate == 0 && $admin_notify == 1) { $admin_mail_subject = "New Account Created!"; $admin_mail_message = "{$_POST['user']}@$temp_domain has been created by {$_POST['name']}!"; mail($admin_email, $admin_mail_subject, $admin_mail_message); } break; DEFAULT: } //#### KOD SOM VISAS OM FÄLTEN INTE ÄR IFYLLDA ####// echo " "; } ?> <span style="color:red">*</span> = Required fields must be filled in <form action="?p=mail&atgard=skapa" method="POST" id="mailSetupForm"> <table style="font-size:14px;color:#535353;"> <tr> <td><b>Your name:</b></td><td><input type="text" name="name" size="10"> </td></tr><tr><td></td></tr> <tr><td><b>E-Mail: <span style="color:red">*</span></b></td><td><input type="text" name="user" id="user" size="10"><b> @ <select name="domain" id="domain"> <option id="1" value="Website.se">Website.se</option> </select></b> <!--<label id="output"></label> <img id="tick" src="mail/check/tick.png" width="16" height="16" title="Adressen är ledig"/><img id="cross" src=\"mail/check/cross.png" width="16" height="16" title="Adressen är upptagen"/>--> </td></tr> <tr><td><b>Password:: <span style="color:red">*</span></b></td><td><input type="password" name="pass1" size="10"> </td></tr> <tr><td><b>Password again: <span style="color:red">*</span></b></td><td><input type="password" name="pass2" size="10"> (Confirmation)</td></tr> <tr><td><b>Code:</b></td><td><input type="text" name="kod" size="8" value="$a" readonly="readonly"> Save this code! Used when requestar new password</td></tr>"; <tr><td> <div align="left"><input type="submit" name="submit" id="button" value="Skapa"></div></td></tr></table> </fieldset> </form> </div> </div> <div id="news"> <h1>Nyheter</h1> <?php include('include/nyheter-box.php'); ?> </div> </div> <div id="footer"> <p>© Copyright 2013 Website.se. Alla Rättigheter Reserverade.</p> </div> <div class="cleaner"></div> </div> </body> </html> <?php } ?> form_process.php <?php //DO NOT EDIT BELOW!// // Protect the Database and MD5 the password. if(isset($_POST['submit'])) { $strName = addslashes( $_POST['name'] ); $strUser = addslashes( $_POST['user'] ); $strDomain = addslashes( $_POST['domain'] ); $strPass1 = addslashes( $_POST['pass1'] ); $strMD5Pass = md5( $strPass1 ); $kod = addslashes( $_POST['kod'] ); //printf('<pre>%s</pre>', print_r($_POST, true)); // only return the modal. Do not return any other html echo <<<HTML <div id="modal"> <div id="heading"> Your mailaccount is activated! </div> <div id="boxcontent"> <p><b>Account Details:</b><br>Email: $strUser@Website.se<br />Password: $strPass1</p> <a href="#" class="button red close"><img src="popup/images/cross.png">Close Window</a> </div> </div> HTML; // DO NOT MODIFY LINE ABOVE } ?> I kindly ask you, please keep the code intact. Dont remove 50% of the code, it's a pain in the a** to build it up again with the new functions..
  21. Good morning! I start this day and thread by say thank you for all the help! I really appreciate it. I did what you told me to do, but it just wont create the user. As before, I get the Popup with the information but nothing more then that. I have test with all-in-one code in "create.php", and with separate files, where line ~160 - ~280 were moved to "form_process.php". And I have been testing with 2-3 other things too... There is some sort of conflict in the code, I just dont know what it is! I´ll go nuts soon!!
  22. Lets start from the beginning. We have 1 file (create.php) that works perfect. Can we (you or me.. I dont know) make the Modal Popup work in that file, or there must be a "form_process.php" ?
  23. READ THE NEXT POST The Javascript for "email available check" is disabled. Now the popup shows again, with the information that was put in the form. But the problem still is that the user is not created. I think the form page and form_process.php not working together. This code: if(isset($_POST['submit'])) { $strName = addslashes( $_POST['name'] ); $strUser = addslashes( $_POST['user'] ); $strDomain = addslashes( $_POST['domain'] ); $strPass1 = addslashes( $_POST['pass1'] ); $strMD5Pass = md5( $strPass1 ); $kod = addslashes( $_POST['kod'] ); is in both the .php files... I really dont know why its not working. BUT! "create.php" handles both the database INSERT and the form, so there is some conflict between the files..
  24. Now I know why it doesn´t work. It is the code that checks if the email that has been input in the field is free or taken.. <script type="text/javascript" src="js/jquery.js"></script> <script> $(document).ready(function(){ $('#user').keyup(user_check); $('#domain').change(user_check); }); function user_check(){ var user = $('#user').val(); var domain = $('#domain').val(); var email = user + '@' + domain; $('#output').text(email); if(email === "" || user.length < 4){ $('#email').css('border', '3px #CCC solid'); $('#tick').hide(); }else{ jQuery.ajax({ type: "POST", url: "mail/check/check.php", data: 'email='+ email, cache: false, success: function(response){ if(response == 1){ $('#email').css('border', '3px #C33 solid'); $('#tick').hide(); $('#cross').fadeIn(); }else{ $('#email').css('border', '3px #090 solid'); $('#cross').hide(); $('#tick').fadeIn(); } } }); } } </script> <style> #tick{display:none} #cross{display:none} </style> So if I remove that code, it works to 50%. The Modal popups, but the email wont be created to the database.. I am really stuck right now!
  25. Holy smoke.. I will never be able to fix this. if I do one way, it dont work. If I do it the other way, it still dont work. What a h*ll is going on??? Ch0cu3r probably laugh at me right now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.