Update of /cvsroot/phpmp/phpMP
In directory usw-pr-cvs1:/tmp/cvs-serv26894
Added Files:
profile.php
Log Message:
Added a very primitive registration process. Needs a LOT of enhancing.
--- NEW FILE: profile.php ---
<?
/******************************************************************************
*******************************************************************************
phpMP - The World's Greatest Modular Portal
***********************************************
Are you MPowered?
Copyright (C) 2002 phpMP Development Group
All rights reserved.
Lead Programmer: Brian Rose
Lead Designer: Trevor Joynson
Filename: /index.php
Usage & Function: The file that makes it all happen!
Create Date: March 31, 2002
$Id: profile.php,v 1.1 2002/08/10 20:41:33 heimidal Exp $
*******************************************************************************
*******************************************************************************
This software is provided under the GPL software license. A copy of the
license should have been included with this software, located in the Docs
folder. Feel free to redistribute and/or modify it according to the
regulations stated in the license.
*******************************************************************************
******************************************************************************/
// Include The Main Configuration File
include("config.php");
if(!defined("PHPMP_INSTALLED")) {
header('Location: ./install.php');
}
// Include The Main Core File
include($MPCONF['GEN']['abs_path'] . "/includes/core.php");
global $PHPMP;
// Start phpMP
$PHPMP = new PHPMP();
$PHPMP->Init();
if($_GET['mode'] == 'register') {
if($_GET['action'] == 'submit') {
$sql = "SELECT user_id FROM " . $MPCONF['DB']['table_prefix'] . "users WHERE username='" . $_POST['r_username'] . "' OR email='" . $_POST['r_email'] . "'";
$qry = $DBA->query($sql);
if((!empty($_POST['r_username'])) && (!empty($_POST['r_password'])) && (!empty($_POST['r_password_conf'])) && (!empty($_POST['r_email']))) {
if(($DBA->num_rows($qry) == 0) && ($_POST['r_password'] == $_POST['r_password_conf'])) {
$sql = "INSERT INTO " . $MPCONF['DB']['table_prefix'] . "users (username, password, realname, email, location) VALUES('" . $_POST['r_username'] . "', MD5('" . $_POST['r_password'] . "'), '" . $_POST['r_realname'] . "', '" . $_POST['r_email'] . "', '" . $_POST['r_location'] . "')";
$DBA->query($sql);
$Template->display_template('register_fin.tpl');
} else {
header("Location: error.php?ecode=registration");
}
} else {
header("Location: error.php?ecode=registration");
}
} else {
$Template->display_template('register.tpl');
}
}
?>
|