registerpage help

Results 1 to 7 of 7
  1. #1
    Apprentice reinoudje is offline
    MemberRank
    Mar 2011 Join Date
    16Posts

    registerpage help

    hi

    i wanted to put the ODBC registerpage v2 in my web

    but i have to edit this in it

    $servername = "LegendGamers";
    $accounttable = "Account";
    $logintable = "Login";

    but can some1 give me an example because idk what to put there

    or explain me :D


  2. #2
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: registerpage help

    Leave the $accounttable and $logintable , and edit $servername to your server's name like this $servername = "myserver";

  3. #3
    Apprentice reinoudje is offline
    MemberRank
    Mar 2011 Join Date
    16Posts

    Re: registerpage help

    Quote Originally Posted by Vusion View Post
    Leave the $accounttable and $logintable , and edit $servername to your server's name like this $servername = "myserver";
    Thanks i did that but when i click on register i get fatal error

    http://publicgamers.web44.net/register.html

    ---------- Post added at 11:40 AM ---------- Previous post was at 11:00 AM ----------

    this is my regosterpage

    <?php
    $dns="GunzDB";
    $user="sa";
    $pass="********";
    $connect=odbc_connect($dns, $user, $pass) or die ("Couldn't connect to the database, we're sorry...");
    odbc_exec($connect,"use GunzDB");

    function antisql($bericht){
    $bericht = stripslashes($bericht);
    $bericht = htmlspecialchars($bericht);
    $bericht = nl2br($bericht);
    return $bericht;
    }

    if(isset($_GET['action']) AND $_GET['action'] == "register"){

    if(empty($_POST['username'])){
    $error.="No username filled!<br>";
    }

    if(empty($_POST['password'])){
    $error.="No password filled!<br>";
    }

    if(empty($_POST['email'])){
    $error.="No e-mail filled!<br>";
    }

    if(empty($_POST['name'])){
    $error.="No name filled!<br>";
    }

    if(empty($_POST['age'])){
    $error.="No age filled!<br>";
    }

    if($error == TRUE){
    echo "<br><br><center>There are some troubles while registering your account:<br>".$error."</center><br>";
    die();
    }

    else
    {
    $regdate = date("Y-m-d H:i:s");
    $email = antisql($_POST['email']);
    $reg = "INSERT INTO Account (UserID, UGradeID, PGradeID, RegDate, Email, Age, Name) VALUES ('".antisql($_POST['username'])."', '1', '1', '$regdate', '$email', '".antisql($_POST['age'])."', '".antisql($_POST['name'])."')";
    $query = odbc_exec($connect,$reg);
    $gebruiker1 = "SELECT AID FROM Account WHERE UserID='".antisql($_POST['username'])."'";
    $gebruiker = odbc_exec($connect,$gebruiker1);
    $i=1;
    while (odbc_fetch_row($gebruiker, $i)){
    $aid = odbc_result($gebruiker, 'AID');
    $i++;
    }
    if (!$aid)
    {
    die ("Oeps, something's wrong with the database");
    }
    $reg2 = "INSERT INTO Login (UserID, AID, Password) VALUES ('".antisql($_POST['username'])."', '$aid', '".antisql($_POST['password'])."')";
    $query = odbc_exec($connect,$reg2);
    print ("<center>Your account is succesfully created!</center>");
    }
    }
    ?><style type="text/css">
    <!--
    body {
    background-color: #000099;
    background-image: url();
    background-repeat: repeat-x;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    }
    body,td,th {
    color: #FFFF00;
    font-size: large;
    }
    .top {
    background-position: top;
    }
    .style1 {
    background-image: url(http://up201.siz.co.il/up1/mz3wugdn2tmy.jpg);
    background-repeat: repeat;
    background-position: center top;
    height: 414px;
    width: 248px;
    clear: none;
    float: none;
    font-size: 18px;
    }
    .style2 {font-size: 18px}
    -->
    </style>

    <center>
    <div align="center" class="style2"><b>Brave Gunz Register Page:</b><br>
    <strong>Have Fun In Brave Gunz</strong><br>
    <?php echo "<form action='".$_SERVER['PHP_SELF']."?action=register' method='POST'>"; ?></div>
    <tr>
    <td height='24' align=center class="style2">&nbsp;&nbsp;</td>
    </tr><tr><td height='24' align=center class="style2">&nbsp;</td>
    <td height='24' align=center class="style2">&nbsp;</td>
    </tr>
    <span class="style2"><br>
    </span>
    <tr>
    <td height='24' align=center class="style2"></td>
    <td height='24' align=center class="style2"></td>
    </tr>
    <span class="style2"><br>
    </span>
    <tr>
    <td height='24' align=center class="style2"></td>
    <td height='24' align=center class="style2"></td>
    </tr>
    <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td height="424" align="center" class="style1"><p><br />
    Username</p>
    <p>
    <input type='text' name='username' />
    </p>
    <p>Password</p>
    <p>
    <input type='password' name='password' />
    </p>
    <p>E-mail</p>
    <p>
    <input type='text' name='email' />
    </p>
    <p>Name</p>
    <p>
    <input type='text' name='name' />
    </p>
    <p>Age</p>
    <p>
    <input type='text' name='age' />
    </p>
    <p>&nbsp;</p></td>
    </tr>
    </table>
    <p align="center" class="style2">
    <input type='submit' value='Register!' />
    </p>
    <p align="center" class="style2"></p>

  4. #4
    Account Upgraded | Title Enabled! randy1234 is offline
    MemberRank
    Mar 2009 Join Date
    SingaporeLocation
    1,196Posts

    Re: registerpage help

    LOL~ Host it on a vps.

    webhost dose not work really well (i doubt it works)

    and also its a php file not a html file

  5. #5
    Apprentice reinoudje is offline
    MemberRank
    Mar 2011 Join Date
    16Posts

    Re: registerpage help

    Quote Originally Posted by randy1234 View Post
    LOL~ Host it on a vps.

    webhost dose not work really well (i doubt it works)

    and also its a php file not a html file
    thanks for ur help

    but i dont have the money for vps

  6. #6
    @ your moms bed thajj is offline
    MemberRank
    Apr 2007 Join Date
    The NetherlandsLocation
    647Posts

    Re: registerpage help

    Quote Originally Posted by reinoudje View Post
    thanks for ur help

    but i dont have the money for vps
    Lol do you even have a mysql server on it? without that you cant do anything.

  7. #7
    Apprentice reinoudje is offline
    MemberRank
    Mar 2011 Join Date
    16Posts

    Re: registerpage help

    yes ofcourse i do xD



Advertisement