I have tried everything to my knowledge to get this code to work proper, but had no success at all with it.
The problem with the code is the capache is not working in in, the code is from a chat called BuzzerChat, i bought this a while back, and registration never worked proper, and support does not reply when i try emailing them, but anyways here is the code i am trying to fix to get working.
[php]<?php
include_once(‘start.php’);
require(“securimage/securimage.php”);
//max_nickname
$result=mysql_query(“SELECT * FROM rt_setting where setting_name=‘max_nickname’”) or die(mysql_error());
$row=mysql_fetch_array($result);
$max_nickname=$row[‘setting_value’];
$mysql=mysql_query(“SELECT * FROM rt_setting WHERE setting_name=‘gd_show’”) or die(mysql_error());
$row=mysql_fetch_array($mysql);
$gd_show=$row[‘setting_value’];
if($_POST[‘register’])
{
include_once('start.php');
$result=mysql_query("SELECT * FROM rt_setting where setting_name='reg_approve'");
$row=mysql_fetch_array($result);
$reg_approve=$row['setting_value'];
$result=mysql_query("SELECT * FROM rt_setting where setting_name='reg_email'");
$row=mysql_fetch_array($result);
$reg_email=stripcslashes($row['setting_value']);
global $frmdata;
$frmdata=$_POST;
$error=user_validation();
$img = new Securimage();
$valid = $img->check($_POST['ycaptcha']);
if($valid == false && $gd_show=='yes')
{
$error['captcha']=$lang['signup_gd_error'];
}
if(empty($error))
{
$email=$DB->SelectRecord('users','email="'.$frmdata['email'].'"');
if(!empty($email))
{
$error['username']=$lang['signup_email_error'];
}
$result=mysql_query("SELECT * FROM rt_users where `suffix`='".strtolower($frmdata['nickname'])."'") or die(mysql_error());
if (mysql_num_rows($result)>0)
{
$error['username']=$lang['signup_username_error'];
}
if(empty($error))
{
$frmdata['suffix']=strtolower($frmdata['nickname']);
$frmdata['password']=crypt($frmdata['password']);
$frmdata['username']=$frmdata['email'];
$frmdata['userstatus']='deactive';
$frmdata['dob']=$frmdata['year']-$frmdata['month'].'-'.$frmdata['day'];
$frmdata['activation_id']=uniqid (rand (),false);
if ($reg_approve=='on')
{
$frmdata['userstatus']='deactive';
}
if ($reg_approve=='on')
{
$frmdata['userstatus']='active';
}
$DB->InsertRecord('users',$frmdata);
// send activation mail now
$mail = new phpmailer;
//$sender=ADMIN_EMAIL;
//$content.=;
$content=$reg_email;
if ($reg_approve=='on')
{
$app_link="<a href='".$_url."activate.php?key=".$frmdata['activation_id']."'>".$lang['signup_active']."</a>";
$content=str_replace("{approve_link}",$app_link,$content);
}
else
{
$content=str_replace("{approve_link}",'',$content);
}
$mail->AddAddress($frmdata['email'],$frmdata['nickname']);
$res=mysql_query("SELECT * FROM rt_setting where setting_name='reg_sub'");
$ro=mysql_fetch_array($res);
$mail->Subject = $ro['setting_value'];
$mail->Body = $content;
$res=mysql_query("SELECT * FROM rt_setting where setting_name='reg_from'");
$ro=mysql_fetch_array($res);
$mail->From=$ro['setting_value'];
$mail->IsHTML(true);
if(!$mail->Send())
{
echo $mail->ErrorInfo;
$error['error'] = $lang['signup_twaedtm'];
}
else
{
header("location:verification.php?email=".$_POST['email']);
}
}
}
}
include_once(‘header.php’);
?>
<td style="vertical-align: top;">
<div class="box-title-reg">
<div style="float: left;"><?php echo $lang['signup_siginup'];?></div>
<div style="float: right;"><a href="/support/help.php" target="_blank" class="no-textdecoration-white"><?php echo $lang['signup_help'];?></a></div>
</div>
<div class="box-reg">
<?php echo $lang['signup_fwamwaarfyrcbcwtfbc'];?><br><br>
<br>
<?php
if(!empty($error))
{
$key=array_keys($error);
echo ''.$error[$key[0]]." ";
}
?>
<div class="bline-title"><?php echo $lang['signup_per_info'];?> </div><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="td-20px"><?php echo $lang['signup_nickname'];?> </td>
<td><input name="nickname" type="text" class="textfield" value="<?php echo $frmdata['nickname']; ?>" maxlength="<?php echo $max_nickname;?>"> *</td>
</tr>
<tr>
<td class="td-20px"><?php echo $lang['signup_emaildd'];?> </td>
<td><input name="email" type="text" class="textfield" value="<?php echo $frmdata['email']; ?>"> *</td>
</tr>
</table>
<span class="lightblue"><?php echo $lang['signup_email_note'];?></span><br><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="td-20px"><?php echo $lang['signup_language'];?> </td>
<td>
<select name="language" class="pulldown">
<option value="en" selected="selected"><?php echo $lang['signup_english'];?></option>
</select> *
</td>
</tr>
<tr style="display:none;">
<td class="td-20px"><?php echo $lang['signup_birthday'];?></td>
<td>
<select name="day" class="pulldown" id="dd">
<!--<option value=""><?php echo $lang['signup_day'];?></option>-->
<?php
for($i=1;$i<32;$i++)
{
if($i==$frmdata['day'])
{
$selected="selected='selected'";
}
else
$selected="";
?>
<option value="<?php echo $i; ?>" <?php echo $selected; ?>><?php echo $i; ?></option>
<?php
}
?>
</select>
<select name="month" class="pulldown" id="mm">
<?php
$months=array("January","February","March","April","May","June","July","August","September","October","November","December");?>
<!--<option value=""><?php echo $lang['signup_month'];?></option>-->
<?php
foreach($months as $key=>$month)
{
if($month==$frmdata['month'])
{
$s="selected='selected'";
}
else
$s='';
?>
<option value="<?php echo $month; ?>" <?php echo $s; ?>><?php echo $month; ?></option>
<?php
}
?>
</select>
<input name="year" class="textfield-small" id="yyyy" size="7" maxlength="4" value="2011"> *
</td>
</tr>
<td class="td-20px"><?php echo $lang['signup_sex'];?></td>
<td>
<select name="sex" id="sex">
<option value="male"><?php echo $lang['signup_male'];?></option>
<option value="female"><?php echo $lang['signup_female'];?></option>
<option value="couple"><?php echo $lang['signup_couple'];?></option>
</select>
</td>
<tr>
</tr>
</table><br><br>
<div class="bline-title"><?php echo $lang['signup_passsetting'];?></div><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="td-20px"><?php echo $lang['signup_password'];?></td>
<td><input name="password" type="password" class="textfield"> *</td>
</tr>
<tr>
<td class="td-20px"><?php echo $lang['signup_repassword'];?></td>
<td><input name="cpassword" type="password" class="textfield"> *</td>
</tr>
<tr>
<td class="td-20px"><?php echo $lang['signup_secretquestion'];?></td>
<td><input name="ques" type="text" class="textfield" value="<?php echo $frmdata['ques']; ?>"> *</td>
</tr>
<tr>
<td class="td-20px"><?php echo $lang['signup_secretanswer'];?></td>
<td><input name="ans" type="text" class="textfield" value="<?php echo $frmdata['ans']; ?>"> *</td>
</tr>
<?php if ($gd_show=='yes') {echo ''.$lang['signup_veri_image'].' |
';}?> |
<label <?php if ($gd_show=='no') {echo 'style="display:none;"';}?>><?php echo $lang['signup_secret_word'];?>
|
<input <?php if ($gd_show=='no') {echo 'style="display:none;"';}?> type=“text” size=“30” value="" id=“ycaptcha” name=“ycaptcha” class=“textfield” /><span <?php if ($gd_show=='no') {echo 'style="display:none;"';}?>>* |
</table>
<br><?php echo $lang['signup_accept'];?><br><br>
<a href="conduct.php" target="_blank"><?php echo $lang['signup_codeproduct'];?></a><br>
<a href="privacy.php" target="_blank"><?php echo $lang['signup_privacy'];?></a><br><br>
<input type="checkbox" name="privacy" value="checked" >
<?php echo $lang['signup_accept_term'];?><br><br>
<input class="bluebuttonHpNw" name="register" type="submit" style="cursor:pointer;" value="<?php echo $lang['signup_ca_but'];?>">
<input class="bluebuttonHpNw" name="Reset" type="reset" value="<?php echo $lang['signup_ca_can'];?>" style="cursor:pointer;">
</div>
</td>
<td style="vertical-align: top; padding-left: 10px;">
<div class="bline-title"><?php echo $lang['signup_Registeration'];?></div>
<div class="textbox">
<?php echo $lang['signup_right_long_text'];?> <br>
</div>
<br>
<br>
<div class="box-title">
<strong><?php echo $lang['signup_help_password_settiing'];?></strong>
</div>
<div class="box">
<?php echo $lang['signup_string'];?>
</div><br>
<div class="bline-title">
<strong>Last step:</strong>
</div>
<div class="textbox">
<?php echo $lang['signup_clickon'];?>
</div>
</td>
</tr>
</table>
</form>
<?php include_once('footer.php'); ?>
|
[/php]
|