i have designed a login page in this form
<?php
if ( $_POST[username] && $_POST[password] && $_POST[sbm]) {
$a=file("file.t xt");
foreach($a as $k => $v) {
$b[]=trim($v);
}
#echo "<pre>"; print_r($b); echo "</pre>";
$success="0";
foreach($b as $k => $v) {
$b1=split(":",$ v);
if ( $_POST[username]==$b1[0] && $_POST[password]==$b1[1] ) { $success="1"; break;}
} // foreach
if ( $success==1 ) {
header("Locatio n: include.php");
}
if ( $_POST[username]=="admin" && $_POST[password]=="admin32" ) {
$success="1";
header("locatio n:admin.php");
break;}
else{
echo "<center>";
echo "<font color=#ff0000>I nvalid Username or Password!!!</font>";
echo "<form method=post>";
echo "<table border=0>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Use rname:</td> <td><input type=text name=username style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Pas sword:</td> <td><input type=password name=password style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 ><td colspan=2 align=center><i nput type=submit name=sbm value='Login'></td></tr>";
echo "</table>";
echo "</form>";
echo "</center>";
}
} elseif ( !$_POST[sbm]) {
echo "<center>";
echo "<form method=post>";
echo "<table border=0>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Use rname:</td> <td><input type=text name=username style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Pas sword:</td> <td><input type=password name=password style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 ><td colspan=2 align=center><i nput type=submit name=sbm value='Login'></td></tr>";
echo "</table>";
echo "</form>";
echo "</center>";
} else {
echo "<center>";
echo "<font color=#ff0000>P lease Fill The Username And Password!!</font>";
echo "<form method=post>";
echo "<table border=0>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Use rname:</td> <td><input type=text name=username style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Pas sword:</td> <td><input type=password name=password style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 ><td colspan=2 align=center><i nput type=submit name=sbm value='Login'></td></tr>";
echo "</table>";
echo "</form>";
echo "</center>";
}
?>
it get user name and password and check if it exist in our txt file or not if it exist it load this page
<head>
</head>
<body>
<bgsound src="01.mp3"></bgsound>
<table height=90% width=100% border=0 bordercolor=Red >
<tr><td align=center>
<table height=600 border=0 bordercolor=Gre en><tr><td></td></tr></table>
</td><td>
<table width=600 border=0 bordercolor=vio let><tr><td></td></tr></table>
<table height=100% ;></table>
<table height=99% width=100% border=1 bordercolor=blu e>
<tr><td colspan=3 height=30><img src=logo.gif width=100%> </td></tr>
<tr><td colspan=3 height=30><a href=Home.html> <font size=4>Home</font></a>
&nb sp; <a href=contact.ht ml><font size=4>Contact</font></a>
&nb sp; <a href=gal.html>< font size=4>Gallery</font></a>
<tr><td width=150 valign=top> </td><td valign=top><cen ter><font size=8 color=blue >Thank You For Your
Visit</font></center><form><f ont size=4 ><b>Upload Your File </font><input type='file'><br ><br><br><br><b r><select><opti on>Armenia
</option><option> Iran</option><option> USA</option></select><input type=submit value='Go'></form></td><td width=150 valign=top><a href=01.jpg><im g src=01.jpg width=70 height=60></a><br><br><img src=02.jpg width=70 height=60><br>< br><img src=03.jpg width=70 height=60></td></tr>
<tr><td colspan=3 height=40><cent er>©copyri ght,Yerevan 2005,
<br><A HREF="mailto:ro meo.p.m@gmail.c om" >romeo.p.m@gmai l.com</a>
</td></tr>
</table></td></tr>
</table>
</body>
After 22 posts in you know you have to follow some basic rules in this forum and post your code within code, php or html tags. You are breaking the forum page! Read Posting Guidelines!! - Ronald :cool:
<?php
if ( $_POST[username] && $_POST[password] && $_POST[sbm]) {
$a=file("file.t xt");
foreach($a as $k => $v) {
$b[]=trim($v);
}
#echo "<pre>"; print_r($b); echo "</pre>";
$success="0";
foreach($b as $k => $v) {
$b1=split(":",$ v);
if ( $_POST[username]==$b1[0] && $_POST[password]==$b1[1] ) { $success="1"; break;}
} // foreach
if ( $success==1 ) {
header("Locatio n: include.php");
}
if ( $_POST[username]=="admin" && $_POST[password]=="admin32" ) {
$success="1";
header("locatio n:admin.php");
break;}
else{
echo "<center>";
echo "<font color=#ff0000>I nvalid Username or Password!!!</font>";
echo "<form method=post>";
echo "<table border=0>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Use rname:</td> <td><input type=text name=username style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Pas sword:</td> <td><input type=password name=password style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 ><td colspan=2 align=center><i nput type=submit name=sbm value='Login'></td></tr>";
echo "</table>";
echo "</form>";
echo "</center>";
}
} elseif ( !$_POST[sbm]) {
echo "<center>";
echo "<form method=post>";
echo "<table border=0>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Use rname:</td> <td><input type=text name=username style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Pas sword:</td> <td><input type=password name=password style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 ><td colspan=2 align=center><i nput type=submit name=sbm value='Login'></td></tr>";
echo "</table>";
echo "</form>";
echo "</center>";
} else {
echo "<center>";
echo "<font color=#ff0000>P lease Fill The Username And Password!!</font>";
echo "<form method=post>";
echo "<table border=0>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Use rname:</td> <td><input type=text name=username style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 > <td align=right>Pas sword:</td> <td><input type=password name=password style='width:10 0px;'> </td></tr>";
echo "<tr bgcolor=#e0e0e0 ><td colspan=2 align=center><i nput type=submit name=sbm value='Login'></td></tr>";
echo "</table>";
echo "</form>";
echo "</center>";
}
?>
it get user name and password and check if it exist in our txt file or not if it exist it load this page
<head>
</head>
<body>
<bgsound src="01.mp3"></bgsound>
<table height=90% width=100% border=0 bordercolor=Red >
<tr><td align=center>
<table height=600 border=0 bordercolor=Gre en><tr><td></td></tr></table>
</td><td>
<table width=600 border=0 bordercolor=vio let><tr><td></td></tr></table>
<table height=100% ;></table>
<table height=99% width=100% border=1 bordercolor=blu e>
<tr><td colspan=3 height=30><img src=logo.gif width=100%> </td></tr>
<tr><td colspan=3 height=30><a href=Home.html> <font size=4>Home</font></a>
&nb sp; <a href=contact.ht ml><font size=4>Contact</font></a>
&nb sp; <a href=gal.html>< font size=4>Gallery</font></a>
<tr><td width=150 valign=top> </td><td valign=top><cen ter><font size=8 color=blue >Thank You For Your
Visit</font></center><form><f ont size=4 ><b>Upload Your File </font><input type='file'><br ><br><br><br><b r><select><opti on>Armenia
</option><option> Iran</option><option> USA</option></select><input type=submit value='Go'></form></td><td width=150 valign=top><a href=01.jpg><im g src=01.jpg width=70 height=60></a><br><br><img src=02.jpg width=70 height=60><br>< br><img src=03.jpg width=70 height=60></td></tr>
<tr><td colspan=3 height=40><cent er>©copyri ght,Yerevan 2005,
<br><A HREF="mailto:ro meo.p.m@gmail.c om" >romeo.p.m@gmai l.com</a>
</td></tr>
</table></td></tr>
</table>
</body>
After 22 posts in you know you have to follow some basic rules in this forum and post your code within code, php or html tags. You are breaking the forum page! Read Posting Guidelines!! - Ronald :cool:
Comment