Re: hi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,
this is php code:

********************************

<?
$link=mysql_connect("localhost","root",""); 
$selectdb = @mysql_select_db("dbname"); 
$name=$_POST['name'];
$password=$_POST['password'];

if(isset($login))
{

	$select=mysql_query("SELECT * FROM login where
name='$name' && password='$password' ");
	while($row=mysql_fetch_array($select))
	{
	echo "<script>
				self.location='another_page.php?id=$id';
		 </script>";
    }
	else{
		echo"<script type='text/javascript'>
			alert ('Invalid Data')
			</script>";
			echo "<script>
					self.location='index.php?';
					</script>";

		 }
}
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1256">
<link href="../vse.css" rel="stylesheet"
type="text/css">
<style type="text/css">
<!--
..style2 {	font-size: 18px;
	font-weight: bold;
}
..style7 {font-size: 16px; color: #6699CC;}
..style9 {font-size: 14px; color: #6699CC;}
-->
</style>
</head>

<body>

<div align="center">
  <p>&nbsp;</p>
  <form name="form1" method="post" action="">
    <table width="265"  border="0">
      <tr>
        <td height="54" colspan="2"
class="tableheader"><div align="center"
class="style2">Log In </div></td>
      </tr>
      <tr>
        <td height="29" colspan="2"
class="tableheader-reg"><div align="right"
class="style9"> </div></td>
      </tr>
      <tr>
        <td height="46" class="tableheader-reg"><div
align="left">name
        </div></td>
        <td width="67" class="tableheader-reg">
          <div align="left">
            <input name="name" type="text" id="name"
lang="ar" dir="rtl">
          </div></td></tr>
      <tr>
        <td height="47" class="tableheader-reg"><div
align="left">password
        </div></td>
        <td class="tableheader-reg">
          <div align="left">
            <input name="password" type="password"
id="password2" lang="ar" dir="rtl">
          </div></td></tr>
      <tr>
        <td height="61" class="tableheader-reg"><div
align="right">
        </div></td>
        <td class="tableheader-reg"><input
name="login" type="submit" id="login2" value="log
in"></td>
      </tr>
      <tr>
        <td height="32" colspan="2"
class="tableheader-reg"><div align="right"
class="style7"></div></td>
      </tr>
    </table>
  </form>
</div>
</body>
</html>


********************************
this is mysql query
********************************

CREATE DATABASE `dbname`


CREATE TABLE `login` (
  `id` int(4) NOT 

NULL auto_increment,
 int(10) NOT NULL 

default '0',
  `name` varchar(16) NOT NULL 

default '',
  `password` varchar(16) NOT NULL 

default '',
 
  PRIMARY KEY  (`id`)
) 
INSERT INTO `login` VALUES (1, 

'name1','password1');

********************************
thanks.


--- ssrao_y2001 <sanari9@xxxxxxxxx> wrote:

> HI
> 
> I am trying login form
> 
> by only using php code
> 
> could plz send me the code
> 
> 
> regards
> sambasiv
> 
> 



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux