I Need Wml+php+mysql Registration/login Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I Need Wml+php+mysql Registration/login Script

    PLz im need a wml+php+mysql registration/login script,

    #2
    PLz im need a wml+php+mysql registration/login script,[/b]
    Here is a simple one: http://www.2wap.org/forums/index.php?act=a...post&id=577
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      tnk

      Comment


        #4
        It already installs it, but when I enter from I telephone cellular, it says to me: Not WML content.

        Comment


          #5
          It already installs it, but when I enter from I telephone cellular, it says to me: Not WML content.[/b]
          please give me a link so i can take a look at it
          Advertise your mobile site for FREE with AdTwirl

          Comment


            #6
            PLz im need a wml+php+mysql registration/login script,[/b]
            give me 10 min..to code

            Comment


              #7
              1) create a tabel

              id : smallint(5) ; not null ; auto increment; primary key
              username : varchar(45); not null
              password : text; not null
              level : varchar(45); not null

              2) create index.php

              Code:
              <? 
              session_start(); 
              
              $host = "localhost"; 
              $user = "user"; 
              $pass = "pass contului"; 
              $dbase = "user_domain"; 
              $table = "users"; 
              
              function check_account($username, $password) { 
                 global $host, $user, $pass, $dbase, $table; 
                 $connection = @mysql_connect($host,$user,$pass); 
                 @mysql_select_db($dbase); 
                 $query = @mysql_query("SELECT id FROM ".$table." WHERE username=&#39;".$username."&#39; and password=&#39;".MD5($password)."&#39;",$connection); 
                 if (@mysql_num_rows($query) != 0) { 
                    return true; 
                    } else { 
                    return false; 
                    } 
                 @mysql_close($connection); 
                 } 
              function account_level($username) { 
                 global $host, $user, $pass, $dbase, $table; 
                 $connection = @mysql_connect($host,$user,$pass); 
                 @mysql_select_db($dbase); 
                 $query = @mysql_query("SELECT level FROM ".$table." WHERE username=&#39;".$username."&#39;",$connection); 
                 $result= @mysql_fetch_array($query); 
                 return $result[&#39;level&#39;]; 
                 @mysql_close($connection); 
                 } 
              
              if (!isset($_SESSION[&#39;auth&#39;])) { 
                 $_SESSION[&#39;auth&#39;] = "logout"; 
                 } 
              if ((isset($_POST[&#39;action&#39;])) && ($_POST[&#39;action&#39;] == "login")) { 
                 if (check_account(strip_tags($_POST[&#39;username&#39;]),strip_tags($_POST[&#39;password&#39;]))) { 
                    $_SESSION[&#39;auth&#39;] = "login"; 
                    $_SESSION[&#39;account&#39;][&#39;username&#39;] = strip_tags($_POST[&#39;username&#39;]); 
                    $_SESSION[&#39;account&#39;][&#39;level&#39;] = account_level(strip_tags($_POST[&#39;username&#39;])); 
                    } else { 
                       echo "eronata !
              
              "; 
                    } 
                 } 
              
              if ((isset($_POST[&#39;action&#39;])) && ($_POST[&#39;action&#39;] == "logout")) { 
                 $_SESSION[&#39;auth&#39;] = "logout"; 
                 } 
              ?> 
              <html> 
              <head> 
              </head> 
              <body> 
              <? 
                 if ($_SESSION[&#39;auth&#39;] == "logout") { 
              ?> 
              <form action="<? echo $_SERVER[&#39;PHP_SELF&#39;]; ?>" method="post"> 
                 Username <input type="text" name="username">
               
                 Password <input type="password" name="password">
              
               
                 [url="create.php"]register[/url]
              
               
                 <input type="hidden" name="action" value="login"> 
                 <input type="submit" name="Submit" value="login"> 
              </form> 
              <? 
                 } elseif ($_SESSION[&#39;auth&#39;] == "login") { 
                    echo "Username: ".$_SESSION[&#39;account&#39;][&#39;username&#39;]."
              "; 
                    echo "Level: ".$_SESSION[&#39;account&#39;][&#39;level&#39;]."
              
              "; 
              ?> 
              <form action="<? echo $_SERVER[&#39;PHP_SELF&#39;]; ?>" method="post"> 
                 <input type="hidden" name="action" value="logout"> 
                 <input type="submit" name="Submit" value="logout"> 
              </form> 
              <? 
                 } 
              ?> 
              </body> 
              </html>
              create.php
              Code:
              <? 
              $host = "localhost"; 
              $user = "user_"; 
              $pass = "parola contului"; 
              $dbase = "user_"; 
              $table = "users"; 
              
              function check_account($username) { 
                 global $host, $user, $pass, $dbase, $table; 
                 $connection = @mysql_connect($host,$user,$pass); 
                 @mysql_select_db($dbase); 
                 $query = @mysql_query("SELECT id FROM ".$table." WHERE username=&#39;".$username."&#39;"); 
                 if (@mysql_num_rows($query) == 0) { 
                    return true; 
                    } else { 
                    return false; 
                    } 
                 @mysql_close($connection); 
                 } 
              
              function create_account($username, $password, $level) { 
                 global $host, $user, $pass, $dbase, $table; 
                 $connection = @mysql_connect($host,$user,$pass); 
                 @mysql_select_db($dbase); 
                 @mysql_query("INSERT INTO ".$table." VALUES (&#39;&#39;,&#39;".$username."&#39;,&#39;".MD5($password)."&#39;,&#39;".$level."&#39;)",$connection); 
                 @mysql_close($connection); 
                 } 
              
              if ((isset($_POST[&#39;action&#39;])) && ($_POST[&#39;action&#39;] == "create")) { 
                 if (check_account(strip_tags($_POST[&#39;username&#39;]))) { 
                    create_account(strip_tags($_POST[&#39;username&#39;]),strip_tags($_POST[&#39;password&#39;]),$_POST[&#39;level&#39;]); 
                    echo "Contul a fost creat cu succes.
              
              "; 
                    echo "<a href=\"index.php\">login</a>"; 
                    exit; 
                    } else { 
                       echo "NAme alerty exist
              
              "; 
                       } 
                 } 
              
              ?> 
              <html> 
              <head> 
              </head> 
              <body> 
              <form action="<? echo $_SERVER[&#39;PHP_SELF&#39;]; ?>" method="post"> 
                 Username <input type="text" name="username">
               
                 Password <input type="password" name="password">
               
                 Level 
                 <select name="level"> 
                    <option value="administrator">administrator</option> 
                    <option value="moderator">moderator</option> 
                    <option value="user">user</option> 
                 </select>
              
               
                 <input type="hidden" name="action" value="create"> 
                 <input type="submit" name="Submit" value="create"> 
              </form> 
              </body> 
              </html>

              Sry for my english.....i write in romania txt...and i translate this text

              Dupa autentificare, pentru obtinerea user-ului logat si al nivelului acestuia, te joci cu variabilele $_SESSION[&#39;account&#39;][&#39;username&#39;] si $_SESSION[&#39;account&#39;][&#39;level&#39;] care sunt vor fi vizibile peste tot De asemenea, am facut cam tot ce se putea in privinta securitatii a.i. parolele sunt criptate in baza de date + autentificarea nu se poate face decat de pe contul tau

              report erors

              Comment

              Working...
              X