rollreview

Election Subscription verification

First Name: Last Name :
Date of birth:     Day    Month  Year  
$connexion = @mysql_connect(“mysqlv112″,”cgnyadmin”,”Cgny1954″); mysql_select_db(“cgny”,$connexion); if (($_SERVER[‘REQUEST_METHOD’] == ‘POST’)) { echo” “;echo””;echo””; echo””; echo”
“; // fields introduction verifications if ( (!empty($_POST[‘first_name’])) and (!empty($_POST[‘dobdd’]))and (!empty($_POST[‘dobmm’]))and (!empty($_POST[‘dobyyyy’])) ) { if (($_POST[‘dobdd’] <= “31”) and ( $_POST[‘dobdd’] >= “01”) and ($_POST[‘dobmm’] < “13”) and ( $_POST[‘dobdd’] > “00”) and ( $_POST[‘dobyyyy’] > “1850”) and ( $_POST[‘dobyyyy’] < “2099”) ) { // Make all the dates looks like dd/mm/yyyy if ( strlen($_POST[‘dobdd’])==1 ) { $_POST[‘dobdd’]=”0″.$_POST[‘dobdd’]; } if ( strlen($_POST[‘dobmm’])==1 ) { $_POST[‘dobmm’]=”0″.$_POST[‘dobmm’]; } // end of Make all the dates looks like dd/mm/yyyy // Preparing the fileds for the SQL Query $dob = $_POST[‘dobdd’].”/”.$_POST[‘dobmm’].”/”.$_POST[‘dobyyyy’]; $dobinv = $_POST[‘dobmm’].”/”.$_POST[‘dobdd’].”/”.$_POST[‘dobyyyy’]; $first_name = trim($_POST[‘first_name’]); $last_name = trim($_POST[‘last_name’]); $fullname = $last_name.$first_name; $fullname = str_replace(“-“, “”, $fullname, $count); $fullname = str_replace(” “, “”, $fullname, $count); $fullname = str_replace(“‘”, “”, $fullname, $count); //End of Preparation Preparing of SQL Query //Query $req=”select num_ins,First_Name,Last_Name,bureau,centre from election_liste where fullname like ‘%$fullname%’ and (DOB=’$dob’ or DOB=’$dobinv’) “; $res= mysql_query($req); // End of Query if (mysql_fetch_array($res)) { $num_ins= mysql_result($res,0,”num_ins”); $FirstName= mysql_result($res,0,”first_name”); $LastName= mysql_result($res,0,”last_name”); $bureau= mysql_result($res,0,”bureau”); $centre= mysql_result($res,0,”centre”); //Query2 $reqbureau=”select location from election_bureau where centre like ‘%$centre%’ “; $resbureau= mysql_query($reqbureau); // End of Query2 $location= mysql_result($resbureau,0,”location”); echo ” “; echo ““.$FirstName.” “.$LastName.” “; echo ““.”your number in the voter registration is : ” .$num_ins.” “; //where to vote (you can only vote at your designated polling place) echo ““.”your designated polling station is : ” .$centre.” “; echo ““.$location.” “; echo ““.”Elections dates : from April 29 through May 04, 2017″.” “; echo ““.”Hours : From 8:00AM to 07:00PM”.” “; echo “ “.”NB: you can only vote at your designated polling place!”.” “; } // End if else { echo ““.”Name Not Found!”.” “; } } else { echo ““.”Incorrect Date, Please enter a valid date!”.” “; } } // end fields introduction verifications else { echo ““.”All fields are required!!!”.” “; } //end else line 91 echo”
“; } // end _SERVER[‘REQUEST_METHOD’ line 16 ?>