Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/blockchain-2019/
Upload File :
Current File : /var/www/html/venkat/blockchain-2019/submit.php

<?php
include("inde.php");
include("db1.php");
$ip=$_SERVER['REMOTE_ADDR'];
session_start(); 
function display($email) {
	include("db1.php");
	$sql1 = $conn->prepare("SELECT * FROM register where email = :email");
	$sql1->bindValue(':email',$email);
	$sql1->execute();
	$row = $sql1->rowCount();
	echo "<center> Your Details </center> ";
	while($row = $sql1->fetch()) {
		$name = $row['name'];
		$name = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $name);
		$email = $row['email'];
		$poster = $row['poster'];
		$post = $row['post'];
		$category = $row['category'];
		$accommodation = $row['accommodation'];
		echo "<div align = 'center'>Name:".$name."--E-Mail:".$email."--Institute:".$poster."--Participation Category:".$category."--Position:".$post."--Accommodation Details:".$accommodation."</div>";
	}

}
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')  { 
     echo '<strong>Incorrect verification code.</strong>';
     echo '<a href = "register.php"> Go Back </a>';
} else { 
	$stmt = $conn->prepare("INSERT INTO register(name, email, category, poster, post, ipa, date1, accommodation) VALUES (:name, :email, :category, :poster, :post, :ip, :date1, :accommodation)");
	
	$input =  htmlspecialchars(addslashes($_POST['name']));
	$input = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $input);
        $input = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $input);
        $input = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $input);
        $name = html_entity_decode($input, ENT_COMPAT, 'UTF-8');
	$stmt->bindParam(':name', $name);
	
	$stmt->bindParam(':post', addslashes($_POST['post']));
	
	$input = htmlspecialchars(addslashes($_POST['email']));
	$input = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $input);
        $input = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $input);
        $input = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $input);
        $email = html_entity_decode($input, ENT_COMPAT, 'UTF-8');
	$stmt->bindParam(':email', $email);
	
	$input = htmlspecialchars(addslashes($_POST['poster']));
	$input = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $input);
        $input = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $input);
        $input = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $input);
        $email1 = html_entity_decode($input, ENT_COMPAT, 'UTF-8');
	$stmt->bindParam(':poster', $email1);
	
	$input = htmlspecialchars(addslashes($_POST['accommodation']));
	$input = str_replace(array('&amp;','&lt;','&gt;'), array('&amp;amp;','&amp;lt;','&amp;gt;'), $input);
        $input = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $input);
        $input = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $input);
        $accomo = html_entity_decode($input, ENT_COMPAT, 'UTF-8');
	$stmt->bindParam(':accommodation', $accomo);


	$stmt->bindParam(':category', addslashes($_POST['category']));
	$stmt->bindParam(':ip', $ip);
	$stmt->bindParam(':date1', date("Y/m/d h:i:s A"));
	$email = addslashes($_POST['email']);
	$sql = $conn->prepare("SELECT email FROM register where email = :email");
	$sql->bindValue(':email',$email);
	$sql->execute();
	$row = $sql->rowCount();
	if($row <= 0) {
		if($stmt->execute()) {
	        	echo "<b> <center> <font color = 'blue'> <br>Sucessfully Submitted </font>  </center> </b> <br> <br>";
			display($email);
		}
	}
	else {
			echo "<b> <center> <font color = 'blue'> <br>Already Submitted </font>  </center> </b> <br> <br>";
			//display($email);
	}
}
include("bottom.php");
?>