yusiyuseff Posted September 30, 2008 Share Posted September 30, 2008 please help me i have a script for a banner exchange website but when some one try to register they get this The system was unable to validate your email address because it contains special characters. Please contact the administrator for assistance. (You entered yusiyuseff@yahoo.com) can you help me with the code thank you Quote Link to comment Share on other sites More sharing options...
trq Posted September 30, 2008 Share Posted September 30, 2008 You'll need to post the relevent code before we can help you with it. Quote Link to comment Share on other sites More sharing options...
yusiyuseff Posted September 30, 2008 Author Share Posted September 30, 2008 i dont know what code it is because i dont know any thing bout php but i put the sigup.php and signupform.php xchangebanner.info <? $file_rev="041305"; include("config.php"); include("css.php"); if($use_gzhandler==1){ ob_start("ob_gzhandler"); } session_start(); session_register(ref); require_once('lib/template_class.php'); include("config.php"); include("lang/common.php"); $session=session_id(); $db=mysql_connect("$dbhost","$dbuser","$dbpass"); mysql_select_db($dbname,$db); $get_cats=mysql_query("select * from bannercats"); while($get_rows=mysql_fetch_array($get_cats)){ $get_row_id=$get_rows[id]; $get_row_category=eregi_replace("_"," ",$get_rows[catname]); $catselect.= "<option value=\"".$get_row_id."\">".$get_row_category."</option>"; } if($allow_upload =="N"){ $banner_url.= "<tr><td width=\"22%\"> $LANG_bannerurl:</td><td width=\"78%\"><input class=\"formbox\" type=\"text\" name=\"bannerurl\" size=\"40\" value=\"http://\"> </td></tr>"; $banner_url.= "<tr><td width=\"22%\"> $LANG_siteurl:</td><td width=\"78%\"><input class=\"formbox\" type=\"text\" name=\"targeturl\" size=\"40\" value=\"http://\"> </td></tr>"; }else{ $banner_url=""; } $page = new Page('template/signupform.php'); $page->replace_tags(array( 'css' => "$css", 'session' => "$session", 'baseurl' => "$baseurl", 'title' => "$exchangename - $LANG_signupwords", 'shorttitle' => "$LANG_signupwords", 'name' => "$LANG_realname", 'login' => "$LANG_login", 'pass' => "$LANG_pw", 'pass2' => "$LANG_pw_again", 'category' => "$LANG_cat", 'catdefault' => "$LANG_catstuff", 'catarray' => "$catselect", 'email' => "$LANG_email", 'bannerurl' => "$banner_url", 'newsletter' => "$LANG_newsletter", 'yes' => "$LANG_yes", 'no' => "$LANG_no", 'coupon' => "$LANG_coupon", 'submit' => "$LANG_signsub", 'reset' => "$LANG_signres", 'menu' => 'common_menuing.php', 'footer' => 'footer.php')); $page->output(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>{title}</title> <link rel="stylesheet" href="{baseurl}/template/css/{css}" type="text/css"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" > <div id="content"> <div class="main"> <table border="0" cellpadding="1" width="650" cellspacing="0"> <tr> <td> <table cellpadding="5" border="1" width="100%" cellspacing="0"> <tr> <td colspan="2" class="tablehead"><center><div class="head">{title}</center></div></td> </tr> <td class="tablebody" colspan="2"> <div class="mainbody"> <table border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse" width="90%"> <tr> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="90%" > <tr> <form method="POST" action="signupconfirm.php"> <table border="0" cellpadding="0" align="center" cellspacing="0" style="border-collapse: collapse" width="90%"> <tr> <td width="22%"> {name}: </td> <td width="78%"> <input class="formbox" type="text" name="name" size="40"></div> </td> </tr> <tr> <td width="22%"> {login}</td> <td width="78%"> <input class="formbox" type="text" name="login" size="40" maxlength="20"> </td> </tr> <tr> <td width="22%"> {pass}</td> <td width="78%"> <input class="formbox" type="password" name="pass" size="40" maxlength="20"> </td> </tr> <tr> <td width="22%"> {pass2}:</td> <td width="78%"> <input class="formbox" type="password" name="pass2" size="40" maxlength="20"> </td> </tr> <tr> <td width="22%"> {category}: </td> <td width="78%"> <select class="formbox" name="category"> <option selected> {catdefault} </option> {catarray} </select> </td> </tr> <tr> <td width="22%"> {email}:</td> <td width="78%"> <input class="formbox"type="text" name="email" size="40"> </td> </tr> {bannerurl} <tr> <td width="22%">{newsletter}: </td> <td width="78%"> <input class="formbox"type="radio" checked name="newsletter" value="1">{yes} <input type="radio" value="0" name="newsletter">{no}</td></tr> <tr><td width="22%">{coupon}:</td> <td width="78%"><input class="formbox"type="text" name="coupon" size="40"> </td> </tr> </table> <p><input class="button" type="submit" value=" {submit} " name="submit"> <input class="button" type="reset" value="{reset}"> </form> </div> </td> </tr> </table> </td> </tr> </table><p> </div> </div> <div class="footer"> {footer} </div> </div> {menu} Quote Link to comment Share on other sites More sharing options...
waynew Posted September 30, 2008 Share Posted September 30, 2008 Email checking doesn't seem to be in the files that you posted. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 30, 2008 Share Posted September 30, 2008 signupconfirm.php should be the file that contains the code doing the form processing. Quote Link to comment Share on other sites More sharing options...
yusiyuseff Posted September 30, 2008 Author Share Posted September 30, 2008 <? here is the code for signupconfirm.php $file_rev="041306"; include("config.php"); include("css.php"); include("lang/errors.php"); include("lang/common.php"); if($use_gzhandler==1){ ob_start("ob_gzhandler"); } $db=mysql_connect("$dbhost","$dbuser","$dbpass"); mysql_select_db($dbname,$db); session_start(); session_register(ref); require_once('lib/template_class.php'); include("config.php"); include("lang/common.php"); $session=session_id(); $name=$_REQUEST['name']; $email=$_REQUEST['email']; $login=$_REQUEST['login']; $pass=$_REQUEST['pass']; $pass2=$_REQUEST['pass2']; $newsletter=$_REQUEST['newsletter']; $targeturl=$_REQUEST['targeturl']; $category=$_REQUEST['category']; $bannerurl=$_REQUEST['bannerurl']; $coupon=$_REQUEST['coupon']; $ref=$_SESSION['ref']; if (get_magic_quotes_gpc()) { $name = stripslashes($name); $email = stripslashes($email); $login=stripslashes($login); $pass=stripslashes($pass); $pass2=stripslashes($pass2); $newsletter=stripslashes($newsletter); $targeturl=stripslashes($targeturl); $category=stripslashes($category); $bannerurl=stripslashes($bannerurl); $coupon=stripslashes($coupon); $ref=stripslashes($ref); } $name=mysql_real_escape_string($name); $email=mysql_real_escape_string($email); $login=mysql_real_escape_string($login); $pass=mysql_real_escape_string($pass); $pass2=mysql_real_escape_string($pass2); $newsletter=mysql_real_escape_string($newsletter); $targeturl=mysql_real_escape_string($targeturl); $category=mysql_real_escape_string($category); $bannerurl=mysql_real_escape_string($bannerurl); $coupon=mysql_real_escape_string($coupon); $ref=mysql_real_escape_string($ref); $err=0; if($_REQUEST['submit']){ // check to see if the coupon is valid. if($_REQUEST[coupon]){ $promo=mysql_query("select * from bannerpromos where promocode='$coupon' limit 1"); $num=@mysql_num_rows($promo); $coup_array=@mysql_fetch_array($promo); // check to make sure the coupon is for 'mass credits' // because that's the only coupon type that will work with // a new sign up! $promotype=$coup_array[promotype]; if(!$num or $promotype != '1'){ $err = 1; $error_html .= "$LANG_err_nocoupon<br><br>\n"; } } // Validate the Name if(strlen(trim($name)) < 2){ $err = 1; $error_html .= "$LANG_err_nametooshort.<br><br>\n"; } if(strlen(trim($name)) > 100){ $err = 1; $error_html .= "$LANG_err_nametoolong.<br><br>\n"; } // Validate the Login if(strlen(trim($login)) > 20){ $err = 1; $error_html .= "$LANG_err_loginshort.<br><br>\n"; } if(strlen(trim($login)) < 2){ $err = 1; $error_html .= "$LANG_err_loginlong.<br><br>\n"; } $check_login=mysql_query("select * from banneruser where login = '$login'"); $get_login=@mysql_fetch_array($check_login); $exists=$get_login[login]; $existsmail=$get_login; if($exists == $login){ $err = 1; $error_html .= "$LANG_err_logininuse!<br><br>\n"; } if($emailexists == $email){ $err = 1; $error_html .= "$LANG_err_emailinuse!<br><br>\n"; } if($allow_upload=='N'){ if($imagestuff = @GetImageSize($bannerurl)){ $imagewidth = $imagestuff[0]; $imageheight = $imagestuff[1]; // Validate the Banner Width and Height if($imagewidth != $bannerwidth){ $err=1; $error_html .= "$LANG_err_badwidth<br><br>\n"; } if($imageheight != $bannerheight){ $err=1; $error_html .= "$LANG_err_badheight<br><br>\n"; } }else{ $err = 1; $error_html .= "$LANG_err_badimage<br><br>\n"; } } // Validate the Email Address if (!preg_match('/^[A-z0-9_\-]+\@(A-z0-9_-]+\.)+[A-z]{2,4}$/', $email)){ $err = 1; $error_html .= "$LANG_err_email.<br><br>\n"; } // Validate the Password if($pass != $pass2){ $err = 1; $error_html .= "$LANG_err_passmismatch\n"; } if(strlen(trim($pass)) < 4){ $err = 1; $error_html .= "$LANG_err_passshort.<br><br>\n"; } if($err=="1"){ $error="<br><b>$LANG_rejected</b></font><blockquote>".$error_html."</blockquote>\n [<a href=\"javascript:history.go(-1)\">$LANG_back</a>]"; $page = new Page('template/admin_error.php'); $page->replace_tags(array( 'css' => "$css", 'session' => "$session", 'baseurl' => "$baseurl", 'title' => "$exchangename - $LANG_signupwords", 'shorttitle' => "$LANG_signconf_title", 'error' => "$error", 'menu' => 'common_menuing.php', 'footer' => 'footer.php')); $page->output(); } else { if($usemd5 == 'Y'){ $encpass = md5($pass); $insert=mysql_query("insert into banneruser values ('','$login','$encpass','$name','$email','$newsletter')",$db); }else{ $insert=mysql_query("insert into banneruser values ('','$login','$pass','$name','$email','$newsletter')",$db); } $timestamp=time(); $get_id=mysql_query("select * from banneruser where login='$login'"); $get_rows=mysql_fetch_array($get_id); $insert_stats=mysql_query("insert into bannerstats values ('$get_rows[id]','$category','0','$startcredits','0','0','0','0','0','','$timestamp')",$db); if($allow_upload=='N'){ $insert_banner=mysql_query("insert into bannerurls values ('','$bannerurl','$targeturl','0','0','$get_rows[id]','0')"); } if($ref =! '0' or ''){ $insert_banner=mysql_query("insert into bannerrefs values ('','$ref','$get_rows[id]','0')"); } if($_REQUEST[coupon]){ $newcredits=$coup_array[promocredits]; $promoid=$coup_array[promoid]; $query=mysql_query("update bannerstats set credits=credits+'$newcredits' where uid='$get_rows[id]'"); $logupdate=mysql_query("insert into bannerpromologs values('','$get_rows[id]','$promoid','$timestamp')"); $coupon_msg=$LANG_coupon_added; } if($allow_upload=="Y"){ $uploading=$LANG_signup_uploadmsg; }else{ $uploading=""; } $page = new Page('template/signconf.php'); $page->replace_tags(array( 'session' => "$session", 'css' => "$css", 'baseurl' => "$baseurl", 'title' => "$exchangename - $LANG_signconf_title", 'shorttitle' => "$LANG_signconf_title", 'thanks' => "$LANG_signup_thanks", 'info' => "$LANG_signupinfo", 'uploading' => "$uploading", 'coup_msg' => "$coupon_msg", 'menu' => 'common_menuing.php', 'footer' => 'footer.php')); $page->output(); session_destroy(); if($sendemail == "Y"){ include("template/mail/mail_newadmin.php"); mail($ownermail,$subject,$content,"From: $email"); }else{ } include("template/mail/mail_newuser.php"); mail($email,$usrsubject,$usrcontent,"From: $ownermail"); } } Quote Link to comment Share on other sites More sharing options...
yusiyuseff Posted September 30, 2008 Author Share Posted September 30, 2008 do yopu see any rproblen in the code? Quote Link to comment Share on other sites More sharing options...
yusiyuseff Posted October 1, 2008 Author Share Posted October 1, 2008 problem solve by me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.