phpbb to my website
- saad_sinpk
- Born


- Joined: Jan 29, 2010
- Posts: 3
- Status: Offline
hi i want to make 1 login for my website and phpbb forum , i try, i join both db and make 1 table phpbb_user, now i am getting this error
1062 - Duplicate entry '' for key 2
insert into phpbb_users (user_name, user_email, user_forname, user_nickname, user_gender, user_birthday, username, user_password, user_image, user_ip, user_status) values ('sadsa', 'emailcom', 'asdasdas', '', 'Mlle', '--', 'sadasd', '25f9e794323b453885f5181f1b624d0b', '', '119.63.136.101', 'active')
1062 - Duplicate entry '' for key 2
insert into phpbb_users (user_name, user_email, user_forname, user_nickname, user_gender, user_birthday, username, user_password, user_image, user_ip, user_status) values ('sadsa', 'emailcom', 'asdasdas', '', 'Mlle', '--', 'sadasd', '25f9e794323b453885f5181f1b624d0b', '', '119.63.136.101', 'active')
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
January 29th, 2010, 1:34 pm
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
- saad_sinpk
- Born


- Joined: Jan 29, 2010
- Posts: 3
- Status: Offline
first, i move my website db connection to phpbb website, then i remove my website user table and movie to phpbb_user, and change coding in my files,
one more thing when i first try i join at first, but when i try second time, it is not allow me, then i delete that user from db, and again i try to join, i get in
here is my db phpbb_user structure
one more thing when i first try i join at first, but when i try second time, it is not allow me, then i delete that user from db, and again i try to join, i get in
here is my db phpbb_user structure
Attachments:
Attachments:
Attachments:
Attachments:
Attachments:
- joebert
- Sledgehammer


- Joined: Feb 10, 2004
- Posts: 13455
- Loc: Florida
- Status: Offline
Sounds like there's a flaw in the code that handles new members. Duplicate key sounds like either you're trying to set the user_id which should be auto_incremented, or you haven't accounted for existing email addresses or something.
Have you been through the following ?
http://wiki.phpbb.com/Authentication_plugins
Have you been through the following ?
http://wiki.phpbb.com/Authentication_plugins
Strong with this one, the sudo is.
- saad_sinpk
- Born


- Joined: Jan 29, 2010
- Posts: 3
- Status: Offline
here is my register.php code
what is my problem
Code: [ Select ]
<?php require_once('admin/inc/config.php');?>
<?
switch($action)
{
case 'register':
$user_gender =$_POST['gender'];
$user_name =$_POST['name'];
$user_email =$_POST['user_email'];
$user_forname=$_POST['forname'];
$user_nickname=$_POST['nickname'];
$user_birthday =$_POST['dd'].'-'.$_POST['mm'].'-'.$_POST['yy'];
$username =$_POST['username'];
$user_password=$_POST['user_password'];
$sql ="select * from ".TABLE_USERS." where username='$username' or user_email='$user_email'";
$res =tep_db_query($sql);
$row =tep_db_fetch_assoc($res);
if(tep_db_num_rows($res) > (int)1)
{
$err=base64_encode("e-mail ou l'ID utilisateur existe déjà s'il vous plaît choisir un autre!");
}
else if($row['user_email']==$user_email)
{
$err=base64_encode("Cet e-mail id existe déjà s'il vous plaît choisir un autre!");
}
else if($row['username']==$username)
{
$err=base64_encode("Cet ID utilisateur existe déjà choisir un autre!");
}
else{
$image=uploadImage('image', 'images/users/',96,'',32,"register.php?err=Please upload specified file size!",600);
$sql_data_array=array('user_name' =>$user_name,
'user_email' =>$user_email,
'user_forname' =>$user_forname,
'user_nickname' =>$user_nickname,
'user_gender' =>$user_gender,
'user_birthday' =>$user_birthday,
'username' =>$username,
'user_password' =>md5($user_password),
'user_image' =>$image,
'user_ip' =>USER_IP,
'user_status' =>'active'
);
$res=tep_db_perform(TABLE_USERS, $sql_data_array);
if($res)
{
tep_redirect("register.php?msg=".base64_encode("You are successfuly registered now you can access your account"));
}
}
break;
case 'edit':
$sql="select * from ".TABLE_USERS." where user_id='".$_SESSION['site_username']."'";
break;
case 'login':
$username =$_POST['username'];
$user_password =md5($_POST['user_password']);
$sql ="select * from ".TABLE_USERS." where username='".tep_db_input($username)."' and user_password='".tep_db_input($user_password)."'";
$res =tep_db_query($sql);
$row =tep_db_fetch_assoc($res);
if($username=='' && $_POST['user_password']=='')
{
tep_redirect("login.php?err=".base64_encode("Sorry user id and password canot left blank!"));
}
else if($row['user_status']=='inactive')
{
tep_redirect("login.php?err=".base64_encode("Your account has not activated contact administrator!"));
}
else if(tep_db_num_rows($res)>(int)0)
{
tep_session_register("site_user_name");
tep_session_register("site_username");
$_SESSION['site_user_name']=$row['username'];
$_SESSION['site_username'] =$row['user_id'];
//previous page
if(isset($_SESSION['last_return_url'])) {
list($page)= explode('.php',basename($_SESSION['last_return_url']) );
}else{
$page='';
}
//end
//check weather session is active or not
if(isset($_SESSION['cId']) && $_SESSION['cId']==1){
tep_redirect('checkout.php?step=1');
}else if(isset($_SESSION['last_return_url']) && $page=='video' ){
tep_redirect($_SESSION['last_return_url']);
}else{
tep_redirect('dashboard.php');
}
//end
}
else{
tep_redirect("login.php?err=".base64_encode("Wrong user id or password!"));
}
break;
case 'logout':
if(tep_session_is_registered('site_user_name')){
tep_session_unregister('site_user_name');
tep_session_unregister('site_username');
tep_session_unregister('last_return_url');
tep_redirect("login.php?msg=".base64_encode("You have successfully signed out!"));
}else{
tep_redirect("login.php");
}
break;
}
// date month year
$date =array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26',
'27','28','29','30','31');
$month =array('01','02','03','04','05','06','07','08','09','10','11','12');
// end
$msg=tep_string_convert($msg,'base64'); //calling string convertion function
$err=tep_string_convert($err,'base64'); //calling string convertion function
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>rougejaunevert</title>
<META name="description" content="rougejaunevert">
<META name="keywords" content="news, guinee, guinea, articles, election, 2010, conakry, labe, kankan, video, radio, candidats, candidat, candidates, candidate, vote, lansana, conte, dadis, moussa, camara, colone,l general, t-shirt, love, shop, achat">
<link rel="shortcut icon" href="favicon.ico" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="tutorsty.css" rel="stylesheet" type="text/css" />
<link href="flexcrollstyles.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src="flexcroll.js"></script>
<script language="javascript" src="js/valid.js"></script>
<!--valid user name-->
<script src="js/jquery.js" type="text/javascript" language="javascript"></script>
<script language="javascript">
//<!---------------------------------+
// Developed by Roshan Bhattarai
// Visit http://roshanbh for this script and more.
// This notice MUST stay intact for legal use
// --------------------------------->
$(document).ready(function()
{
$("#username").blur(function()
{
//remove all the class add the messagebox classes and start fading
$("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
//check the username exists or not from ajax
$.post("user_availability.php",{ user_name:$(this).val() } ,function(data)
{
if(data=='no') //if username not avaiable
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Cet ID utilisateur existe déjà choisir un autre').addClass('messageboxerror').fadeTo(900,1); return false;
});
}
else if(data=='blank') //if username not avaiable
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Sil vous plaît entrer votre nom dutilisateur').addClass('messageboxerror').fadeTo(900,1); return false;
});
}
else
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Userid disponible pour enregistrer').addClass('messageboxok').fadeTo(900,1);
});
}
});
});
});
</script>
<style type="text/css">
.top {
margin-bottom: 15px;
}
.messagebox{
position:absolute;
width:100px;
margin-left:30px;
border:1px solid #c93;
background:#ffc;
padding:3px;
}
.messageboxok{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #349534;
background:#C9FFCA;
padding:3px;
font-weight:bold;
color:#008000;
}
.messageboxerror{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #CC0000;
background:#F7CBCA;
padding:3px;
font-weight:bold;
color:#CC0000;
}
</style>
<!--end-->
</head>
<body>
<table width="984" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="hraderbg">
<? require_once('inc/header.php');?>
</td>
</tr>
<tr>
<td><table width="984" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="657" align="left" valign="top"><table width="657" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="padB"><? tep_inner_banner(0);?></td>
</tr>
<tr>
<td class="padB"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:#FFFFFF url(images/content-m-top.gif) no-repeat top;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:url(images/contnet-m-btm.gif) no-repeat bottom;"><table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="brdrB"><h1>Vous Tes Un Nouveau Client ?</h1></td>
</tr>
<tr>
<td class="brdB">(Champs obligatoires <font class="redCommentText">*</font>)</td>
</tr>
<tr>
<td class="padTB">
<?php echo (!empty($msg)) ? '<div class="success">'.$msg.'</div>' : '';?>
<?php echo (!empty($err)) ? '<div class="error">'.$err.'</div>' : '';?>
<form method="post" name="userform" action="register.php?action=register" enctype="multipart/form-data" onsubmit="javascript:return validRegister()">
<table width="100%" cellpadding="4" cellspacing="0" style="padding-left:10px;" bgcolor="#FFFFFF">
<tr>
<td>Civilite <font class="redCommentText">*</font></td>
<td align="left">
<table width="200" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="20"><input type="radio" name="gender" value="Mlle" <? if(isset($gender) && $gender=='Mile') echo 'checked';?> /></td>
<td width="33">Mlle</td>
<td width="20"><input type="radio" name="gender" value="Mme" <? if(isset($gender) && $gender=='Mme') echo 'checked';?> /></td>
<td width="43">Mme</td>
<td width="20"><input type="radio" name="gender" value="M" <? if(isset($gender) && $gender=='M') echo 'checked';?> /></td>
<td width="40">M</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Votre adresse e-mail<font class="redCommentText">*</font></td>
<td align="left">
<input type="text" name="user_email" class="box" size="40" value="<? echo isset($user_email) ? $email : '';?>" />
</td>
</tr>
<tr>
<td>User Id<font class="redCommentText">*</font></td>
<td align="left">
<input type="text" name="username" id="username" class="box" size="30" maxlength="20" />
<span id="msgbox" style="display:none"></span>
</td>
</tr>
<tr>
<td>Votremotdepasse<font class="redCommentText">*</font></td>
<td align="left">
<input type="password" name="user_password" class="box" size="30" maxlength="30" /> </td>
</tr>
<tr>
<td>Confirmez Votremotdepasse<font class="redCommentText">*</font></td>
<td align="left">
<input type="password" name="confirm_pass" class="box" size="30" maxlength="30" /> </td>
</tr>
<tr>
<td width="25%">Nom<font class="redCommentText">*</font></td>
<td width="75%" align="left">
<input type="text" name="name" class="box" size="40" value="<? echo isset($name) ? $name : '';?>" />
</td>
</tr>
<tr>
<td>Prnom<font class="redCommentText">*</font></td>
<td align="left">
<input type="text" name="forname" size="40" value="<? echo isset($forname) ? $forname : '';?>">
</td>
</tr>
<tr>
<td>Pseudo</td>
<td align="left">
<input type="text" name="nickname" size="40" value="<? echo isset($name) ? $name : '';?>" />
</td>
</tr>
<tr>
<td>Date de naissance</td>
<td align="left">
<select name="dd">
<option value="">DD</option>
<?
foreach($date as $val)
{
?>
<option value="<? echo $val;?>" <? if(isset($_POST['dd']) && $_POST['dd']==$val) echo 'selected';?>><? echo $val;?></option>
<?
}
?>
</select>
<select name="mm">
<option value="">MM</option>
<?
foreach($month as $val)
{
?>
<option value="<? echo $val;?>" <? if(isset($_POST['mm']) && $_POST['mm']==$val) echo 'selected';?>><? echo $val;?></option>
<?
}
?>
</select>
<select name="yy">
<option value="">YY</option>
<?
for($i=1920;$i<=2040; $i++)
{
?>
<option value="<? echo $i;?>" <? if(isset($_POST['yy']) && $_POST['yy']==$i) echo 'selected';?>><? echo $i;?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Image Profile</td>
<td align="left">
<input type="file" name="image" size="40" />
</td>
</tr>
<tr>
<td> </td>
<td align="left">
<input type="image" name="submit" src="images/btn-submit.gif" style="border:none;padding:0px;" value="submit" />
<img src="images/btn-cancel.gif" onclick="javascript:document.userform.reset();" /> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td class=" brdrT"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="right" valign="top" class="padL"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="padB"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:#FFFFFF url(images/content-s-top.gif) no-repeat top;"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:url(images/content-s-btm.gif) no-repeat bottom;">
<? require_once('top_candidats.php');?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="padB">
<a href="http://www.store.rougejaunevert" target="_blank"><img src="images/shop.jpg" border="0" alt="shop" /></a>
</td>
</tr>
<tr>
<td class="padB">
<? include('vote.php');?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<? require_once('inc/footer.php');?>
</table>
</body>
</html>
<?
switch($action)
{
case 'register':
$user_gender =$_POST['gender'];
$user_name =$_POST['name'];
$user_email =$_POST['user_email'];
$user_forname=$_POST['forname'];
$user_nickname=$_POST['nickname'];
$user_birthday =$_POST['dd'].'-'.$_POST['mm'].'-'.$_POST['yy'];
$username =$_POST['username'];
$user_password=$_POST['user_password'];
$sql ="select * from ".TABLE_USERS." where username='$username' or user_email='$user_email'";
$res =tep_db_query($sql);
$row =tep_db_fetch_assoc($res);
if(tep_db_num_rows($res) > (int)1)
{
$err=base64_encode("e-mail ou l'ID utilisateur existe déjà s'il vous plaît choisir un autre!");
}
else if($row['user_email']==$user_email)
{
$err=base64_encode("Cet e-mail id existe déjà s'il vous plaît choisir un autre!");
}
else if($row['username']==$username)
{
$err=base64_encode("Cet ID utilisateur existe déjà choisir un autre!");
}
else{
$image=uploadImage('image', 'images/users/',96,'',32,"register.php?err=Please upload specified file size!",600);
$sql_data_array=array('user_name' =>$user_name,
'user_email' =>$user_email,
'user_forname' =>$user_forname,
'user_nickname' =>$user_nickname,
'user_gender' =>$user_gender,
'user_birthday' =>$user_birthday,
'username' =>$username,
'user_password' =>md5($user_password),
'user_image' =>$image,
'user_ip' =>USER_IP,
'user_status' =>'active'
);
$res=tep_db_perform(TABLE_USERS, $sql_data_array);
if($res)
{
tep_redirect("register.php?msg=".base64_encode("You are successfuly registered now you can access your account"));
}
}
break;
case 'edit':
$sql="select * from ".TABLE_USERS." where user_id='".$_SESSION['site_username']."'";
break;
case 'login':
$username =$_POST['username'];
$user_password =md5($_POST['user_password']);
$sql ="select * from ".TABLE_USERS." where username='".tep_db_input($username)."' and user_password='".tep_db_input($user_password)."'";
$res =tep_db_query($sql);
$row =tep_db_fetch_assoc($res);
if($username=='' && $_POST['user_password']=='')
{
tep_redirect("login.php?err=".base64_encode("Sorry user id and password canot left blank!"));
}
else if($row['user_status']=='inactive')
{
tep_redirect("login.php?err=".base64_encode("Your account has not activated contact administrator!"));
}
else if(tep_db_num_rows($res)>(int)0)
{
tep_session_register("site_user_name");
tep_session_register("site_username");
$_SESSION['site_user_name']=$row['username'];
$_SESSION['site_username'] =$row['user_id'];
//previous page
if(isset($_SESSION['last_return_url'])) {
list($page)= explode('.php',basename($_SESSION['last_return_url']) );
}else{
$page='';
}
//end
//check weather session is active or not
if(isset($_SESSION['cId']) && $_SESSION['cId']==1){
tep_redirect('checkout.php?step=1');
}else if(isset($_SESSION['last_return_url']) && $page=='video' ){
tep_redirect($_SESSION['last_return_url']);
}else{
tep_redirect('dashboard.php');
}
//end
}
else{
tep_redirect("login.php?err=".base64_encode("Wrong user id or password!"));
}
break;
case 'logout':
if(tep_session_is_registered('site_user_name')){
tep_session_unregister('site_user_name');
tep_session_unregister('site_username');
tep_session_unregister('last_return_url');
tep_redirect("login.php?msg=".base64_encode("You have successfully signed out!"));
}else{
tep_redirect("login.php");
}
break;
}
// date month year
$date =array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26',
'27','28','29','30','31');
$month =array('01','02','03','04','05','06','07','08','09','10','11','12');
// end
$msg=tep_string_convert($msg,'base64'); //calling string convertion function
$err=tep_string_convert($err,'base64'); //calling string convertion function
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>rougejaunevert</title>
<META name="description" content="rougejaunevert">
<META name="keywords" content="news, guinee, guinea, articles, election, 2010, conakry, labe, kankan, video, radio, candidats, candidat, candidates, candidate, vote, lansana, conte, dadis, moussa, camara, colone,l general, t-shirt, love, shop, achat">
<link rel="shortcut icon" href="favicon.ico" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="tutorsty.css" rel="stylesheet" type="text/css" />
<link href="flexcrollstyles.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src="flexcroll.js"></script>
<script language="javascript" src="js/valid.js"></script>
<!--valid user name-->
<script src="js/jquery.js" type="text/javascript" language="javascript"></script>
<script language="javascript">
//<!---------------------------------+
// Developed by Roshan Bhattarai
// Visit http://roshanbh for this script and more.
// This notice MUST stay intact for legal use
// --------------------------------->
$(document).ready(function()
{
$("#username").blur(function()
{
//remove all the class add the messagebox classes and start fading
$("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
//check the username exists or not from ajax
$.post("user_availability.php",{ user_name:$(this).val() } ,function(data)
{
if(data=='no') //if username not avaiable
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Cet ID utilisateur existe déjà choisir un autre').addClass('messageboxerror').fadeTo(900,1); return false;
});
}
else if(data=='blank') //if username not avaiable
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Sil vous plaît entrer votre nom dutilisateur').addClass('messageboxerror').fadeTo(900,1); return false;
});
}
else
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Userid disponible pour enregistrer').addClass('messageboxok').fadeTo(900,1);
});
}
});
});
});
</script>
<style type="text/css">
.top {
margin-bottom: 15px;
}
.messagebox{
position:absolute;
width:100px;
margin-left:30px;
border:1px solid #c93;
background:#ffc;
padding:3px;
}
.messageboxok{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #349534;
background:#C9FFCA;
padding:3px;
font-weight:bold;
color:#008000;
}
.messageboxerror{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #CC0000;
background:#F7CBCA;
padding:3px;
font-weight:bold;
color:#CC0000;
}
</style>
<!--end-->
</head>
<body>
<table width="984" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="hraderbg">
<? require_once('inc/header.php');?>
</td>
</tr>
<tr>
<td><table width="984" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="657" align="left" valign="top"><table width="657" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="padB"><? tep_inner_banner(0);?></td>
</tr>
<tr>
<td class="padB"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:#FFFFFF url(images/content-m-top.gif) no-repeat top;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:url(images/contnet-m-btm.gif) no-repeat bottom;"><table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="brdrB"><h1>Vous Tes Un Nouveau Client ?</h1></td>
</tr>
<tr>
<td class="brdB">(Champs obligatoires <font class="redCommentText">*</font>)</td>
</tr>
<tr>
<td class="padTB">
<?php echo (!empty($msg)) ? '<div class="success">'.$msg.'</div>' : '';?>
<?php echo (!empty($err)) ? '<div class="error">'.$err.'</div>' : '';?>
<form method="post" name="userform" action="register.php?action=register" enctype="multipart/form-data" onsubmit="javascript:return validRegister()">
<table width="100%" cellpadding="4" cellspacing="0" style="padding-left:10px;" bgcolor="#FFFFFF">
<tr>
<td>Civilite <font class="redCommentText">*</font></td>
<td align="left">
<table width="200" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="20"><input type="radio" name="gender" value="Mlle" <? if(isset($gender) && $gender=='Mile') echo 'checked';?> /></td>
<td width="33">Mlle</td>
<td width="20"><input type="radio" name="gender" value="Mme" <? if(isset($gender) && $gender=='Mme') echo 'checked';?> /></td>
<td width="43">Mme</td>
<td width="20"><input type="radio" name="gender" value="M" <? if(isset($gender) && $gender=='M') echo 'checked';?> /></td>
<td width="40">M</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Votre adresse e-mail<font class="redCommentText">*</font></td>
<td align="left">
<input type="text" name="user_email" class="box" size="40" value="<? echo isset($user_email) ? $email : '';?>" />
</td>
</tr>
<tr>
<td>User Id<font class="redCommentText">*</font></td>
<td align="left">
<input type="text" name="username" id="username" class="box" size="30" maxlength="20" />
<span id="msgbox" style="display:none"></span>
</td>
</tr>
<tr>
<td>Votremotdepasse<font class="redCommentText">*</font></td>
<td align="left">
<input type="password" name="user_password" class="box" size="30" maxlength="30" /> </td>
</tr>
<tr>
<td>Confirmez Votremotdepasse<font class="redCommentText">*</font></td>
<td align="left">
<input type="password" name="confirm_pass" class="box" size="30" maxlength="30" /> </td>
</tr>
<tr>
<td width="25%">Nom<font class="redCommentText">*</font></td>
<td width="75%" align="left">
<input type="text" name="name" class="box" size="40" value="<? echo isset($name) ? $name : '';?>" />
</td>
</tr>
<tr>
<td>Prnom<font class="redCommentText">*</font></td>
<td align="left">
<input type="text" name="forname" size="40" value="<? echo isset($forname) ? $forname : '';?>">
</td>
</tr>
<tr>
<td>Pseudo</td>
<td align="left">
<input type="text" name="nickname" size="40" value="<? echo isset($name) ? $name : '';?>" />
</td>
</tr>
<tr>
<td>Date de naissance</td>
<td align="left">
<select name="dd">
<option value="">DD</option>
<?
foreach($date as $val)
{
?>
<option value="<? echo $val;?>" <? if(isset($_POST['dd']) && $_POST['dd']==$val) echo 'selected';?>><? echo $val;?></option>
<?
}
?>
</select>
<select name="mm">
<option value="">MM</option>
<?
foreach($month as $val)
{
?>
<option value="<? echo $val;?>" <? if(isset($_POST['mm']) && $_POST['mm']==$val) echo 'selected';?>><? echo $val;?></option>
<?
}
?>
</select>
<select name="yy">
<option value="">YY</option>
<?
for($i=1920;$i<=2040; $i++)
{
?>
<option value="<? echo $i;?>" <? if(isset($_POST['yy']) && $_POST['yy']==$i) echo 'selected';?>><? echo $i;?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td>Image Profile</td>
<td align="left">
<input type="file" name="image" size="40" />
</td>
</tr>
<tr>
<td> </td>
<td align="left">
<input type="image" name="submit" src="images/btn-submit.gif" style="border:none;padding:0px;" value="submit" />
<img src="images/btn-cancel.gif" onclick="javascript:document.userform.reset();" /> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td class=" brdrT"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="right" valign="top" class="padL"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="padB"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:#FFFFFF url(images/content-s-top.gif) no-repeat top;"><table width="318" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background:url(images/content-s-btm.gif) no-repeat bottom;">
<? require_once('top_candidats.php');?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="padB">
<a href="http://www.store.rougejaunevert" target="_blank"><img src="images/shop.jpg" border="0" alt="shop" /></a>
</td>
</tr>
<tr>
<td class="padB">
<? include('vote.php');?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<? require_once('inc/footer.php');?>
</table>
</body>
</html>
- <?php require_once('admin/inc/config.php');?>
- <?
- switch($action)
- {
- case 'register':
- $user_gender =$_POST['gender'];
- $user_name =$_POST['name'];
- $user_email =$_POST['user_email'];
- $user_forname=$_POST['forname'];
- $user_nickname=$_POST['nickname'];
- $user_birthday =$_POST['dd'].'-'.$_POST['mm'].'-'.$_POST['yy'];
- $username =$_POST['username'];
- $user_password=$_POST['user_password'];
- $sql ="select * from ".TABLE_USERS." where username='$username' or user_email='$user_email'";
- $res =tep_db_query($sql);
- $row =tep_db_fetch_assoc($res);
- if(tep_db_num_rows($res) > (int)1)
- {
- $err=base64_encode("e-mail ou l'ID utilisateur existe déjà s'il vous plaît choisir un autre!");
- }
- else if($row['user_email']==$user_email)
- {
- $err=base64_encode("Cet e-mail id existe déjà s'il vous plaît choisir un autre!");
- }
- else if($row['username']==$username)
- {
- $err=base64_encode("Cet ID utilisateur existe déjà choisir un autre!");
- }
- else{
- $image=uploadImage('image', 'images/users/',96,'',32,"register.php?err=Please upload specified file size!",600);
- $sql_data_array=array('user_name' =>$user_name,
- 'user_email' =>$user_email,
- 'user_forname' =>$user_forname,
- 'user_nickname' =>$user_nickname,
- 'user_gender' =>$user_gender,
- 'user_birthday' =>$user_birthday,
- 'username' =>$username,
- 'user_password' =>md5($user_password),
- 'user_image' =>$image,
- 'user_ip' =>USER_IP,
- 'user_status' =>'active'
- );
- $res=tep_db_perform(TABLE_USERS, $sql_data_array);
- if($res)
- {
- tep_redirect("register.php?msg=".base64_encode("You are successfuly registered now you can access your account"));
- }
- }
- break;
- case 'edit':
- $sql="select * from ".TABLE_USERS." where user_id='".$_SESSION['site_username']."'";
- break;
- case 'login':
- $username =$_POST['username'];
- $user_password =md5($_POST['user_password']);
- $sql ="select * from ".TABLE_USERS." where username='".tep_db_input($username)."' and user_password='".tep_db_input($user_password)."'";
- $res =tep_db_query($sql);
- $row =tep_db_fetch_assoc($res);
- if($username=='' && $_POST['user_password']=='')
- {
- tep_redirect("login.php?err=".base64_encode("Sorry user id and password canot left blank!"));
- }
- else if($row['user_status']=='inactive')
- {
- tep_redirect("login.php?err=".base64_encode("Your account has not activated contact administrator!"));
- }
- else if(tep_db_num_rows($res)>(int)0)
- {
- tep_session_register("site_user_name");
- tep_session_register("site_username");
- $_SESSION['site_user_name']=$row['username'];
- $_SESSION['site_username'] =$row['user_id'];
- //previous page
- if(isset($_SESSION['last_return_url'])) {
- list($page)= explode('.php',basename($_SESSION['last_return_url']) );
- }else{
- $page='';
- }
- //end
- //check weather session is active or not
- if(isset($_SESSION['cId']) && $_SESSION['cId']==1){
- tep_redirect('checkout.php?step=1');
- }else if(isset($_SESSION['last_return_url']) && $page=='video' ){
- tep_redirect($_SESSION['last_return_url']);
- }else{
- tep_redirect('dashboard.php');
- }
- //end
- }
- else{
- tep_redirect("login.php?err=".base64_encode("Wrong user id or password!"));
- }
- break;
- case 'logout':
- if(tep_session_is_registered('site_user_name')){
- tep_session_unregister('site_user_name');
- tep_session_unregister('site_username');
- tep_session_unregister('last_return_url');
- tep_redirect("login.php?msg=".base64_encode("You have successfully signed out!"));
- }else{
- tep_redirect("login.php");
- }
- break;
- }
- // date month year
- $date =array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26',
- '27','28','29','30','31');
- $month =array('01','02','03','04','05','06','07','08','09','10','11','12');
- // end
- $msg=tep_string_convert($msg,'base64'); //calling string convertion function
- $err=tep_string_convert($err,'base64'); //calling string convertion function
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>rougejaunevert</title>
- <META name="description" content="rougejaunevert">
- <META name="keywords" content="news, guinee, guinea, articles, election, 2010, conakry, labe, kankan, video, radio, candidats, candidat, candidates, candidate, vote, lansana, conte, dadis, moussa, camara, colone,l general, t-shirt, love, shop, achat">
- <link rel="shortcut icon" href="favicon.ico" />
- <link href="style.css" rel="stylesheet" type="text/css" />
- <link href="tutorsty.css" rel="stylesheet" type="text/css" />
- <link href="flexcrollstyles.css" rel="stylesheet" type="text/css" />
- <script type='text/javascript' src="flexcroll.js"></script>
- <script language="javascript" src="js/valid.js"></script>
- <!--valid user name-->
- <script src="js/jquery.js" type="text/javascript" language="javascript"></script>
- <script language="javascript">
- //<!---------------------------------+
- // Developed by Roshan Bhattarai
- // Visit http://roshanbh for this script and more.
- // This notice MUST stay intact for legal use
- // --------------------------------->
- $(document).ready(function()
- {
- $("#username").blur(function()
- {
- //remove all the class add the messagebox classes and start fading
- $("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
- //check the username exists or not from ajax
- $.post("user_availability.php",{ user_name:$(this).val() } ,function(data)
- {
- if(data=='no') //if username not avaiable
- {
- $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
- {
- //add message and change the class of the box and start fading
- $(this).html('Cet ID utilisateur existe déjà choisir un autre').addClass('messageboxerror').fadeTo(900,1); return false;
- });
- }
- else if(data=='blank') //if username not avaiable
- {
- $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
- {
- //add message and change the class of the box and start fading
- $(this).html('Sil vous plaît entrer votre nom dutilisateur').addClass('messageboxerror').fadeTo(900,1); return false;
- });
- }
- else
- {
- $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
- {
- //add message and change the class of the box and start fading
- $(this).html('Userid disponible pour enregistrer').addClass('messageboxok').fadeTo(900,1);
- });
- }
- });
- });
- });
- </script>
- <style type="text/css">
- .top {
- margin-bottom: 15px;
- }
- .messagebox{
- position:absolute;
- width:100px;
- margin-left:30px;
- border:1px solid #c93;
- background:#ffc;
- padding:3px;
- }
- .messageboxok{
- position:absolute;
- width:auto;
- margin-left:30px;
- border:1px solid #349534;
- background:#C9FFCA;
- padding:3px;
- font-weight:bold;
- color:#008000;
- }
- .messageboxerror{
- position:absolute;
- width:auto;
- margin-left:30px;
- border:1px solid #CC0000;
- background:#F7CBCA;
- padding:3px;
- font-weight:bold;
- color:#CC0000;
- }
- </style>
- <!--end-->
- </head>
- <body>
- <table width="984" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td class="hraderbg">
- <? require_once('inc/header.php');?>
- </td>
- </tr>
- <tr>
- <td><table width="984" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="657" align="left" valign="top"><table width="657" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="padB"><? tep_inner_banner(0);?></td>
- </tr>
- <tr>
- <td class="padB"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td style="background:#FFFFFF url(images/content-m-top.gif) no-repeat top;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td style="background:url(images/contnet-m-btm.gif) no-repeat bottom;"><table width="100%" border="0" cellspacing="10" cellpadding="0">
- <tr>
- <td align="left" valign="top">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="brdrB"><h1>Vous Tes Un Nouveau Client ?</h1></td>
- </tr>
- <tr>
- <td class="brdB">(Champs obligatoires <font class="redCommentText">*</font>)</td>
- </tr>
- <tr>
- <td class="padTB">
- <?php echo (!empty($msg)) ? '<div class="success">'.$msg.'</div>' : '';?>
- <?php echo (!empty($err)) ? '<div class="error">'.$err.'</div>' : '';?>
- <form method="post" name="userform" action="register.php?action=register" enctype="multipart/form-data" onsubmit="javascript:return validRegister()">
- <table width="100%" cellpadding="4" cellspacing="0" style="padding-left:10px;" bgcolor="#FFFFFF">
- <tr>
- <td>Civilite <font class="redCommentText">*</font></td>
- <td align="left">
- <table width="200" border="0" cellpadding="2" cellspacing="0">
- <tr>
- <td width="20"><input type="radio" name="gender" value="Mlle" <? if(isset($gender) && $gender=='Mile') echo 'checked';?> /></td>
- <td width="33">Mlle</td>
- <td width="20"><input type="radio" name="gender" value="Mme" <? if(isset($gender) && $gender=='Mme') echo 'checked';?> /></td>
- <td width="43">Mme</td>
- <td width="20"><input type="radio" name="gender" value="M" <? if(isset($gender) && $gender=='M') echo 'checked';?> /></td>
- <td width="40">M</td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>Votre adresse e-mail<font class="redCommentText">*</font></td>
- <td align="left">
- <input type="text" name="user_email" class="box" size="40" value="<? echo isset($user_email) ? $email : '';?>" />
- </td>
- </tr>
- <tr>
- <td>User Id<font class="redCommentText">*</font></td>
- <td align="left">
- <input type="text" name="username" id="username" class="box" size="30" maxlength="20" />
- <span id="msgbox" style="display:none"></span>
- </td>
- </tr>
- <tr>
- <td>Votremotdepasse<font class="redCommentText">*</font></td>
- <td align="left">
- <input type="password" name="user_password" class="box" size="30" maxlength="30" /> </td>
- </tr>
- <tr>
- <td>Confirmez Votremotdepasse<font class="redCommentText">*</font></td>
- <td align="left">
- <input type="password" name="confirm_pass" class="box" size="30" maxlength="30" /> </td>
- </tr>
- <tr>
- <td width="25%">Nom<font class="redCommentText">*</font></td>
- <td width="75%" align="left">
- <input type="text" name="name" class="box" size="40" value="<? echo isset($name) ? $name : '';?>" />
- </td>
- </tr>
- <tr>
- <td>Prnom<font class="redCommentText">*</font></td>
- <td align="left">
- <input type="text" name="forname" size="40" value="<? echo isset($forname) ? $forname : '';?>">
- </td>
- </tr>
- <tr>
- <td>Pseudo</td>
- <td align="left">
- <input type="text" name="nickname" size="40" value="<? echo isset($name) ? $name : '';?>" />
- </td>
- </tr>
- <tr>
- <td>Date de naissance</td>
- <td align="left">
- <select name="dd">
- <option value="">DD</option>
- <?
- foreach($date as $val)
- {
- ?>
- <option value="<? echo $val;?>" <? if(isset($_POST['dd']) && $_POST['dd']==$val) echo 'selected';?>><? echo $val;?></option>
- <?
- }
- ?>
- </select>
- <select name="mm">
- <option value="">MM</option>
- <?
- foreach($month as $val)
- {
- ?>
- <option value="<? echo $val;?>" <? if(isset($_POST['mm']) && $_POST['mm']==$val) echo 'selected';?>><? echo $val;?></option>
- <?
- }
- ?>
- </select>
- <select name="yy">
- <option value="">YY</option>
- <?
- for($i=1920;$i<=2040; $i++)
- {
- ?>
- <option value="<? echo $i;?>" <? if(isset($_POST['yy']) && $_POST['yy']==$i) echo 'selected';?>><? echo $i;?></option>
- <?
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td>Image Profile</td>
- <td align="left">
- <input type="file" name="image" size="40" />
- </td>
- </tr>
- <tr>
- <td> </td>
- <td align="left">
- <input type="image" name="submit" src="images/btn-submit.gif" style="border:none;padding:0px;" value="submit" />
- <img src="images/btn-cancel.gif" onclick="javascript:document.userform.reset();" /> </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- <tr>
- <td class=" brdrT"></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- <td align="right" valign="top" class="padL"><table width="318" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="padB"><table width="318" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td style="background:#FFFFFF url(images/content-s-top.gif) no-repeat top;"><table width="318" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td style="background:url(images/content-s-btm.gif) no-repeat bottom;">
- <? require_once('top_candidats.php');?>
- </td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td class="padB">
- <a href="http://www.store.rougejaunevert" target="_blank"><img src="images/shop.jpg" border="0" alt="shop" /></a>
- </td>
- </tr>
- <tr>
- <td class="padB">
- <? include('vote.php');?>
- </td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
- <? require_once('inc/footer.php');?>
- </table>
- </body>
- </html>
what is my problem
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 5 posts
- Users browsing this forum: No registered users and 171 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
