-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmitfact.php
More file actions
40 lines (35 loc) · 850 Bytes
/
submitfact.php
File metadata and controls
40 lines (35 loc) · 850 Bytes
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
<?php
include('header.php');
include('config.php');
$sourcepage = $_POST["sourcepage"];
$facttext = $_POST["facttext"];
$lat = (double) $_POST["latitude"];
$lng = (double) $_POST["longitude"];
$address = $_POST["address"];
$source = str_replace(" ", "_", $sourcepage);
$fact = str_replace("\\", "", $facttext);
$fact = str_ireplace($sourcepage, "<strong>".$sourcepage."</strong>", $fact);
?>
<?php
$query = "INSERT INTO `wikitour` (
`fact` ,
`source` ,
`lat` ,
`long`,
`address`
)
VALUES (
'$fact', '$source', '$lat', '$lng', '$address'
)";
$result = mysql_query($query);
if ($result) {
echo "<p>Thanks! Your fact has been added.</p>";
}
else {
echo "<p>Something went wrong. Sorry!</p>";
}
?>
<div class="navbutton">
<a href="index.php"><button>Home</button></a>
</div>
<?php include('footer.php'); ?>