\n"; $isRegistered=false; $result = mysql_query("select user_id from $dbtable where email='{$_REQUEST['email']}'"); if (mysql_num_rows($result) > 0) { $isRegistered=true; $msg = "This email address had registered already."; } $result = mysql_query("select user_id from $dbtable where username='{$_REQUEST['username']}'"); if (mysql_num_rows($result) > 0) { $isRegistered=true; $msg = "This username has been used by another person."; } // if ( $_REQUEST['fname']!="" && $_REQUEST['lname']!="" && $_REQUEST['department']!="" && $_REQUEST['country']!="" && $_REQUEST['phone']!="" && $_REQUEST['email']!="" && $_REQUEST['institution']!="" && !$isRegistered) if ( $_REQUEST['fname']!="" && $_REQUEST['lname']!="" && $_REQUEST['department']!="" && $_REQUEST['country']!="" && $_REQUEST['phone']!="" && $_REQUEST['email']!="" && $_REQUEST['institution']!="" && !$isRegistered) { // print("Pass\n"); //get a new user_id $result = mysql_query("select IFNULL(max(user_id),0)+1 from $dbtable"); $user_id= mysql_result($result,0); //debug// echo $user_id. "
\n"; $FO_Code = "CONF"; ## FO confirmed Activity Code $attempt=1; $syscode= sprintf("%06s", $user_id); ## System generated running number $syscode1= sprintf("%03s", $user_id); ## System generated running number $syscode2= sprintf("%02s", $attempt); ## System generated running number $regnum = "ICTS".$FO_Code."13".$syscode; $invoiceNum = $regnum.$syscode2; $username=strtolower($_REQUEST[lname]).$syscode1; //debug// echo $username. "
\n"; $filename=$_FILES['upload_abstract']['name']; $filetype=$_FILES['upload_abstract']['type']; //debug// echo $filetype. "
\n"; $filesize=$_FILES['upload_abstract']['size']; $error = $_FILES['upload_abstract']['error']; $dir='/var/www/html/inele/register/abstract/'; $path = $dir . $username ; if (!file_exists($path)) mkdir($path, 0755); $file = $path . "/" . $filename ; $tmp_name=$_FILES['upload_abstract']['tmp_name']; if ($error==UPLOAD_ERR_OK) { move_uploaded_file($tmp_name, $file); } else if ($error==UPLOAD_ERR_NO_FILE) { print("No files specified.\n"); } else { print("Upload failed.\n"); } $password = genpass(); //debug// echo $password. "
\n"; $pwfile=$dir . 'userdata'; $fh = fopen($pwfile,'a') or die("Can't open file"); $cryptpass = crypt($password, base64_encode($password)); $stringdata = $username . ":" . $cryptpass . "\n"; fwrite($fh,$stringdata); fclose($fh); $authfile=$path . '/.htaccess'; $fp = fopen($authfile,'w') or die("Can't open file"); $authdata = "AuthType Basic\n"; $authdata .= "AuthName \"Protected file\"\n"; $authdata .= "AuthUserFile " . $pwfile . "\n"; $authdata .= "Require user " . $username . "\n"; fwrite($fp,$authdata); fclose($fp); $salute = $_REQUEST['salute']; $_REQUEST['house']='self'; list($rtype,$rfee) = split('-',$_REQUEST['rfee']); if ($_REQUEST['ptype']=='onsite') $rtype=$rtype."_site"; if (@$_REQUEST['invletter'] == NULL) { $invitationLetter = 'NO'; } else { $invitationLetter = 'YES'; } $total_fee = $rfee; // print("Pass
\n"); $ip = $_SERVER['REMOTE_ADDR']; $query="insert into $dbtable (user_id, regnum, salute, fname, lname, email, country, phone, fax, institution, department, topic, address, pretype, pretitle, filename, username, password, md5pass, rtype,rfee,ptype,house,invletter,hfee,attempt,ip,regdate) values ('{$user_id}','".handleOText($regnum)."', '".handleOText($salute)."', '".handleOText($_REQUEST['fname'])."', '".handleOText($_REQUEST['lname'])."', '".handleOText($_REQUEST['email'])."', '".handleOText($_REQUEST['country'])."', '".handleOText($_REQUEST['phone'])."','".handleOText($_REQUEST['fax'])."', '".handleOText($_REQUEST['institution'])."','".handleOText($_REQUEST['department'])."', '".handleOText($_REQUEST['topic'])."', '".handleOText($_REQUEST['address'])."', '".handleOText($_REQUEST['pre_type']). "', '".handleOText($_REQUEST['pre_title'])."', '".handleOText($filename)."', '".handleOText($username)."', '".handleOText($password)."', '".handleOText(md5($password))."', '".handleOText($rtype)."','".handleOText($rfee)."', '".handleOText($_REQUEST['ptype'])."', '".handleOText($_REQUEST['house'])."','".handleOText($invitationLetter)."', '".$house_fee."','".$attempt."','$ip',SYSDATE())"; // echo $query; $result = mysql_query($query); // debug print $query . "
\n"; $_SESSION['user_id']=$user_id; $_SESSION['logined']= true; // email_start $query="select * from $dbtable where user_id='{$user_id}' "; $result = mysql_query($query); $user_record=mysql_fetch_assoc($result); $random_hash = md5(date('r', time())); $headers = ""; $receiver = $user_record['salute']." ".$user_record['fname']." ".$user_record['lname']; $receiver_email=$user_record['email']; $from = "icts@hkbu.edu.hk"; $bcc1 = "icts@hkbu.edu.hk"; // $bcc = "morris@hkbu.edu.hk"; $bcc = "morris@hkbu.edu.hk,icts@hkbu.edu.hk"; $headers .= "From: INELE 2013<".$from.">\r\n"; $headers .= "Reply-To: <".$bcc1.">\r\n"; $headers .= "Bcc: $bcc\r\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\""; $subject = "Confirmation of Online Registration of INELE 2013"; mb_internal_encoding('UTF-8'); $subject=mb_encode_mimeheader($subject, 'UTF-8'); list($regtype,$paytype) = split('_',$user_record[rtype]); // modified on April 25, 2012. All payment are online before August 31 if ($paytype=="site") $payment="Pay on site"; else $payment="Pay online"; //modified on 13 August, 2012 // $payment="Pay online"; //content $mail_message = " Dear $receiver,

Your online registration for INELE2013 has been sent to $bcc1.
\n Below are details that you have submitted. For any query, please feel free to contact us by:
\n "; $mail_table="
Reference number : $regnum
Personal Particulars
Name: $receiver
Country: $user_record[country] Email Address: $user_record[email]
Phone: $user_record[phone] Fax: $user_record[fax]
Institution: $user_record[institution] Department/Division: $user_record[department]
Mailing Address:$user_record[address]
Conference Details
Abstract file:$user_record[filename]
Registration Fee
Type of Registration: $user_record[rtype]
Registration Fee: HKD $user_record[rfee]
Payment: $payment
Enquiry Login
Username: $username
Password: $password
For enquiry, please quote the above reference number
"; //real send // $actual_msg= ''.$mail_message.$mail_table.''; $actual_msg= $mail_message.$mail_table; $actual_msg=str_replace(">",">\n",$actual_msg); //to avoid chopping characters if a line is too long $actual_msg=str_replace(" "," \n",$actual_msg); //define the body of the message. $actmsg = "--PHP-mixed-$random_hash\r\n" ."Content-Type: multipart/alternative; boundary=\"PHP-alt-$random_hash\"\r\n\r\n"; $actmsg .= "--PHP-alt-$random_hash\r\n" ."Content-Type: text/plain; charset=\"iso-8859-1\"\r\n" ."Content-Transfer-Encoding: 7bit\r\n\r\n"; $textmessage='this is a plain text'; $actmsg .= strip_tags($textmessage); $actmsg .= "\r\n\r\n--PHP-alt-$random_hash\r\n" ."Content-Type: text/html; charset=\"iso-8859-1\r\n" ."Content-Transfer-Encoding: 7bit\r\n\r\n"; $actmsg .= $actual_msg; $actmsg .="\r\n\r\n--PHP-alt-$random_hash--\r\n\r\n"; //include attachment $actmsg .= "--PHP-mixed-$random_hash\r\n" ."Content-Type: ".$filetype."; name=\"$filename\"\r\n" ."Content-Transfer-Encoding: base64\r\n" ."Content-Disposition: attachment; filename=\"$filename\"\r\n\r\n"; $actmsg .= chunk_split(base64_encode(file_get_contents($file))); $actmsg .= "/r/n--PHP-mixed-$random_hash--"; ## Uncomment the following line to pre-assign the receiver_email for testing // $receiver_email = "morris@hkbu.edu.hk"; ## Uncomment the following line for production (actual send out) mail($receiver_email, $subject,$actmsg, $headers); // email_end $txndetail = "11 INELE 2013-Registration Fee$user_record[rfee]"; ?> Online Registration for INELE2013 International Conference
INELE2013 Online Registration
Reference Number:
Personal Particulars
Name:
Email Address:
Country:
Phone: Fax:
Institution: Department:
Mailing Address:  
Invitation Letter:
Conference Details
Abstract file details:
Registration Fee
Type of Registration:
Registration Fee: HKD
Payment:
Enquiry Login
Username: Password:
For enquiry, please quote the above reference number
Registration for INELE 2013 HongKong International Conference

INELE2013 Online Registration
Personal Particulars
Title: Surname : Personal name :
Institution : Dept/Division :
Email : Country :
Phone : Fax:
Mailing Address :
*  
checked>I will need an official invitation letter.
Note: The invitation letter will only be sent to those who have completed the registration procedure and paid the registration fee.
Conference Details
Abstract file:
Abstract file in PDF file format is preferred, other file formats would be converted to PDF file format without any adjustment.
Abstract template files for your references in MSWord format.
Registration Fee
Conference Fee:  *    >Regular (HK$2,000 or US$260 / Early bird: HK$1,000 or US$130 - pay on or before October 14, 2013)
>Student (HK$1,000 or US$65 / Early bird: HK$500 or US$130 - pay on or before October 14, 2013)
Online Payment with :   *    >Visa / MasterCard   *    >China UnionPay


Enter the above code: