-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrgInsert.php
48 lines (39 loc) · 1.09 KB
/
OrgInsert.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
$title ='Organization Insert';
include 'header.php';
include 'DBHelper.php';
include "db_queries.php";
header( "refresh:2;url=Organizations.php" );
// Check if the form is submitted
if ( isset( $_POST['submit'] ) ) {
// retrieve the form data by using the element's name attributes value as key
$name = db_quote($_POST['name']);
$type = db_quote($_POST['type']);
$about = db_quote($_POST['about']);
// display the results
echo '<h3>Form POST Method</h3>';
echo 'Organization Name:' . $name . '<br />';
echo 'Organization Type:' . $type . '<br />';
echo 'About:' . $about . '<br />';
$result = db_query("INSERT INTO `woodal-db`.`swdb_organizations` "
. "(`oid` ,"
. "`name` ,"
. "`type` ,"
. "`about`)"
. " VALUES "
. "(NULL , "
. "'" . $name . "',"
. " '" . $type . "',"
. " '" . $about . "');"
);
$err = db_error();
if ($err != null) {
echo $err;
}
} else {
echo "Error receiving data from the post!";
}
?>
<script>
window.location = "Organization.php";
</script>