forked from dara-berry/tellmeauserstory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstoreStory.php
27 lines (22 loc) · 1008 Bytes
/
storeStory.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
<?php
if (isset($_POST['who'])) {
$who = strip_tags($_POST['who']);
$what = strip_tags($_POST['what']);
$why = strip_tags($_POST['why']);
$story = strip_tags($_POST['type']);
$storia = addslashes("Come " . $who . ", voglio " . $what . " così " . $why . ".");
// Connecting, selecting database
$link = mysql_connect('localhost', 'battisto_UStory', 'DT;lSn5Ces{a')
or die('Could not connect: ' . mysql_error());
mysql_select_db('battisto_UserStory') or die('Could not select database');
// Performing SQL query
$query = "INSERT INTO `battisto_UserStory`.`Stories` (`id`, `who`, `what`, `why`, `storia`) VALUES (NULL,'".addslashes($who)."','".addslashes($what)."','".addslashes($why)."','".$storia."');";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
if ($result) {
echo '<h2> Storia Savata per ' . $who .'</h2>';
echo '<script type="text/javascript">
showHint("'.$who.'");
</script>';
}
}
?>