Jump to content

jQuery Modal doesn't show up


Hampe

Recommended Posts

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..  :sweat:

Edited by Hampe
Link to comment
Share on other sites

That is because you still have the form processing code in create.php. The form processing code in I am referring to are lines 192 to line 329. Cut and paste those lines into form_process.php replacing my example code. 

 

Once you have moved the code delete the following lines from form_process.php

    //Decide On What Path To Take
    SWITCH ($_GET['atgard'])
    {
    CASE "skapa":

and

        break;
    
    DEFAULT:
    }

 

Those lines are not needed.

Edited by Ch0cu3r
Link to comment
Share on other sites

Okey, I got the code to work after a few  :facewall:    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? 

Link to comment
Share on other sites

Ok. Umm,Have you modified form_process.php? As I have tested the code but I cant seem to reproduce that error. I get Email-adressen finns redan! if there is duplicate email address found

 

I have edited form_process.php to output debug information. When the form is submitted a red box should appear post the debug info here

<pre style="border:2px solid red;">
<?php

//MySQL Information:
$mysql_host = "localhost"; //Host Name
$mysql_user = "root"; //Username
$mysql_pass = "root"; //Password
$mysql_db = "test"; //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!//

echo "DEBUG: Posted Info\n\nPOST " . print_r($_POST, true);

// 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);
$open = $select = true;
IF (!$open || !$select) 
{ 
    echo 'Databasfel! Felkod: "DB_NoConn"'; 
}
ELSE
{
        echo "DEBUG: Querying hm_domains for domain id\n\n"; // DEBUG
        //#### 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']; 

            echo "RESULT: `domainid` = '{$strDomain}' Found $temp_domain\n\n";
        
        } //Apply information

        if(!isset($temp_domain) echo "DEBUG: $strDomain (\$strDomain) not found in hm_domains\n\n"; // DEBUG
        echo "DEBUG: Querying hm_accounts to see if email address exists ({$strUser}@$temp_domain)\n\n";

        $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 "DEBUG: email address exists! ({$strUser}@$temp_domain)\n\n"; //DEBUG
            echo "<span style=\"color:red\">Email-adressen finns redan! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; 
        }
        ELSE
        {
            echo "DEBUG: email address ok!\n\n"; // DEBUG
            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
            {
                echo "DEBUG: Email fine add account to hm_accounts\n\n"; // DEBUG
                $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("DEBUG:\n\tMYSQL Error: " . mysql_error());
            }
        }
        
        IF ($q3)
        {
            echo "DEBUG: Account created!\n\n"; // DEBUG
            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 "DEBUG: Display modal\n\n"; // DEBUG
                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);
        }



//#### KOD SOM VISAS OM FÄLTEN INTE ÄR IFYLLDA ####//
echo "
";
}
?></pre>
Link to comment
Share on other sites

Hi again. Sorry for the waiting..

 

I fixed the problem, and another one that I found at the same time  :tease-01:

 

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)"..  ;D

 

 

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?

Edited by Hampe
Link to comment
Share on other sites

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 

Link to comment
Share on other sites

How do you display the error message? The error message coming from form_process.php? What is popupbox?

 

Basically what you need to do is check what is being sent back to create.php and then deciding what to do, whether to display modal, or the popupbox. But I dont know how you're implementing the popupbox so I cant tell you.

Link to comment
Share on other sites

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;
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.