Posts by arendjee
-
-
This maar een test script hoor zodra het werkt word het omgezet naar database dingen etc
ajax_register.php
PHP
Toon Meer<?php $existing_users=array('roshan','mike','jason'); $user_name=$_POST['user_name']; $existing_mail=array('[email protected]','[email protected]','[email protected]'); $mail_name=$_POST['mail']; $regel = $_POST['regels']; if ($_POST['pass'] != $_POST['pass2']) { echo "no"; }elseif ($_POST['mail'] != $_POST['mail2']) { echo "no"; }elseif (in_array($user_name, $existing_users)) { //user name is not availble echo "no"; }elseif (in_array($mail_name, $existing_mail)) { //user name is not availble echo "no"; }elseif(empty($regel)) { echo "no"; }else { echo "yes"; } ?>Verder ik weet het kan makkelijker maar het is meer om te testen eerst zodat ik het onder de knie heb als het werkt schrijf ik het helemaal over om korter / makkelijker t emaken
register.php
PHP
Toon Meer<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#username").blur(function() { //remove all the class add the messagebox classes and start fading $("#msgbox").removeClass().addClass('messagebox').text('Kijken in de database').fadeIn("slow"); //check the username exists or not from ajax $.post("register/user_availability.php",{ user_name:$(this).val() } ,function(data) { if(data=='no') //if username not avaiable { $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Deze gebruikersnaam bestaat al').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Deze naam is nog niet in gebruik').addClass('messageboxok').fadeTo(900,1); }); } }); }); }); $(document).ready(function() { $("#pass").blur(function() { //remove all the class add the messagebox classes and start fading $("#passmessage").removeClass().addClass('messagebox').text('Wachtwoord check').fadeIn("slow"); //check the username exists or not from ajax $.post("register/pass_check.php",{ user_name:$('#username').val(),pass:$('#pass').val() } ,function(data) { if(data=='no') //if username not avaiable { $("#passmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je wachtwoord is het zelfde als je gebruikersnaam').addClass('messageboxerror').fadeTo(900,1); }); } else if(data=='min') //if username not avaiable { $("#passmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je moet minimaal 8 tekens in je wachtwoord').addClass('messageboxerror').fadeTo(900,1); }); } else if(data=='empty') //if username not avaiable { $("#passmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je moet wel wat invullen').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#passmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Dit wachtwoord is goed').addClass('messageboxok').fadeTo(900,1); }); } }); }); }); $(document).ready(function() { $("#regels").blur(function() { //remove all the class add the messagebox classes and start fading $("#regelbericht").removeClass().addClass('messagebox').text('Regelcheck').fadeIn("slow"); //check the username exists or not from ajax $.post("register/regel_check.php",{ regels:$('#regels').val()} ,function(data) { if(data=='no') //if username not avaiable { $("#regelbericht").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Accepteer de regels').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#regelbericht").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je heb de regels geaccepteert').addClass('messageboxok').fadeTo(900,1); }); } }); }); }); $(document).ready(function() { $("#pass2").blur(function() { //remove all the class add the messagebox classes and start fading $("#herhaalmessage").removeClass().addClass('messagebox').text('Wachtwoord check').fadeIn("slow"); //check the username exists or not from ajax $.post("register/pass_herhaal.php",{ pass:$('#pass').val(),pass2:$('#pass2').val() } ,function(data) { if(data=='no') //if username not avaiable { $("#herhaalmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je wachtwoorden zijn niet gelijk').addClass('messageboxerror').fadeTo(900,1); }); } else if(data=='empty') //if username not avaiable { $("#herhaalmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je heb geen wachtwoord ingevult').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#herhaalmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je wachtwoorden zijn gelijk').addClass('messageboxok').fadeTo(900,1); }); } }); }); }); $(document).ready(function() { $("#mail2").blur(function() { //remove all the class add the messagebox classes and start fading $("#mail2message").removeClass().addClass('messagebox').text('Mail check').fadeIn("slow"); //check the username exists or not from ajax $.post("register/mail_herhaal.php",{ mail:$('#mail').val(),mail2:$('#mail2').val() } ,function(data) { if(data=='no') //if username not avaiable { $("#mail2message").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je mail adressen zijn niet identiek').addClass('messageboxerror').fadeTo(900,1); }); } else if(data=='empty') //if username not avaiable { $("#mail2message").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je moet wel wat invullen').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#mail2message").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je email adrres zijn gelijk').addClass('messageboxok').fadeTo(900,1); }); } }); }); }); $(document).ready(function() { $("#mail").blur(function() { //remove all the class add the messagebox classes and start fading $("#mailmessage").removeClass().addClass('messagebox').text('Kijken in de database').fadeIn("slow"); //check the username exists or not from ajax $.post("register/mail_availability.php",{ user_name:$(this).val() } ,function(data) { if(data=='no') //if username not avaiable { $("#mailmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Deze mail is al ingebruik').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#mailmessage").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Mail naam is nog niet in gebruik').addClass('messageboxok').fadeTo(900,1); }); } }); }); }); $(function(){ var MyFirstVar = 'onbekende' ; $("#register_form").submit(function(){ //remove all the class add the messagebox classes and start fading $("#aangemeldtekst").removeClass().addClass("messagebox_form").text("Account aan maken").fadeIn(1400); //check the username exists or not from ajax $.ajax({ type: "POST", url: "register/ajax_register.php", data: "user_name=" + $("#username").val() + "&pass=" + $("#pass").val() + "&pass2=" + $("#pass2").val() + "&mail=" + $("#mail").val() + "&mail2=" + $("#mail2").val() + "®els=" + $("#regels").val() + "&rand=" + Math.random(), success: function(msg){ if(msg == "yes"){ //if correct login detail $("#aangemeldtekst").fadeTo(200,0.1,function(){ //start fading the messagebox //add message and change the class of the box and start fading $(this).html("Je bent zojuist aangemeld "+MyFirstVar+" Activeer je mail").addClass("messageboxok_form").fadeTo(900, 1, function(){ //redirect to secure page }); }); } else{ $("#aangemeldtekst").fadeTo(200, 0.1, function(){ //start fading the messagebox //add message and change the class of the box and start fading $(this).html("Je kon je niet aan melden probeer het opnieuw...").addClass("messageboxerror_form").fadeTo(900, 1); }); } } }); return false; //not to post the form physically }); //now call the ajax also focus move from $("#register_form").blur(function(){ $("#register_form").trigger("submit"); }); }); </script> <style type="text/css"> body { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; } .top { margin-bottom: 15px; } .messagebox{ position:absolute; width:auto; margin-left:30px; border:1px solid #c93; background:#ffc; padding:3px; } .messageboxok{ position:absolute; width:auto; margin-left:30px; border:1px solid #349534; background:#C9FFCA; padding:3px; font-weight:bold; color:#008000; } .messageboxerror{ position:absolute; width:auto; margin-left:30px; border:1px solid #CC0000; background:#F7CBCA; padding:3px; font-weight:bold; color:#CC0000; } .messagebox_form{ position:absolute; width:auto; border:1px solid #c93; background:#ffc; padding:3px; } .messageboxok_form{ position:absolute; width:auto; border:1px solid #349534; background:#C9FFCA; padding:3px; font-weight:bold; color:#008000; } .messageboxerror_form{ position:absolute; width:auto; border:1px solid #CC0000; background:#F7CBCA; padding:3px; font-weight:bold; color:#CC0000; } </style> </head> <body> <form method="post" action="" id="register_form"> <p>Welkom op true-crime Zin om mee te spelen meld je nu aan. <small>Let er op er komt een activatie link naar je mail</small></p> <div> <span id="aangemeldtekst" style="display:none"></span> <br><br><br> </div> <table > <td width="200">User Name :</td> <td width="200"> <input name="username" type="text" id="username" value="" maxlength="15" /></td> <td width="200"><span id="msgbox" style="display:none"></span></td> </table> <table > <td width="200">Mail adres:</td> <td width="200"> <input name="mail" type="text" id="mail" value="" maxlength="90" /></td> <td width="200"> <span id="mailmessage" style="display:none"></span></td> </table> <table > <td width="200">Herhaal Mail:</td> <td width="200"> <input name="mail2" type="text" id="mail2" value="" maxlength="90" /></td> <td width="200"> <span id="mail2message" style="display:none"></span></td> </table> <table > <td width="200">Wachtwoord:</td> <td width="200"> <input name="pass" type="password" id="pass" value="" maxlength="15" /></td> <td width="200"> <span id="passmessage" style="display:none"></span></td> </table> <table > <td width="200">Herhaal Pass:</td> <td width="200"> <input name="pass2" type="password" id="pass2" value="" maxlength="15" /></td> <td width="200"> <span id="herhaalmessage" style="display:none"></span></td> </table> <table > <td width="400" align="left"><input name="regels" type="checkbox" id="regels" /> Accepteer de regels</td> <td width="200"> <span id="regelbericht" style="display:none"></span></td> </table> <table> <td col colspan="10" align="center"><input name="submit" type="submit" id="aanmelden_form" value="Maak account aan" /> </td> </table> </form> -
neej de php is goed;)
maar hij geeft de naam die ingevoert is niet aan
dat bedoel ik
-
PHP
Toon Meer<?php $vord = 30 ; ?> <td align="center"> <div class="dash_progress_bar"> <div class="Progress_Bar"> <div style="width:<?php echo $vord;?>%;"> </div> </div> </div> <br /><?php echo $vord;?>%</td>PHPdiv.dash_progress_bar {width:75px;text-align:left;} div.dash_progress_bar div.Progress_Bar {float:left;width:75px;height:10px;border:1px solid #767676;background-image: url('bg balk');} div.dash_progress_bar div.Progress_Bar div {height:10px;background-image: url('virdbalk');}heb dit ergens vandaan getrokken :p
maar miss dat je der wat mee kunt
-
-
@therox
Je bent zojuist aangemeld Activeer je mail

maarja ik ga ff verdxer kijken iedergeval thnx:)
weet nu hoe je een var der in krijgt:D -
de cron waar het probleem mee is denk

-
-
Ik weet dat het korter kan maar is meer om te testen en het beetje onder de knie te krijgen

-
oehhw thnx ik ge even kijken

Nieuwe reactie samengevoegd met originele reactie op 28.05.11 16:22:58:
Tooen werkte het hele script nie meer:o -
-
Ik ben nu aan het leren met ajax / javascript en liep tegen een probleem aan maar lars heb daar mee geholpen maar nu zit ik met nog een vraagje is het mogelijk om in ajax/javascript php echo's / variables te gebruiken ? zodat ik de site volledig in ajax / javascript kan doen .

-
Thnx lars ik ga der mee verder

Nieuwe reactie samengevoegd met originele reactie op 28.05.11 16:12:02:
Je bent zojuist aangemeld Acctiveer je mail
blijft die aangeven -
@ thexerox ik ben het met je eens maar had niet zo 1, 2, 3 een idee wat voor plaatjes ik er bij nodig had:)
-
:slotje::$ der kan slotje op
zie het probleem al ben een else vergeten :$
this ook al laat denk egt bed tijd :$
Nieuwe reactie samengevoegd met originele reactie op 28.05.11 03:30:54:
Ik heb een ander probleem dus heb die vervangen voor de oude
-
Goede dag cp leden ik ben bezig met een register script in javascript maar hij doet alles goed behalve 1 klein ding
PHP
Toon Meer$(document).ready(function() { $("#register_form").submit(function() { //remove all the class add the messagebox classes and start fading $("#aangemeldtekst").removeClass().addClass('messagebox_form').text('Account aan maken').fadeIn(1400); //check the username exists or not from ajax $.post("register/ajax_register.php",{ user_name:$('#username').val(),pass:$('#pass').val(),pass2:$('#pass2').val(),mail:$('#mail').val(),mail2:$('#mail2').val(),regels:$('#regels').val(),rand:Math.random() } ,function(data) { if(data=='yes') //if correct login detail { $("#aangemeldtekst").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je bent zojuist aangemeld <?=$_POST['username'];?> Acctiveer je mail').addClass('messageboxok_form').fadeTo(900,1, function() { //redirect to secure page }); }); } else { $("#aangemeldtekst").fadeTo(200,0.1,function() //start fading the messagebox { //add message and change the class of the box and start fading $(this).html('Je kon je niet aan melden probeer het opnieuw...').addClass('messageboxerror_form').fadeTo(900,1); }); } }); return false; //not to post the form physically }); //now call the ajax also focus move from $("#register_form").blur(function() { $("#register_form").trigger('submit'); }); });Hij laat de ingevoerde naam niet zien bij de melding
-
@ legendd thnx:)
het gedeelte van more
moest eigenlijk in meerdere delen
maar had daar geen zin in dus dacht doe het maar zo:$:) -
-
[offtopic]Waarom een banditi aan passen aangezien der op je profiel staat dat je pro in html / php bent dus lijkt me dan toch het beste dat je vanaf 0 kan[/offtopic]
Wat voor wijzegingen zou je willen ;)?
-
thnx thnx :$:$
k ga zoiezo verder tutorials bekijken en kloten met photoshop