You are here: what's wrong with this code? i am getting a blank page when i pass my form data to it « PHP Programming Language « IT news, forums, messages
what's wrong with this code? i am getting a blank page when i pass my form data to it

Posted by anon@the.net on 10/07/17 11:29

<?php

if(! isset($_POST['username'])) {
header("Location: login.php");
}

mysql_connect(DELETED)
mysql_select_db(DELETED)

$username = $_POST['username'];
$username = mysql_real_escape_string($username);
$result = mysql_query("SELECT userid, pswd FROM users WHERE username = '$username'");

if(mysql_num_rows($result) > 0) {
$row = mysql_fetch_assoc($result);
$userid = $row['userid'];
$pswd = $row['pswd'];
}

$formpswd = $_POST['password'];
$formpswd = md5($formpswd);

if(mysql_num_rows($result) == 0) {
header("Location: login.php");
} else if($pswd == $formpswd) {
session_unset();
session_destroy();
session_start();
$_SESSION['userid'] = $userid;
header("Location: userhome.php");
}

mysql_close();

?>
--
----------------------------------------------
Posted with NewsLeecher v3.0 Final
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация