<?PHP

#####################################################################
##                                                                 ##
##                       Easy Banner Free                          ##
##                 http://www.phpwebscripts.com/                   ##
##                 e-mail: info@phpwebscripts.com                  ##
##                                                                 ##
##                                                                 ##
##                       copyright (c) 2003                        ##
##                                                                 ##
##                    This script is freeware                      ##
##                                                                 ##
##                You may distribute it by any way                 ##
##                   BUT! You may not modify it!                   ##
## Removing the link to PHPWebScripts.com is a copyright violation.##
##   Altering or removing any of the code that is responsible, in  ##
##   any way, for generating that link is strictly forbidden.      ##
##   Anyone violating the above policy will have their license     ##
##   terminated on the spot.  Do not remove that link - ever.      ##
##                                                                 ##
#####################################################################

include("./data/data.php"); include("./common.php"); if ($HTTP_POST_VARS) signup($HTTP_POST_VARS); else parsedata('./data/templates/join.html',$s);
function signup($form) { global $s; if ( (!$form[urlbanner]) OR (!$form[userid]) OR (!$form[userpass]) OR (!$form[email]) OR (!$form[siteurl]) ) problem ("Please come back and fill out all fields.");
if (!eregi("^[a-z0-9]{1,8}$",$form[userid])) problem ("Неверное или слишком длинное имя пользователя. Можно использовать латинские буквы и цифры. Максимальная длинна - 8 символов.") ; if (!eregi("^[a-z0-9]{1,8}$",$form[userpass])) problem ("Wrong or too long password. Max of 8 characters.") ; if (strlen($form[email]) > 70) problem ("Е-мэйл слишком длинный. Максимум 50 знаков.") ; if (strlen($form[siteurl]) > 100) problem ("URL Слишком длинный. Максимум 100 знаков.") ;
if (strlen($form[urlbanner]) > 100) problem ("URL баннера слишком длинный. Максимум - 100 символов.") ; if (!eregi("^[a-z0-9_.\-]+@[a-z0-9_\-]+\.[a-z0-9.]+$",$form[email])) problem ("Wrong email address. Please try again."); if (!eregi("http://*",$form[siteurl])) problem ("Wrong URL. Please try again.");
$q = mysql_query("select count(*) from ebfmembers where userid = '$form[userid]'"); $data = @mysql_fetch_row($q); if ($data[0]) problem ("This username is already in use. Please use another.") ; $q = mysql_query("select max(number) from ebfmembers"); $data = mysql_fetch_row($q); $number = $data[0]+1;
eregi(".*gif$",$form[urlbanner],$hh); eregi(".*jpg$",$form[urlbanner],$hh); eregi(".*png$",$form[urlbanner],$hh); if (!$hh[0]) problem ("Wrong banner image format. Please try again.");
$cas = time(); $datum = Date("Y-m-d"); $q = mysql_query("insert into ebfmembers values('$form[userid]','$form[userpass]','$form[email]','$form[siteurl]','$form[urlbanner]','0','0','0','$datum','$cas','0','0','$number')"); if(!$q) problem(sql_error());
$form[memberfile] = "$s[phpdirectory]/member.php"; sendemail('./data/templates/email_join.txt',$form); $form[adminfile] = "$s[phpdirectory]/admin/admin.php"; $form[memberemail] = $form[email]; $form[email] = $s[adminemail]; sendemail('./data/templates/email_admin.txt',$form);
$q = mysql_query("select email,siteurl,urlbanner,userid,userpass from ebfmembers where userid = '$form[userid]' AND userpass = '$form[userpass]'"); if(!$q) problem(sql_error()); $form = mysql_fetch_array($q);
$form[workfile]="$s[phpdirectory]/work.php?ID=$form[userid]"; $form[memberfile]="$s[phpdirectory]/member.php"; $form[width]=$s[bwidth]; $form[height]=$s[bheight]; $form[html] = parsehtml('./data/templates/html.txt',$form);
$form[banner]="<img border=0 width=\"$s[bwidth]\" height=\"$s[bheight]\" src=\"$form[urlbanner]\">"; parsedata('./data/templates/join_success.html',$form); }

?>