Registration form

0) { $sock=msqlConnect(); if ($sock<0) { echo("

\n"); echo("
\n $ERRMSG \n
\n

\n"); exit(0); } if (msqlSelectDB($sock, "MEMBERS")<0) { echo("

\n"); echo("
\n $ERRMSG \n
\n

\n"); exit(0); } if ($pass=="") { $err="You must supply your password!"; } if (msqlQuery($sock, "SELECT user FROM user_data WHERE user='$user'")<0) { echo("

\n"); echo("
\n USER_DATA: $ERRMSG \n
\n

\n"); exit(0); } $fd=msqlStoreResult(); $dt=msqlFetchRow($fd); msqlFreeResult($fd); if (#$dt>0) { $err="User '$user' already exists in our database.
Please chose another username."; } if ($user=="") { $err="You must supply your user name!"; } if ($amount!=25 && $amount!=60) { $err="How the hell did you enter this amount (" + (char)$amount + ") ???"; } if ($ex1<1 || $ex1>12) { $err="Expire 'MONTH' value must be in range 1-12."; } $tme=time(); /* What's current time ? */ $year=(int)strftime("%y", $tme); /* $year = current year */ $month=unixtime2month($tme); /* $month = current month*/ $datum=strftime("%Y%m%d", $tme); /* Generate time stamp. */ if ($ex2<$year) { $yr=$year - 1; $err="Expire YEAR value must be grater than $yr.
Are you shure that your card did not expire?"; } if ($ex2==$year && $ex1<$month) { $err="Expire MONTH value must be grater than $month.
Are you shure that your card did not expire?"; } if ($ex2==0 && $ex1==0) { $ex2=""; $ex1=""; $err="You must enter expire date information
from your credit card."; } if ($cardno=="") { $err="You must supply credit card number."; } else { $prg="./check_card " + $cardno; $fd=open($prg, "<|"); if ($fd<0) { echo("

\n"); echo("
\n Program was unable to validate your card. Please, try again later!!! \n

\n"); exit(0); } $vald=chop(readln($fd)); $vld=split($vald, ","); $valid=(int)$vld[0]; $cardn=$vld[1]; if ($cardn=="") { $cardn=$cardno; } close($fd); if ($valid==0) { $err="It seems that your credit card number is not valid,
please check it once more."; } } $test=split($email, "\@"); if (#$test!=2) { $err="Your E-mail address should look like:
user@host.domain"; } if ($test[1]=="hotmail.com" || $test[1]=="juno.com") { $err="Users from your host is not allowed to register on this site.
Get your selve decent E-mail address."; } if ($email=="") { $err="You can not receive our reply mail
if you don't fill E-mail field!"; } if ($country=="") { $err="Could you please fill in your Country field?"; } if ($zip=="") { $err="Is it possible that you don't know your ZIP code?"; } if ($city=="") { $err="City field should be filled in."; } if ($address=="") { $err="Address field has to be supplied."; } if ($surname=="") { $err="Could you please fill in your last name?"; } if ($name=="") { $err="Please fill in your name."; } if ($pass!=$valpass) { $err="Password and Validate password does not match."; } if ($terms<1) { $err="What are you doing here,
if you don't agree with our terms?"; } if ($err!="") { echo("

\n"); echo("
\n $err \n
\n

\n"); echo("
\n"); } else { if (msqlQuery($sock, "SELECT _seq FROM user_data")<0) { echo("

\n"); echo("
\n USER_DATA: $ERRMSG \n
\n

\n"); exit(0); } $fd=msqlStoreResult(); $seq=msqlFetchRow($fd); if (#$seq==0) { echo("

\n"); echo("
\n Program is unable to find next _SEQ value for user_data table. \n
\n

\n"); exit(0); } $id_us=$seq[0]; msqlFreeResult($fd); $input="INSERT INTO user_data VALUES ($id_us,'$user','$pass','$name','$surname','$group','$email','$phone',$datum,'0')"; if (msqlQuery($sock, $input)<0) { echo("

\n"); echo("
\n USER_DATA: $ERRMSG \n
\n

\n"); exit(0); } if (msqlQuery($sock, "SELECT _seq FROM billing")<0) { echo("

\n"); echo("
\n BILLING: $ERRMSG \n
\n

\n"); exit(0); } $fd=msqlStoreResult(); $seq=msqlFetchRow($fd); if (#$seq==0) { echo("

\n"); echo("
\n Program is unable to find next _SEQ value for billing table. \n
\n

\n"); exit(0); } $id_bill=$seq[0]; msqlFreeResult($fd); $input="INSERT INTO billing VALUES ($id_bill,$id_us,'$address','$city','$zip','$country','$cardtype','$cardn','$expire',$amount)"; if (msqlQuery($sock, $input)<0) { echo("

\n"); echo("
\n BILLING: $ERRMSG \n
\n

\n"); exit(0); } $fd=open("response.msql", "<"); if ($fd<0) { echo("

\n"); echo("
\n RESPONSE: $ERRMSG \n
\n

\n"); exit(0); } $out=0; while ($out==0) { $line=readln($fd); if ($line=="") { $out=1; } $line=chop($line); $line=sub($line, "$USER", $user); $line=sub($line, "$PASS", $pass); echo("$line\n"); } close($fd); $pid=getpid(); system("/bin/cat email-head > /tmp/mail.$pid"); $fd=open("/tmp/mail.$pid", ">>"); if ($fd<0) { $err="Program was unable to send you registration mail.
" + $ERRMSG; echo("

\n"); echo("
\n MAIL: $ERRMSG \n
\n

\n"); } fprintf($fd, " Username: %s\n", $user); fprintf($fd, " Password: %s\n", $pass); close($fd); system("/bin/cat email-trail >> /tmp/mail.$pid"); system("/usr/bin/mail $email < /tmp/mail.$pid"); system("/bin/rm /tmp/mail.$pid"); /* if (msqlQuery($sock, "INSERT INTO credits VALUES($id_us,'$user',0,$tme)")<0) { echo("

\n"); echo("
\n CREDITS: $ERRMSG \n
\n

\n"); exit(0); } */ msqlClose($sock); exit(0); } msqlClose($sock); } else { $name=""; $address=""; $city=""; $state=""; $zip=""; $valpass=""; $country=""; $email=""; $phone=""; $cardno=""; $ex1=""; $ex2=""; $user=""; $pass=""; $surname=""; } echo("

\n"); echo("
\n"); echo("\n"); echo("

\n"); echo("
\n"); echo(" Please fill in the form VERY CAREFULLY. \n"); echo(" For the authorization of the credit cards we need correct\n"); echo(" and exact: \n"); echo(" Credit Card No, Name, Exp. date, House No, Post Code\n"); echo(" (zip) \n"); echo(" This is important if you want to get fast authorization\n"); echo(" and a full access. \n"); echo(" * optional filed ---- The\n"); echo(" password will be instantly mailed to you. Some providers\n"); echo(" AOL.com, CompuServe.com MSN.com don't deliver mails\n"); echo(" instantly. We don't accept aplications from hotmail.com\n"); echo(" & juno.com sorry \n"); echo(" \n"); echo("
\n"); echo("

\n"); echo("
\n"); echo("\n"); echo("

\n"); echo("\n"); echo(" \n"); echo("

\n"); echo("

  \n"); $site=$REMOTE_HOST; if ($site=="") { $site=$REMOTE_ADDR; } echo("
  \n"); echo(" Welcome, as I can see you are comming from: $site\n"); echo("
  \n"); echo("
  \n"); echo(" User Information as on the Credit Card\n"); echo("
  \n"); echo("
  \n"); echo(" First Name: \n"); echo(" | Write your full name as on the CREDIT CARD\n"); echo("
  \n"); echo("
  \n"); echo(" Last Name: \n"); echo("
  \n"); echo("
  \n"); echo(" Address: \n"); echo(" | It's very important for fast\n"); echo(" verification !\n"); echo("
  \n"); echo("
  \n"); echo(" City: \n"); echo(" | \n"); echo("
  \n"); echo("
  \n"); echo(" Zip Code: \n"); echo(" | correct Zip or Postal Code \n"); echo("
  \n"); echo("
  \n"); echo(" Country:"); echo(" \n"); if ((char)$country==""){ echo(" United States"); echo(" Andorra"); echo(" Argentina"); echo(" Australia"); echo(" Austria"); echo(" Belgium"); echo(" Bolivia"); echo(" Brazil"); echo(" Chile"); echo(" China"); echo(" Colombia"); echo(" Cyprus"); echo(" Czech Republic"); echo(" Denmark"); echo(" Finland"); echo(" France"); echo(" Germany"); echo(" Greece"); echo(" Hong Kong"); echo(" Hungary"); echo(" Iceland"); echo(" India"); echo(" Indonesia"); echo(" Ireland"); echo(" Israel"); echo(" Italy"); echo(" Japan"); echo(" Republic of Korea"); echo(" Kuwait"); echo(" Liechtenstein"); echo(" Luxembourg"); echo(" Malaysia"); echo(" Malta"); echo(" Mexico"); echo(" Micronesia"); echo(" Moldova"); echo(" Monaco"); echo(" Netherlands"); echo(" New Zealand"); echo(" Norway"); echo(" Panama"); echo(" Peru"); echo(" Philippines"); echo(" Poland"); echo(" Portugal"); echo(" Russian Federation"); echo(" Saudi Arabia"); echo(" Singapore"); echo(" Slovakia"); echo(" South Africa"); echo(" Spain"); echo(" Sweden"); echo(" Switzerland"); echo(" Taiwan"); echo(" Thailand"); echo(" Togo"); echo(" Turkey"); echo(" United Arab Emirates"); echo(" Other"); } else { echo("$country\n"); } echo(" "); echo(" | \n"); echo("
  \n"); echo("
  \n"); echo(" E-Mail: \n"); echo(" | (real one if you want a password )\n"); echo("
  \n"); echo("
  \n"); echo(" * Phone No.: \n"); echo(" | optional\n"); echo("
  \n"); echo("
  \n"); echo(" Credit Card Information\n"); echo("
  \n"); echo("
  \n"); echo(" Type of the\n"); echo(" Credit Card \n"); echo(" | \n"); echo("
  \n"); echo("
  \n"); echo(" Card No: \n"); echo(" | format xxxx-xxxx-xxxx-xxxx\n"); echo("
  \n"); echo("
  \n"); echo(" Expire:"); echo(" /"); if ((char)$ex1==""){ echo(" 01\n"); echo(" 02\n"); echo(" 03\n"); echo(" 04\n"); echo(" 05\n"); echo(" 06\n"); echo(" 07\n"); echo(" 08\n"); echo(" 09\n"); echo(" 10\n"); echo(" 11\n"); echo(" 12\n"); } else { echo("$ex1\n"); } echo(" "); echo(" \n"); if ((char)$ex2==""){ echo(" 1998\n"); echo(" 1999\n"); echo(" 2000\n"); echo(" 2001\n"); echo(" 2002\n"); echo(" 2003\n"); echo(" 2004\n"); echo(" 2005\n"); } else { echo("$ex2\n"); } echo(" \n"); echo(" \n"); echo(" | (format mm/yy e.g 01/99)\n"); echo("
  \n"); echo("
  \n"); echo(" Amount: \n"); echo(" Monthly - 25 US-Dollars\n"); echo(" Three months - 60 US-Dolars\n"); echo(" \n"); echo(" | \n"); echo("
  \n"); echo("
  \n"); echo(" \n"); echo("
  \n"); echo("
  \n"); echo(" User Name : \n"); echo(" | case\n"); echo(" sensitive one word no spaces\n"); echo("
  \n"); echo("
  \n"); echo(" User Pass : \n"); echo(" | case\n"); echo(" sensitive one word no spaces\n"); echo("
  \n"); echo("
  \n"); echo(" Pass Validation : \n"); echo(" | \n"); echo(" \n"); echo("
  \n"); echo("
  \n"); echo(" Terms & Conditions \n"); echo(" \n"); echo(" \n"); echo(" \n"); echo("
  \n"); echo("

  \n"); echo("
\n"); echo("
\n"); echo("

\n"); echo("

\n"); echo("

\n"); echo("

\n"); echo("

\n"); echo(" \n"); echo("
\n"); >