Jump to content


Photo

anyone help please


  • Please log in to reply
3 replies to this topic

#1 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 April 2006 - 06:27 AM

guy i have a members database like that

first_name varchar(50) NO
last_name varchar(50) NO
email_address varchar(50) NO
signup_date datetime NO
verified enum('0','1') NO 0
last_login datetime NO
bio tinytext NO
admin_access enum('0','1') NO 0
username varchar(50) NO
password

ok guys , now i wanna create the admistrator username and password so that i can sign in as a administrator , how can i insert the username n passwors in the members tab , so can anyone tell me how to do this , i am a newbie with lots of interest in php n mysql , thx i'll be waiting for your reply thx

#2 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 April 2006 - 07:16 AM

[!--quoteo(post=361119:date=Apr 3 2006, 01:27 AM:name=apprentice webmaster)--][div class=\'quotetop\']QUOTE(apprentice webmaster @ Apr 3 2006, 01:27 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
guy i have a members database like that

first_name varchar(50) NO
last_name varchar(50) NO
email_address varchar(50) NO
signup_date datetime NO
verified enum('0','1') NO 0
last_login datetime NO
bio tinytext NO
admin_access enum('0','1') NO 0
username varchar(50) NO
password

ok guys , now i wanna create the admistrator username and password so that i can sign in as a administrator , how can i insert the username n passwors in the members tab , so can anyone tell me how to do this , i am a newbie with lots of interest in php n mysql , thx i'll be waiting for your reply thx
[/quote]


no one can help me on that subject ?..........

#3 Desdinova

Desdinova
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 03 April 2006 - 07:16 AM

do you have a login script?

and do you want this query to be for PHP?

#4 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 April 2006 - 07:18 AM

[!--quoteo(post=361124:date=Apr 3 2006, 02:16 AM:name=Desdinova)--][div class=\'quotetop\']QUOTE(Desdinova @ Apr 3 2006, 02:16 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
do you have a login script?

and do you want this query to be for PHP?
[/quote]
here's the login script
<?php
include $_SERVER['DOCUMENT_ROOT'].
'/bpo/layout.php';
switch($_REQUEST['req']){

case "validate":
$validate = mysql_query("SELECT * FROM members
WHERE username='{$_POST['username']}'
AND password = md5('{$_POST['password']}')
AND verified='1'
") or die (mysql_error());

if(mysql_num_rows($validate) == 1){
while($row = mysql_fetch_assoc($validate)){
$_SESSION['login'] = true;
$_SESSION['userid'] = $row['id'];
$_SESSION['first_name'] = $row['first_name'];
$_SESSION['last_name'] = $row['last_name'];
$_SESSION['email_address'] = $row['email_address'];
$_SESSION['cid'] = $row['cart_id'];
setcookie('cid', $unique_cid, time()+24*3600*60);

if($row['admin_access'] == 1){
$_SESSION['admin'] = true;
}
$login_time = mysql_query("UPDATE members
SET last_login=now()
WHERE id='{$row['id']}'");
}
header("Location: /bpo/login.php");
} else {
myheader("Login Failed!");
echo '<p align="center">Login Failed</p>';
echo '<p align="center">If you have already joined '.
'our website, you may need to validate your email '.
'address. Please check your email for instructions.';
footer();
}
break;

default:
myheader("Login!");
include $_SERVER['DOCUMENT_ROOT'].
'/bpo/html/forms/login_form.html';
footer();
break;
}
?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users