Entry.php
<?php
require 'config.php';
if (isset($_GET['logout']))
{
unset($_SESSION['isLogged']);
unset($_SESSION['isLogged']);
session_destroy();
header('location: index.php');
exit;
}
if (!isset($_SESSION['userLogin']) && !isset($_SESSION['isLogged']))
{
header('location: index.php');
exit;
}
?>
<!doctype html>
<html>
<head>
<meta itemprop="image" content="mainlogo_title.png">
<title>SEA TURTLE NEST MONITORING RECORD</title>
<link rel="shortcut icon" href="mainlogo_title.png" type="image/x-icon"/>
<link rel="stylesheet" href="css/link.css" />
<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />
<script type="text/javascript" src="jquery.1.4.2.js"></script>
<script type="text/javascript" src="jsDatePick.jquery.min.1.3.js"></script>
<script type="text/javascript">
window.onload = function(){
new JsDatePick({
useMode:2,
target:"date",
dateFormat:"%d-%m-%y"
/*selectedDate:{ This is an example of what the full configuration offers.
day:5, For full documentation about these settings please see the full version of the code.
month:9,
year:2006
},
yearsRange:[1978,2020],
limitToToday:false,
cellColorScheme:"beige",
dateFormat:"%d-%m-%y",
imgPath:"img/",
weekStartDay:1*/
});
};
</script>
<style type="text/css">
<!--
-->
<style>
#Layer1 {
position:absolute;
left:100px;
top:309px;
width:744px;
height:681px;
z-index:1;
}
body {
background-color: #FFFFFF;
}
#Layer1 {
position:absolute;
left:600px;
top:1145px;
width:54px;
height:26px;
z-index:1;
}
#Layer2 {
position:absolute;
width:822px;
height:1044px;
z-index:2;
left: 241px;
top: 1245px;
}
#Layer3 {
position:absolute;
width:823px;
height:185px;
z-index:1;
}
#Layer4 {
position:absolute;
width:722px;
height:576px;
z-index:2;
left: 52px;
top: 279px;
}
#Layer5 {
position:absolute;
width:183px;
height:26px;
z-index:1;
left: 174px;
top: 1px;
}
#Layer6 {
position:absolute;
width:169px;
height:25px;
z-index:2;
top: 1px;
}
#Layer7 {
position:absolute;
width:155px;
height:32px;
z-index:3;
left: 361px;
top: 1px;
}
#Layer8 {
position:absolute;
width:200px;
height:28px;
z-index:4;
left: 523px;
top: 1px;
}
#Layer9 {
position:absolute;
width:208px;
height:23px;
z-index:5;
top: 36px;
left: 1px;
}
#Layer10 {
position:absolute;
width:350px;
height:26px;
z-index:6;
left: 367px;
top: 71px;
}
#Layer11 {
position:absolute;
width:239px;
height:24px;
z-index:7;
left: 215px;
top: 36px;
}
#Layer12 {
position:absolute;
width:360px;
height:27px;
z-index:8;
left: 1px;
top: 71px;
}
#Layer13 {
position:absolute;
width:230px;
height:29px;
z-index:9;
left: 495px;
top: 36px;
}
#Layer14 {
position:absolute;
width:200px;
height:27px;
z-index:10;
left: 115px;
top: 204px;
}
#Layer15 {
position:absolute;
width:200px;
height:29px;
z-index:11;
left: 459px;
top: 181px;
}
#Layer16 {
position:absolute;
width:200px;
height:30px;
z-index:12;
left: 70px;
top: 263px;
}
#Layer17 {
position:absolute;
width:156px;
height:29px;
z-index:13;
left: 3px;
top: 125px;
}
#Layer18 {
position:absolute;
width:200px;
height:24px;
z-index:14;
left: 377px;
top: 244px;
}
#Layer19 {
position:absolute;
width:262px;
height:25px;
z-index:15;
left: 70px;
top: 327px;
}
#Layer20 {
position:absolute;
width:200px;
height:28px;
z-index:16;
left: 298px;
top: 141px;
}
#Layer21 {
position:absolute;
width:200px;
height:24px;
z-index:17;
left: 362px;
top: 303px;
}
#Layer22 {
position:absolute;
width:200px;
height:29px;
z-index:18;
left: 344px;
top: 372px;
}
#Layer23 {
position:absolute;
width:930px;
height:815px;
z-index:3;
left: 175px;
top: 0px;
background-color: #FFFFCC;
}
#Layer24 {
position:absolute;
width:885px;
height:433px;
z-index:1;
left: 23px;
top: 320px;
}
.style6 {font-size: 12px}
.style9 {color: #FFFFFF}
.style12 {color: #CCCCCC}
.style14 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; }
.style15 {color: #333333}
#Layer25 {
position:absolute;
width:930px;
height:21px;
z-index:4;
left: 175px;
top: 816px;
background-color: #CCCCCC;
}
.style1 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000066;
}
#Layer26 {
position:absolute;
width:930px;
height:187px;
z-index:2;
}
#Layer27 {
position:absolute;
width:76px;
height:22px;
z-index:3;
left: 837px;
top: 194px;
}
.style16 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
#Layer28 {
position:absolute;
width:107px;
height:23px;
z-index:4;
left: 706px;
top: 194px;
}
.style17 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; }
#Layer29 {
position:absolute;
width:85px;
height:20px;
z-index:5;
left: 390px;
top: 194px;
}
#Layer30 {
position:absolute;
width:125px;
height:20px;
z-index:6;
left: 22px;
top: 195px;
background-color: #FFFFCC;
}
#Layer31 {
position:absolute;
width:192px;
height:20px;
z-index:7;
left: 170px;
top: 194px;
}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif}
#Layer32 {
position:absolute;
width:892px;
height:24px;
z-index:8;
left: 23px;
top: 267px;
}
.style18 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; }
.style19 {color: #003366}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
color: #000000;
text-decoration: underline;
}
a:active {
color: #000000;
text-decoration: none;
}
.style20 {color: #FF0000}
#Layer33 {
position:absolute;
width:870px;
height:25px;
z-index:5;
top: 202px;
left: 2px;
}
.style22 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16.5px; color: #003366; }
</style>
</head>
<body>
<!-- start:Wrap --><!-- end:Header -->
<!-- start:Content --><!-- end:Content -->
<!-- start:Footer -->
<p>
<!-- end:Footer -->
</div>
<!-- end:Wrap -->
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div id="Layer23">
<div id="Layer24"><form name="form" method="post" action="insert_ac.php">
<table width="874" border="0">
<tr>
<td width="106" bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Date : </span></td>
<td width="101" bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style6" style="font-family: Verdana, Arial, Helvetica, sans-serif">
<input type="date" size="12" id="date"/>
</span></td>
<td width="68" bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Species : </span></td>
<td width="132" bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style6" style="font-family: Verdana, Arial, Helvetica, sans-serif">
<select name="species" id="species" style="border:1px solid #999999">
<option value="">Select Species</option>
<option>Olive Ridley</option>
<option>Green Turtle</option>
<option>Hawksbill</option>
<option>Loggerhead</option>
<option>Leatherback</option>
</select>
</span></td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Nest Time : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="nesttime" type="text" id="nesttime" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Longitude : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="longitude" type="text" id="longitude" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">CCL : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="ccl" type="text" id="ccl" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style15"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Area : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="area" type="text" id="area" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Latitude : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="latitude" type="text" id="latitude" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">CCW : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="ccw" type="text" id="ccw" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style15"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Spot : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="spot" type="text" id="spot" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">BHT/AHT : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="bhtaht" type="text" id="bhtaht" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">WT : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="wt" type="text" id="wt" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">CS (EGG) : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="csegg" type="text" id="csecg" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">High Tide : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="hightide" type="text" id="hightide" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">CR : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="cr" type="text" id="cr" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Conservation : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="conservation" type="text" id="conservation" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Tag : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="tag" type="text" id="tag" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style15"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><div class="style22" id="Layer33">
<div align="center">ENVIRONMENTAL INFORMATION </div>
</div>
<span class="style15"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style15"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Lunerdate : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="lunerdate" type="text" id="lunerdate" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Moonlight/Dark : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="moondark" type="text" id="moondark" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Cloud : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="cloud" type="text" id="cloud" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Wind : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="wind" type="text" id="wind" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Rain : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="rain" type="text" id="rain" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style14">Remark : </span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><input name="remark" type="text" id="remark" size="15"></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style12"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style9"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style12"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style9"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style12"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
<tr>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style9"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style12"></span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"><span class="style4">
<input name="submit" type="submit" value="Submit" />
</span></td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
<td bordercolor="#FFFFCC" bgcolor="#FFFFCC"> </td>
</tr>
</table>
</form>
</div>
<div id="Layer26"><img src="bannar.png" alt="bannar_image" width="928" height="187"></div>
<div class="style16" id="Layer27">
<div align="right" class="style20"><a href="?logout">Logout</div>
</div>
<div class="style17" id="Layer28"><a href="main.php">Back to home </a></div>
<div class="style18" id="Layer32">
<div align="center" class="style19">
<div align="center">SEA TURTLE NEST MONITORING RECORD </div>
</div>
</div>
</div>
Insert_ac.php is the database connection and sql page
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="seaturtle"; // Database name
$tbl_name="entry"; // Table name
// Connect to server and select database.
mysql_connect("localhost", "root", "")or die("cannot connect");
mysql_select_db("seaturtle")or die("cannot select DB");
// Get values from form
$date=$_POST['date'];
$species=$_POST['species'];
$nesttime=$_POST['nesttime'];
$area=$_POST['area'];
$spot=$_POST['spot'];
$longitude=$_POST['longitude'];
$latitude=$_POST['latitude'];
$ccl=$_POST['ccl'];
$ccw=$_POST['ccw'];
$cr=$_POST['cr'];
$wt=$_POST['wt'];
$csecg=$_POST['csecg'];
$hightide=$_POST['hightide'];
$bhtaht=$_POST['bhtaht'];
$lunerdate=$_POST['lunerdate'];
$conservation=$_POST['conservation'];
$tag=$_POST['tag'];
$rain=$_POST['rain'];
$cloud=$_POST['cloud'];
$moondark=$_POST['moondark'];
$wind=$_POST['wind'];
$remark=$_POST['remark'];
// Insert data into mysql
$sql="INSERT INTO $tbl_name(date,species,nesttime,area,spot,longitude,latitude,ccl,ccw,cr,wt,csecg,hightide,bhtaht,lunerdate,conservation,tag,moondark,rain,cloud,wind,remark)
VALUES('$date','$species','$nesttime','$area','$spot','$longitude','$latitude','$ccl','$ccw','$cr','$wt','$csecg','$hightide','$bhtaht','$lunerdate','$conservation','$tag','$rain','$cloud','$moondark','wind','remark')";
$result=mysql_query($sql);
// if successfully insert data into database, displays message "Successful".
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='entry.php'>Back to main page</a>";
}
else {
echo "Error!!!!!!!!";
}
// close connection
mysql_close();
?>
When I click submit the database was showing the date with 0000-00-00 . need to entry full data into database.
help me to solve the problem...