topical media & game development
basic-php-16-transact-user.php / php
<?php
require_once 'conn.php';
require_once 'http.php';
if (isset(_REQUEST['action']) {
case 'Login':
if (isset(_POST['passwd'])) {
_POST['email'] . "' " .
"AND passwd='" . result = mysql_query(conn)
or die('Could not look up user information; ' .
mysql_error());
if (result)) {
session_start();
row['id'];
row['access_lvl'];
row['name'];
row['last_login'];
row['id'];
mysql_query(conn)
or die(mysql_error() . "<br>" . _POST['name'])
and isset(_POST['passwd'])
and isset(_POST['passwd'] == sql = "INSERT INTO forum_users " .
"(email,name,passwd,date_joined,last_login) " .
"VALUES ('" . _POST['name'] . "','" . sql, _SESSION['user_id'] = mysql_insert_id(_SESSION['access_lvl'] = 1;
_POST['name'];
_POST['name'])
and isset(_POST['accesslvl'])
and isset(sql = "UPDATE forum_users " .
"SET email='" . _POST['name'] .
"', access_lvl=" . _POST['signature'] . "' " .
" WHERE id=" . sql, sql);
}
redirect('admin.php');
break;
case 'Edit Account':
if (isset(_POST['email'])
and isset(_POST['userid'])) {
_POST['oldpasswd'])
and sql = "SELECT passwd FROM forum_users " .
"WHERE id=" . result = mysql_query(row = mysql_fetch_array(row['passwd'] == _POST['passwd']))
and (isset(_POST['passwd'] == chg_pw = TRUE;
} else {
redirect('useraccount.php?error=nopassedit');
break;
}
}
}
_POST['email'] .
"', name='" . _POST['accesslvl'] .
", signature='" . chg_pw) {
_POST['passwd'];
}
_POST['userid'];
mysql_query(conn)
or die('Could not update user account... ' . mysql_error() .
'<br>SQL: ' . _POST['userid']);
break;
case 'Send my reminder!':
if (isset(sql = "SELECT passwd FROM forum_users " .
"WHERE email='" . result = mysql_query(conn)
or die('Could not look up password; ' . mysql_error());
if (mysql_num_rows(row = mysql_fetch_array(subject = 'Comic site password reminder';
row['passwd'] .
"\n\nYou can use this to log in at http://" .
_SERVER['PHP_SELF']) . '/login.php?e=' .
headers = "From: admin@yoursite.com\r\n";
mail(subject,headers)
or die('Could not send reminder email.');
}
}
redirect('login.php');
break;
}
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.