The data from the form is not getting stored in database for volunteer's registration. The same code for organization's registration is working. Please help.
<?php
include("config.php");
if(!$db){
die("Connection Failed: ".mysqli_connect_error());
}
//Volunteer's Registration
if(isset($_POST['volemail'],$_POST['volname'],$_POST['volbdate'],$_POST['volmob'],$_POST['volgen'],$_POST['voladdr'],$_POST['volorg'])){
$volbdate=strtotime($_POST['volbdate']);
$volbdate=date("Y-m-d",$volbdate);
//$rawdate = htmlentities($_POST['volbdate']);
//$volbdate = date('Y-m-d', strtotime($rawdate));
echo $volbdate;
$sql1="insert into volunteer values('".$_POST['volemail']."','".$_POST['volname']."','$volbdate','".$_POST['volmob']."','".$_POST['volgen']."','".$_POST['voladdr']."','".$_POST['volorg']."')";
if(mysqli_query($db,$sql1)){
echo "Volunteer's registration Successful!";
}
else {
echo "Error: " . $sql1 . "<br>" . mysqli_error($db);
}
}
?>
Comments
Post a Comment