query("DESCRIBE fighters"); while ($o = $sql->fetch_object($q)) { $field = $o->Field; $fields_to_save[] = $field; if (isset($_REQUEST[$field])) { ${$field} = $_REQUEST[$field]; } else { $field == "f_country" ? ${$field} = "US" : ${$field} = ""; } if ($field == "f_dob") if (${$field}) list($f_dob_3, $f_dob_1, $f_dob_2) = sscanf(${$field}, "%d-%d-%d"); else $f_dob_3 = $f_dob_1 = $f_dob_2 = ""; } if (isset($_REQUEST["all_OK"]) && $_REQUEST["all_OK"]) { $insert_values = array(); $password = generate_password(); $insert_values[] = "f_status = 0"; $insert_values[] = "f_joined_date = NOW()"; $insert_values[] = "f_joined_ip = '" . $_SERVER['REMOTE_ADDR'] . "'"; $insert_values[] = "f_joined_browser = '" . mysql_real_escape_string($_SERVER["HTTP_USER_AGENT"]) . "'"; $insert_values[] = "f_experience = '" . (intval($_REQUEST["f_wins"]) + intval($_REQUEST["f_loses"]) + intval($_REQUEST["f_draws"])) . "'"; $insert_values[] = "f_password = '$password'"; foreach ($_REQUEST as $rk => $rv) { if (in_array($rk, $fields_to_save)) { $insert_values[] = "$rk = '" . mysql_real_escape_string($rv) . "'"; } } // check for profile picture $img = new image(); $image_OK = false; if (isset($_FILES["f_picture"]) && $_FILES["f_picture"]["error"] == UPLOAD_ERR_OK) { $new_name = generate_image_name() . "." . pathinfo($_FILES["f_picture"]["name"], PATHINFO_EXTENSION); echo $new_name . "
"; $new_path = "/var/www/vhosts/mmabookings.com/httpdocs/pictures/$new_name"; //"./pictures/$new_name" echo "Path: " . $new_path . "
"; if (move_uploaded_file($_FILES["f_picture"]["tmp_name"], $new_path)) { echo "made it here...
"; echo "File Exists: " . file_exists('$new_path') . "


"; if (file_exists('$new_path')) //(file_exists(IMAGE_IDENTIFIER))$new_path { echo "made it here 2...
"; list($width, $height, $type) = $img->identify_image($new_path); echo "made it here 3...
"; echo "w: " . $width . " h: " . $height . " t: " . $type . "img: " . $img; if ($width && $height && $type) { echo "made it here 4...
"; $insert_values[] = "f_picture = '$new_name"; $insert_values[] = "f_picture_width = '$width'"; $insert_values[] = "f_picture_height = '$height'"; $insert_values[] = "f_picture_type = '$type'"; $image_OK = true; } else @unlink($new_path); echo "made it here 5...
"; } else { echo "made it here 6...
"; echo $new_name; chmod("$new_path", 0777); $insert_values[] = "f_picture = '$new_name"; $image_OK = true; } } else @unlink($_FILES["f_picture"]["tmp_name"]); } if (!$image_OK) { $error_text = "There was a problem uploading your profile picture. Please make sure you have choosed correct picture less than 2Mb size. We accept JPEG, GIF and PNG images."; } else { //Once you have chosen your subscription plan and your payment has been processed, your profile will appear on MMABookings.com within 1 business day. //echo"

INSERT INTO fighters SET "; //echo implode(",", $insert_values); $sql->query("INSERT INTO fighters SET " . implode(",", $insert_values) . "'"); if ($sql->affected_rows()) { // send confirmation e-mail $headers = array("From: MMA Bookings "); $receiver = "$f_name_first $f_name_last <$f_email_1>"; if ($f_email_2) $headers[] = "CC: $f_name_first $f_name_last <$f_email_2>"; $subject = "Registration with MMABookings.com"; $message = "Dear $f_name_first $f_name_last, This message is to confirm your registration with MMABookings.com. Your profile will appear on MMABookings.com within 1 business day. Your profile is now active on www.MMABookings.com. We encourage you to utilize your page as a tool to sell yourself to promoters, sponsors & casting agencies. This will increase your visibility, and that of www.MMABookings.com. If you have fight videos that you would like added to your profile, or would like a banner ad that links to your page, please email them to info@mmabookings.com. Please also refer www.MMABookings.com to other fighters & companies. Being a free MMA resource, our goal remains to be the one-stop-shop for all MMA talent needs, with the largest MMA database in the world. Thus far we have over 640 fighters, with over 135 fighters that have been contacted by MMA companies worldwide. We are also working with Rick Bassman's Larger Than Life Management and CESD Talent Agency, who use the site to find colorful fighters for theatrical bookings! If you havenít already, please join the MMA Bookings community: Facebook: http://facebook.com/mmabookings Twitter: http://twitter.com/mmabookings MySpace: http://www .myspace.com/mmabookings Please find your password below. You can use this to make any changes or updates to your profile at any time. Your user name: $f_login Your password: $password If you have any questions, please email info@mmabookings.com. Thank you, MMABookings.com "; @mail($receiver, $subject, $message, implode("\r\n", $headers)); $q = $sql->query("SELECT * FROM admins WHERE a_status > 0"); while ($o = $sql->fetch_object($q)) { $headers = array("From: MMA Bookings "); $receiver = "$o->a_name_first $o->a_name_last <$o->a_email_1>"; $subject = "Notification of new fighter registration"; //if ($o->f_email_2) $headers[] = "CC: $o->f_name_first $o->f_name_last <$o->f_email_2>"; $message = "Dear $o->a_name_first $o->a_name_last, This message is to notify you of a new fighter registration at MMABookings.com. Please review fighter's account and approve or decline it's registration. You can also edit information, provided by the applicant. Fighter Name: $f_name_first $f_name_last Email: $f_email_1 Please follow the link http://mmabookings.com/admin.php and choose \"Awaiting confirmation\" when opened. Sincerelly, MMABookings.com Automated Administrator "; @mail($receiver, $subject, $message, implode("\r\n", $headers)); header("Location: /payment_receipt.php"); die();//thankyou.php } } // if saved in DB } // else $error_text = "An error occured while processing your request. Please try again later."; } // if all_OK include("$ROOT/page.inc"); ?>