| px | top | add code | search | signup | login | help |
<?php
/*
http://www.china-on-site.com/flexcust/
Flexcustomer is a simple, free and open source users management module. Users can register, edit their information and password or find their lost password.Administor can search, delete or browse users' information. This program is easy to be internationalized.Friendly interface and install system is available. Low price customization service is provided.
*/
require("./DbSql.inc.php");
Class CustomSQL extends DBSQL
{
// the constructor
function CustomSQL($DBName = "")
{
$this->DBSQL($DBName);
}
function checkusername($username)
{
$sql = "select customerid from customer where username='$username'";
$result = $this->select($sql);
return $result;
}
function adduser($username,$password,$email,$homepage,$icq,$aol,$yahoo,$msn,$location,$occupation,$interests,$biography)
{
$sql = "insert into customer (username,password,email,homepage,icq,aol,yahoo,msn,location,occupation,interests,biography) values ('$username','$password','$email','$homepage','$icq','$aol','$yahoo','$msn','$location','$occupation','$interests','$biography')";
$result = $this->insert($sql);
return $result;
}
function logincheck($username,$password)
{
$sql = "select customerid from customer where username='$username' and password='$password'";
$result = $this->select($sql);
if (empty($result)) {
return 0;
}else{
$CID = $result[0]["customerid"];
return $CID;
}
}
function checkpassword($customerid,$password)
{
$sql = "select customerid from customer where password='$password' and customerid='$customerid'";
$result = $this->select($sql);
if (empty($result)) {
return 0;
}else{
$CID = $result[0]["customerid"];
return $CID;
}
}
function emailcheck($email)
{
$sql = "select password from customer where email='$email'";
$result = $this->select($sql);
if (empty($result)) {
return 0;
}else{
$password = $result[0]["password"];
return $password;
}
}
function getuserinfobyid($customerid)
{
$sql = "select * from customer where customerid='$customerid'";
$result = $this->select($sql);
return $result;
}
function edituser($email,$homepage,$icq,$aol,$yahoo,$msn,$location,$occupation,$interests,$biography,$customerid)
{
$sql = "update customer set email='$email',homepage='$homepage',icq='$icq',aol='$aol',yahoo='$yahoo',msn='$msn',location='$location',occupation='$occupation',interests='$interests',biography='$biography' where customerid='$customerid'";
$results = $this->update($sql);
return $results;
}
function modifypass($password,$customerid)
{
$sql = "update customer set password='$password' where customerid='$customerid'";
$results = $this->update($sql);
return $results;
}
}
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.