pros idikous tou idous !!!!

Papadogiannakis Vagelis papas at wise.gr
Thu Jul 11 12:35:44 EEST 2002


On Wed, 10 Jul 2002 17:53:17 +0300
Μαραβέλιας Γεώργιος <gmaravel at her.forthnet.gr> wrote:

> <form method="get">
>     <table>
>       <tr>
>         <td> Login &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </td>
>         <td> <input type="text" name="name">       </td>
>       </tr>
>       <tr>
>         <td> Password &nbsp;: </td>
>         <td> <input type="password" name="pass"> </td>
>       </tr>
>     </table>
>      </div>
> 
>      <br><br>
>      <div align="center"><input type="submit" name="loginin" value="Log in"> </div>
>    </form>
> 
> 
>       <?
> 
>      mysql_connect("localhost" , "root" , "" ) ;
>      if ( isset ($name)  && isset ($pass))
>       {
>       $query = "select *  from users where (username=('$name') and passwd=('$pass')) "  ;
>       $result = mysql_db_query("pvcalc", $query ) ;
> 
>       if ($result )
>        { echo "test" ; }
> 
>       }
>        mysql_free_result($result) ;
>  ?>


<?php
if (isset($HTTP_POST_VARS['name'])  && isset ($HTTP_POST_VARS['pass'])){ #USE HTTP_POST_VARS
  mysql_connect("localhost" , "USER" , "PASSWORD" ) ; # MI VAZEIS ROOT POU8ENA
  $query = "SELECT *  FROM users WHERE username='$name' AND passwd='$pass'"; 
  $result = mysql_db_query("'vcalc', $query ); #keep in mind oti edo den lambanei ipopsin tou to case sto name/pass

  if (mysql_num_rows($result)>1){ #num rows prepei na valeis
    #an 8es edo vazeis ejtra elegxo gia case sensitivity
    echo "AUTHENTICATION OK!" ;
  }else{
    echo 'Authetication Failed';
  }
}
?>


<form method="post" action="TO_SCRIPTAKI_POU_KANEI_TO_VALIDATION.php"> # PREPEI NA VALEIS ACTION
    <table>
      <tr>
        <td>Login:</td>
        <td><input type="text" name="name" /></td> # USE XHTML SYNTAX
      </tr>
      <tr>
        <td> Password: </td>
        <td> <input type="password" name="pass" /> </td> # USE XHTML SYNTAX
      </tr>
    </table>
     </div>

     <br /><br /># USE XHTML SYNTAX
     <div align="center"><input type="submit" name="loginin" value="Log in" /> </div> # USE XHTML SYNTAX
   </form>


fisika mporei na ginei akoma kalitero, alla sou ftanei. An 8es na kratisei to login kai gia alles selides, 8a prepei na doseis kai kana koulouraki i na valeis kana session_start.

Perissotera katopin pliromis ;>

--
Vagelis Papadogiannakis
http://www.wise.gr
papas at wise.gr



More information about the Herlug mailing list