The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: sc2 | April 17, 2011 @ 11:56am
PHP Code
[
Download
]
<?php if (!isset($_POST['username']) || !isset($_POST['password'])) { echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">'; } elseif (empty($_POST['username']) || empty($_POST['password'])) { echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">'; } else { $dbHost = "localhost"; $dbUser = ""; $dbPass = ""; $dbDatabase = ""; $db = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die ("Kunde inte ansluta till Databasen"); $user = mysql_real_escape_string($_POST['username']); $pass = md5($_POST['password']); mysql_select_db("$dbDatabase", $db) or die ("Kunde inte hitta $dbDatabase"); $result=mysql_query("select * from members where username='$user' AND password='$pass'", $db); $rowCheck = mysql_num_rows($result); if($rowCheck > 0) { while($row = mysql_fetch_array($result)) { session_start(); $_SESSION['username'] = $user; $_SESSION['lastpage'] = 'login.php'; echo '<META HTTP-EQUIV="Refresh" Content="1; URL=edit.php">'; } } else { echo 'Inkorrekt Anv�ndarnamn eller L�senord. Prova igen!'; } } ?>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.50 / 8
38 Votes
http://codebin.yi.org/1226
page generated in 0.00 seconds