Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [L2J] Dúvidas Solucionadas (https://secretexperience.net/forumdisplay.php?f=653)
-   -   [Ajuda] PHP Script de criação de conta (https://secretexperience.net/showthread.php?t=2670)

lSkinner 16-01-2009 06:10 PM

[Ajuda] PHP Script de criação de conta
 
Bem, hoje em outro forum achei um php script para criacao de contas. Eu coloquei ele no meu site normalmente e funfou certinho.

Quando a conta é criada com sucesso, digita menos de 5 caracteres ou tenta criar uma conta que ja exista aparece uma mensagem para ambas, porem em outra pagina.

Fiz uma copia da pagina de Accounts e tirou os formularios adicionando ali o script pra criar as contas e coloquei a fonte, cor e tamanho de fonte que eu queria.

Quando eu crio uma conta que nao exista da a seguinte mensagem "Conta criada com sucesso." na pagina que configurei perfeitamente (Screens logo baixo), mas quando tento criar uma que ja existe ou digito algo errado ou nao coloco campo as mensagens de erro que normalmente aparecem quebram a pagina.

Screens:

[SIZE="3"]Aqui a pagina de criacao de conta:[/SIZE]

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
[SIZE="3"]
Aqui a pagina que aparece quando a conta é criada com sucesso:[/SIZE]


[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

[SIZE="3"]E aqui a pagina que aparece quando digito algo errado:[/SIZE]

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]


Como podem ver a pagina quebra totalmente, ja tentei mexer no script mas so fiz besteira :skeptical:

Aqui vou postar a pagina com o php script pra que voces possam analisar:

Código:

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                <html xmlns="http://www.w3.org/1999/xhtml">
                                <head>
                                <title>Doors from Hell : Gracia Pt. 2 Server</title>
                                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                                <link href="css/default.css" rel="stylesheet" type="text/css" />
                                <script type="text/javascript" src="js/rollover.js"></script>
                                <link REL="SHORTCUT ICON" HREF="http://www.secretwarez.net/images/favicon.ico">
                                <script type="text/javascript" src="js/display.js"></script>
                                </head>
                                <body onLoad="startSlideshow();" bgcolor="#1c1b19" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
                                <table id="main_table" align="center" width="100%" height="1014" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/side_bg.gif" height="22"></td>
                                                <td valign="top" rowspan="9" background="http://www.secretwarez.net/images/side_bar_left_bg.gif" width="23" height="660">
                                                        <img src="http://www.secretwarez.net/images/side_bar_left_1.gif" width="23" height="475"></td>
                                                <td colspan="6" rowspan="2" width="884" height="181">        <table id="header_table" width="884" height="181" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                                <td width="884" height="117">
                                                                        <img src="http://www.secretwarez.net/images/header_night1.gif" width="884" height="117"></td>
                                                        </tr>
                                                        <tr>
                                                                <td width="884" height="64">
                                                                        <img src="http://www.secretwarez.net/images/header_night2.gif" width="884" height="64"></td>
                                                        </tr>
                                                </table>                </td>
                                                <td valign="top" rowspan="9" background="http://www.secretwarez.net/images/side_bar_right_bg.gif" width="23" height="660">
                                                        <img src="http://www.secretwarez.net/images/side_bar_right_1.gif" width="23" height="475"></td>
                                                <td background="http://www.secretwarez.net/images/side_bg.gif" height="22"></td>
                                                <td width="1" height="22">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="22"></td>
                                        </tr>
                                        <tr>
                                                <td rowspan="11"></td>
                                                <td rowspan="11"></td>
                                                <td width="1" height="159">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="159"></td>
                                        </tr>
                                        <tr>
                                                <td rowspan="2" width="216" height="53"> <table id="header_table" width="216" height="53" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                                <td width="216" height="53">
                                                                        <img src="http://www.secretwarez.net/images/header_night2-10.gif" width="216" height="53"></td>
                                                        </tr>
                                                </table>                        </td>
                                                <td rowspan="2" width="286" height="53">        <table id="status_table" width="286" height="53" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td colspan="5" width="286" height="24">
                                                        <img src="http://www.secretwarez.net/images/complex_10_night.gif" width="286" height="24"></td>
                                        </tr>
                                        <tr>
                                                <td rowspan="2" width="104" height="29">
                                                        <img src="http://www.secretwarez.net/images/complex_11_night.gif" width="104" height="29"></td>
                                                <td width="32" height="9">
                                                        <img src="http://www.secretwarez.net/images/auth_online.gif" width="32" height="9"></td>
                                                <td rowspan="2" width="69" height="29">
                                                        <img src="http://www.secretwarez.net/images/complex3_13.gif" width="69" height="29"></td>
                                                <td width="32" height="9">
                                                        <img src="http://www.secretwarez.net/images/game_online.gif" width="32" height="9"></td>
                                                <td rowspan="2" width="49" height="29">
                                                        <img src="http://www.secretwarez.net/images/complex3_15.gif" width="49" height="29"></td>
                                        </tr>
                                        <tr>
                                                <td width="32" height="20">
                                                        <img src="http://www.secretwarez.net/images/complex3_16.gif" width="32" height="20"></td>
                                                <td width="32" height="20">
                                                        <img src="http://www.secretwarez.net/images/complex3_17.gif" width="32" height="20"></td>
                                        </tr>
                                </table>                        </td>
                                                <td colspan="4" width="382" height="10"> <table id="header_table" width="382" height="10" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                                <td width="382" height="10">
                                                                        <img src="http://www.secretwarez.net/images/header_night2-12.gif" width="382" height="10"></td>
                                                        </tr>
                                                </table>                        </td>
                                                <td width="1" height="10">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="10"></td>
                                        </tr>
                                        <tr>
                                                <td colspan="2" width="262" height="43"> <table id="header_table" width="262" height="43" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                                <td width="262" height="43">
                                                                        <img src="http://www.secretwarez.net/images/header_night2-13.gif" width="262" height="43"></td>
                                                        </tr>
                                                </table>                        </td>
                                                <td rowspan="2" background="http://www.secretwarez.net/images/how_to_night.gif" width="110" height="110">
                                                        <a href="connect.php"><img name="howto" src="http://www.secretwarez.net/images/howto_static.gif" width="110" height="110" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                                <td width="10" height="43"> <table id="header_table" width="10" height="43" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                                <td width="10" height="43">
                                                                        <img src="http://www.secretwarez.net/images/header_night2-15.gif" width="10" height="43"></td>
                                                        </tr>
                                                </table>                        </td>
                                                <td width="1" height="43">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="43"></td>
                                        </tr>
                                        <tr>
                                                <td valign="top" rowspan="5" width="216" height="426" background="http://www.secretwarez.net/images/background_left.gif">        <table id="menu_table" width="216" height="426" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td colspan="3" width="216" height="55">
                                                        <img src="http://www.secretwarez.net/images/menu_head_night.gif" width="216" height="55"></td>
                                        </tr>
                                        <tr>
                                                <td rowspan="30" width="17" height="371">
                                                        <img src="http://www.secretwarez.net/images/menu_left.gif" width="17" height="462"></td>
                                                <td width="184" height="21">                               
                                                <a href="index.php"><img name="home" src="http://www.secretwarez.net/images/home_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                                <td rowspan="30" width="15" height="371">
                                                        <img src="http://www.secretwarez.net/images/menu_right.gif" width="15" height="462"></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                               
                                                <a href="downloads.php"><img name="gf" src="http://www.secretwarez.net/images/gf_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                               
                                                <a href="account.php"><img name="reg" src="http://www.secretwarez.net/images/reg_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                               
                                                <a href="features.php"><img name="feat" src="http://www.secretwarez.net/images/feat_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                               
                                                <a href="donate.php"><img name="dona" src="http://www.secretwarez.net/images/dona_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                               
                                                <a href="suporte.php"><img name="raid" src="http://www.secretwarez.net/images/raid_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                                       
                                                <a href="rank.php"><img name="lad" src="http://www.secretwarez.net/images/lad_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                                       
                                                <a href="castlecontrol.php"><img name="cast" src="http://www.secretwarez.net/images/cast_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                                       
                                                <a href="heroes.php"><img name="hero" src="http://www.secretwarez.net/images/hero_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                                                                               
                                                <a href="staff.php"><img name="staff" src="http://www.secretwarez.net/images/staff_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                                                                               
                                                <a href="http://www.google.com.br"><img name="forum" src="http://www.secretwarez.net/images/forum_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9">                                       
                                                <a href="http://www.secretwarez.net/galery/index.php">
                                                <img name="move" src="http://www.secretwarez.net/images/movies_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9">                                       
                                                <a href="news.php">
                                                <img name="new" src="http://www.secretwarez.net/images/new_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9">                                       
                                                <a href="parcerias.php">
                                                <img name="par" src="http://www.secretwarez.net/images/par_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/complex3_66.gif" width="184" height="9"></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="21">                                       
                                                <a href="vip.php">
                                                <img name="conta" src="http://www.secretwarez.net/images/conta_menu.gif" width="184" height="21" border="0" onMouseOver="mouseOver(name)" onMouseOut="mouseOut(name)"></a></td>
                                        </tr>
                                        <tr>
                                                <td width="184" height="20">
                                                        <img src="http://www.secretwarez.net/images/menu_bottom.gif" width="184" height="20"></td>
                                        </tr>
                                </table>                        </td>
                                                <td colspan="2" rowspan="2">        <table id="display_table" width="540" height="150" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td>
                                                        <img src="http://www.secretwarez.net/images/display_head_day.gif" width="74" height="10"></td>
                                                <td>
                                                        <a href="" id="numLink0" onMouseOver="slideshow(0,0);" onMouseOut="slideshow(1,0);" ><img name="num0" id="num0" src="http://www.secretwarez.net/images/display_button_1.gif" border="0" width="9" height="10"></a></td>
                                                <td>
                                                        <img src="http://www.secretwarez.net/images/display_head-26.gif" width="3" height="10"></td>
                                                <td>
                                                        <a href="" id="numLink1" onMouseOver="slideshow(0,1);" onMouseOut="slideshow(1,1);" ><img name="num1" id="num1" src="http://www.secretwarez.net/images/display_button_2.gif" border="0" width="9" height="10"></a></td>
                                                <td>
                                                        <img src="http://www.secretwarez.net/images/display_head-28.gif" width="3" height="10"></td>
                                                <td>
                                                        <a href="" id="numLink2" onMouseOver="slideshow(0,2);" onMouseOut="slideshow(1,2);" ><img name="num2" id="num2" src="http://www.secretwarez.net/images/display_button_3.gif" border="0" width="9" height="10"></a></td>
                                                <td>
                                                        <img src="http://www.secretwarez.net/images/display_head-30.gif" width="433" height="10"></td>
                                        </tr>
                                        <tr>
                                                <td colspan="7">
                                                        <a href="" id="eventLink" onMouseOver="slideshow(0,currSlide);" onMouseOut="slideshow(1,currSlide);" ><img name="pic" src="http://www.secretwarez.net/images/display_1.gif" border="0" width="540" height="140"></a></td>
                                        </tr>
                                </table>                        </td>
                                                <td width="8" height="67">
                                                        <img src="http://www.secretwarez.net/images/complex_57.gif" width="8" height="67"></td>
                                                <td width="10" height="67">
                                                        <img src="http://www.secretwarez.net/images/complex_58.gif" width="10" height="67"></td>
                                                <td width="1" height="67">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="67"></td>
                                        </tr>
                                        <tr valign="top">
                                                <td colspan="3" rowspan="3" width="128" height="205" background="http://www.secretwarez.net/images/bg_color_right.gif">        <table id="vote_table" width="128" height="205" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td colspan="3" width="128" height="43">
                                                        <img src="http://www.secretwarez.net/images/vote_box.gif" width="128" height="43"></td>
                                        </tr>
                                        <tr>
                                                <td rowspan="6" width="11" height="162">
                                                        <img src="http://www.secretwarez.net/images/vote_box-34.gif" width="11" height="162"></td>
                                                <td width="105" height="48">
                                                        <a target="_blank" href="vote.php"><img src="http://www.secretwarez.net/images/vote_gs200.gif" border="0" width="105" height="48"></a></td>
                                                <td rowspan="6" width="12" height="162">
                                                        <img src="http://www.secretwarez.net/images/vote_box-36.gif" width="12" height="162"></td>
                                        </tr>
                                        <tr>
                                                <td width="105" height="4">
                                                        <img src="http://www.secretwarez.net/images/vote_box-41.gif" width="105" height="4"></td>
                                        </tr>
                                        <tr>
                                                <td width="105" height="48">
                                                        <a target="_blank" href="http://www.mmorpgtoplist.com/in.php?site=8934"><img src="http://www.secretwarez.net/images/vote_hopzone.gif" border="0" width="105" height="48"></a></td>
                                        </tr>
                                        <tr>
                                                <td width="105" height="4">
                                                        <img src="http://www.secretwarez.net/images/vote_box-50.gif" width="105" height="4"></td>
                                        </tr>
                                        <tr>
                                                <td width="105" height="48">
                                                        <!-- Begin XtremeTop100 code -->
                                                        <a target="_blank" href="http://www.xtremetop100.com/in.php?site=1132228423"><img src="http://www.secretwarez.net/images/vote_xtreme.gif" border="0" alt="server" width="105" height="48"></a></td>
                                                        <!-- End XtremeTop100 code -->
                                        </tr>
                                        <tr>
                                                <td width="105" height="10">
                                                        <img src="http://www.secretwarez.net/images/vote_box-58.gif" width="105" height="10"></td>
                                        </tr>
                                </table>                        </td>
                                                <td width="1" height="83">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="83"></td>
                                        </tr>
                                        <tr>
                                                <td colspan="2" width="540" height="35">
                                                        <img src="http://www.secretwarez.net/images/content_head_gameaccount.gif" width="540" height="35"></td>
                                                <td width="1" height="35">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="35"></td>
                                        </tr>
                                        <tr>
                                                <td colspan="2" rowspan="4" width="540">       
                                                <table id="content_table" width="540" height="672" border="0" cellpadding="0" cellspacing="0">
                                        <tr valign="top">
                                                <td valign="top" background="http://www.secretwarez.net/images/content_left_bg.gif" width="17" height="33">
                                                        <img src="http://www.secretwarez.net/images/content_top_left.gif" width="17" height="33"></td>
                                                <td rowspan="3" background="http://www.secretwarez.net/images/complex3_66.gif" width="506">&nbsp;<dl>
                                                                <div align="center">
                <dt><font size="2">Informacoes do registro</font></dt>
                </div>
    <hr style="background-color: #000000">
        <div align="center"></div>
        <div align="left">
    <div align="center">
&nbsp;<div align=center><b><font size=2 face=Verdana, Arial, Helvetica, sans-serif>
<?php
//set host, username and password for MySQL
$dbhost = "localhost";
$dbuser = "lalalalala";
$dbpass = "lalalalala";
 
//connect to MySQL or return an error
$conn = mysql_connect("$dbhost", "$dbuser", "$dbpass")
or die('Could not connect: ' . mysql_error());
 
//set database name
$dbname = "l2jmk";
 
//select database or return an error
$dbselect = mysql_select_db("$dbname") 
or die ('Could not select database');
 
//get username and password info from the form, protecting against SQL injection
$pass = mysql_real_escape_string($_POST["pass"]);
$confirm = mysql_real_escape_string($_POST["confirm"]);
$user = mysql_real_escape_string($_POST["name"]);
 
//validate user input
if(!preg_match('/^[a-zA-Z0-9]{5,20}$/',$user)) {
die ('Sua conta deve conter no minimo 5 e maximo de 20 caracteres.');
}
 
if(!preg_match('/^[a-zA-Z0-9]{5,20}$/',$pass)) {
die ('Sua senha deve conter no minimo 5 e maximo de 20 caracteres.');
}
 
if($pass != $confirm) {
die ('Sua senha nao confere.');
}
 
//make sure user doesn't already exist and if it doesn't, add new record to the database
$result = mysql_query("SELECT login FROM accounts WHERE login='$user'");
 
if(mysql_num_rows($result)>0) {
die ('Esta conta ja existe.');
}else{
mysql_query("INSERT INTO accounts (login, password, accesslevel) VALUES ('".$_POST['name']."', '".base64_encode(pack('H*', sha1($_POST['pass'])))."', 0)")
or die ('Erro' . mysql_error());
}
 
//report successful registration
echo "Conta criada com sucesso.";
 
//close MySQL connection
mysql_close();
 
?>
</dl></b>
<br><br>
<center>
</font><a href="account.php">Voltar</a></center></div></div>
                                                </div></td>
                                                <td valign="top" background="http://www.secretwarez.net/images/content_right_bg.gif" width="17" height="33">
                                                        <img src="http://www.secretwarez.net/images/content_top_right.gif" width="17" height="33"></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/content_left_bg.gif" width="17">
                                                        <img src="http://www.secretwarez.net/images/content_left_bg.gif" width="17" height="33"></td>
                                               
                                                <td background="http://www.secretwarez.net/images/content_right_bg.gif" width="17"></td>
                                        </tr>
                                        <tr>
                                                <td valign="bottom" width="17" height="406" background="http://www.secretwarez.net/images/content_left_bg.gif">
                                                        <img src="http://www.secretwarez.net/images/content_footer_left.gif" width="17" height="213"></td>
                                                <td valign="bottom" width="17" height="406" background="http://www.secretwarez.net/images/content_right_bg.gif">
                                                        <img src="http://www.secretwarez.net/images/content_footer_right.gif" width="17" height="213"></td>
                                        </tr>
                                </table>                        </td>
                                                <td width="1" height="87">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="87"></td>
                                        </tr>
                                        <tr>
                                                <td colspan="3" background="http://www.secretwarez.net/images/bg_color_right.gif" width="128" height="154">
                                                <p align="center">
                                               
                                               
<script type="text/javascript"><!--
google_ad_client = "pub-6252101946778080";
/* 120x240, criado 28/07/08 */
google_ad_slot = "8391133863";
google_ad_width = 120;
google_ad_height = 240;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>                                               
                                               
                                               
                                                </td>
                                                <td width="1" height="154">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="154"></td>
                                        </tr>
                                        <tr>
                                                <td background="http://www.secretwarez.net/images/side_bar_left_bg.gif" width="23"></td>
                                                <td background="http://www.secretwarez.net/images/background_left.gif" width="216"></td>
                                                <td valign="bottom" colspan="3" background="http://www.secretwarez.net/images/bg_color_right.gif" width="128">
                                                        <img src="http://www.secretwarez.net/images/background_right.gif" width="128" height="25"></td>
                                                <td background="http://www.secretwarez.net/images/side_bar_right_bg.gif" width="23"></td>
                                                <td background="http://www.secretwarez.net/images/spacer.gif" width="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="25"></td>
                                        </tr>
                                        <tr>
                                                <td valign="bottom" rowspan="2" background="http://www.secretwarez.net/images/side_bar_left_bg.gif" width="23" height="328">
                                                        <img src="http://www.secretwarez.net/images/side_bar_left_2.gif" width="23" height="328"></td>
                                                <td valign="bottom" rowspan="2" background="http://www.secretwarez.net/images/background_left.gif" width="216" height="328">
                                                        <img src="http://www.secretwarez.net/images/footer_side_left.gif" width="216" height="328"></td>
                                                <td valign="bottom" colspan="3" rowspan="2" background="http://www.secretwarez.net/images/bg_color_right.gif" width="128" height="328">
                                                        <img src="http://www.secretwarez.net/images/footer_side_right.gif" width="128" height="328"></td>
                                                <td valign="bottom" rowspan="2" background="http://www.secretwarez.net/images/side_bar_right_bg.gif" width="23" height="328">
                                                        <img src="http://www.secretwarez.net/images/side_bar_right_2.gif" width="23" height="328"></td>
                                                <td width="1" height="213">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="213"></td>
                                        </tr>
                                        <tr>
                                                <td colspan="2" width="540" height="115">        <table id="footer_table" width="540" height="115" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                                <td width="540" height="115">
                                                        <img src="http://www.secretwarez.net/images/footer.gif" width="540" height="115"></td>
                                        </tr>
                                </table>                        </td>
                                                <td width="1" height="115">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="1" height="115"></td>
                                        </tr>
                                        <tr>
                                                <td height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" height="1"></td>
                                                <td width="23" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="23" height="1"></td>
                                                <td width="216" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="216" height="1"></td>
                                                <td width="286" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="286" height="1"></td>
                                                <td width="254" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="254" height="1"></td>
                                                <td width="8" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="8" height="1"></td>
                                                <td width="110" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="110" height="1"></td>
                                                <td width="10" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="10" height="1"></td>
                                                <td width="23" height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" width="23" height="1"></td>
                                                <td height="1">
                                                        <img src="http://www.secretwarez.net/images/spacer.gif" height="1"></td>
                                                <td></td>
                                        </tr>
                                </table>
                                </body>
                                </html>


A mesma coisa acontece com o Alterar senha.

Alguem sabe como posso resolver isso? Ow se alguem souber poderia me dizer como fazer pra que essas frases aparecam em um pop-up?

Bom é isso pessoal. :notworthy:
Adios__ Vlw :wubclub:

John-X 16-01-2009 06:23 PM

Faça um teste com este formulário que eu criei (uma adaptação do seu código). Faça as modificações que achar necessárias. As mensagens de erro aparecem em uma caixa de alerta. Não sendo necessária uma outra página.
Citação:

<form name="l2regjohnx" method="post" action="">
Login: <input type="text" name="login" size="30"><br /><br />
Senha: <input type="password" name="senha" size="30"><br /><br />
Repita a senha: <input type="password" name="resenha" size="30"><br /><br />
<input type="submit" value="Enviar Cadastro" name="l2regjohnx">
</form>
<?php
if(isset($_POST['l2regjohnx'])) {
//set host, username and password for MySQL
$dbhost = "localhost";
$dbuser = "lalalalala";
$dbpass = "lalalalala";

//connect to MySQL or return an error
$conn = mysql_connect("$dbhost", "$dbuser", "$dbpass")
or die('Could not connect: ' . mysql_error());

//set database name
$dbname = "l2jmk";

//select database or return an error
$dbselect = mysql_select_db("$dbname")
or die ('Could not select database');

//get username and password info from the form, protecting against SQL injection
$pass = mysql_real_escape_string($_POST["senha"]);
$confirm = mysql_real_escape_string($_POST["resenha"]);
$user = mysql_real_escape_string($_POST["login"]);

//validate user input
if(!preg_match('/^[a-zA-Z0-9]{5,20}$/',$user)) {
die ('<script>alert("Sua conta deve conter no mínimo 5 e máximo de 20 caracteres.");location=javascript:history.go(0);</script>');
}

if(!preg_match('/^[a-zA-Z0-9]{5,20}$/',$pass)) {
die ('<script>alert("Sua senha deve conter no mínimo 5 e máximo de 20 caracteres.");location=javascript:history.go(0);</script>');
}

if($pass != $confirm) {
die ('<script>alert("Sua senha não confere");location=javascript:history.go(0);</script>');
}

//make sure user doesn't already exist and if it doesn't, add new record to the database
$result = mysql_query("SELECT login FROM accounts WHERE login='$user'");

if(mysql_num_rows($result)>0) {
die ('<script>alert("Esta conta já existe.");location=javascript:history.go(0);</script>');
}else{
mysql_query("INSERT INTO accounts (login, password, accesslevel) VALUES ('".$_POST['name']."', '".base64_encode(pack('H*', sha1($_POST['pass'])))."', 0)")
or die ('Erro' . mysql_error());
}

//report successful registration
echo "<script>alert('Conta criada com sucesso.');location=index.php</script>";

//close MySQL connection
mysql_close($conn);
}
?>
Espero que isso lhe ajude.

lSkinner 16-01-2009 06:29 PM

Mas dentro dessa mensagem em JavaScript iria cair as mensagens: Conta criada com sucesso, Esta conta ja existe ou Sua conta deve conter no minino 5 caracteres?

Eu poderia fazer isso?

Este é a minha pagina de contas: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

Podem testar ai se quiser...

Vlw

John-X 16-01-2009 06:40 PM

Faça um teste com o formulário que eu postei acima. E como eu já disse as mensagens aparecem numa mensagem de alerta em JavaScript.

lSkinner 16-01-2009 06:59 PM

A pagina ainda esta quebrando e agora nao ta dando nem a mensagem de erro, num ta nem abrindo o pop-up.

Tentei colocar tudo junto igual voce disse e separado, mas sempre quebra a pagina... :wacko:

Tem outro modo?


Horários baseados na GMT -3. Agora são 11:50 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.