Member Registration
Enter the appropriate account profile information. This information is needed to customize specific needs.
$market= $_POST['market']; $ip= $_POST['ip']; //************************************************************************************************** //* Program Name : form-account-hbm.php //* Purpose : Register new provider for hbm system //* Author : Robert B. Hyte //* Date : August 15, 2013 //* Revised : Sept 12, 2013 //************************************************************************************************** //************************************************************************************************** //* All functions -- strip credit card numbers for safety //************************************************************************************************** //************************************************ //* Clean input //************************************************ function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } //************************************************ //* Smart Clean //* Quote variable to make safe //************************************************ function quote_smart($value) { // Stripslashes if ( get_magic_quotes_gpc() ) { $value = stripslashes( $value ); } // Quote if not a number or a numeric string if ( !is_numeric( $value ) ) { $value = mysqli_real_escape_string($con,$value) ; } return $value; } function get_ip() { //Just get the headers if we can or else use the SERVER global if ( function_exists( 'apache_request_headers' ) ) { $headers = apache_request_headers(); } else { $headers = $_SERVER; } //Get the forwarded IP if it exists if ( array_key_exists( 'X-Forwarded-For', $headers ) && filter_var( $headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) { $the_ip = $headers['X-Forwarded-For']; } elseif ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $headers ) && filter_var( $headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) { $the_ip = $headers['HTTP_X_FORWARDED_FOR']; } else { $the_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ); } return $the_ip; } function randomstring($length) { $keys = array_merge(range(0,9), range('a', 'z')); for($i=0; $i < $length; $i++) { $key .= $keys[mt_rand(0, count($keys) - 1)]; } return $key; } //************************************************************************************************** //* Set up database //************************************************************************************************** $con = mysqli_connect("careconsulcom.ipowermysql.com","consul","Hijt:4983","consul"); if (!$con){ die("Can not connect: " . mysql_error()); } //************************************************************************************************** //* Harvest posted data from user input //************************************************************************************************** if($_POST['form_mode'] =='add') { $firstname= quote_smart($_POST['firstname']); $lastname= quote_smart($_POST['lastname']); $address1= quote_smart($_POST['address1']); $address2= quote_smart($_POST['address2']); $city= quote_smart($_POST['city']); $state= quote_smart($_POST['state']); $zip= quote_smart($_POST['zip']); $phone_number= quote_smart($_POST['phone_number']); $email= quote_smart($_POST['email']); $username= quote_smart($_POST['username']); $password= quote_smart($_POST['password']); $market_form= quote_smart($_POST['market_form']); $screen_name= quote_smart($_POST['screen_name']); $gender= quote_smart($_POST['gender']); $reg_date=date('Y-m-d H:i:s'); $type='2'; $screen_name=strtolower($screen_name); $confirmcode='y'; $active='y'; $username = strtolower($username); //************************************************************************************************** //************************************************************************************************** //* write data base //************************************************************************************************** $timer=time(); $pwdmd5 = md5($password); $iquery = "INSERT INTO fgusers3 ( firstname, lastname, address1, address2, city, state, zip, email, phone_number, username, password, type, level, screen_name, gender, reg_date, active) VALUES ( '$firstname', '$lastname', '$address1', '$address2', '$city', '$state', '$zip', '$email', '$phone_number', '$username', '$pwdmd5', '$type', '$level', '$screen_name', '$gender', '$reg_date', '$active')"; $retval = MYSQLi_QUERY($con,$iquery); if(! $retval ) { die('Could not enter data: ' . mysql_error()); } $real_name=$firstname.' '.$lastname; $_SESSION['real_name']=$real_name; $_SESSION['reg_uname']=$username; // echo "Entered data successfully\n"; mysql_close($connection); echo ""; exit; } //************************************************************************************************** //* End of PHP process of data - Start of HTML //************************************************************************************************** ?>