forked from ssaamm/buoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewBuoy.php
19 lines (18 loc) · 951 Bytes
/
newBuoy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?
include('config.php');
if (isset($_POST['submitted'])) {
foreach($_POST AS $key => $value) { $_POST[$key] = mysql_real_escape_string($value); }
$sql = "INSERT INTO `buoy` ( `name` , `latitude` , `longitude` , `elevation` , `depth` ) VALUES( '{$_POST['name']}' , '{$_POST['latitude']}' , '{$_POST['longitude']}' , '{$_POST['elevation']}' , '{$_POST['depth']}' ) ";
mysql_query($sql) or die(mysql_error());
echo "Added row.<br />";
echo "<a href='listBuoy.php'>Back To Listing</a>";
}
?>
<form action='' method='POST'>
<p><b>Name:</b><br /><textarea name='name'></textarea>
<p><b>Latitude:</b><br /><input type='text' name='latitude'/>
<p><b>Longitude:</b><br /><input type='text' name='longitude'/>
<p><b>Elevation:</b><br /><input type='text' name='elevation'/>
<p><b>Depth:</b><br /><input type='text' name='depth'/>
<p><input type='submit' value='Add Row' /><input type='hidden' value='1' name='submitted' />
</form>