Hello i am trying to extend gtdphp to make it more complete for my own daily usage.
I am making changes on top of the orginal 0.9 code.
However i am having some problems with a simple INSERT query... I can't figure out how you guys make it work.
I want to make a quick add section where a user can just simple enter an inbox item from everywhere in the application.
So i need to send the title into {prefix}items and the type into {prefix}itemstatus
This is what i have, but i can't figure out how to make the db_connection and the post in db stuff work...
<div id="header">
<h1 id='sitename'><a href='index.php'><?php
echo $_SESSION['config']['title'];
?></a><?php
echo ' ',(isset($titlefull))?$titlefull:$title;
?></h1>
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
// $inboxitem=$_POST[inboxitem];
$sql = "INSERT INTO gtdphp_items (title)
VALUES('".mysq_real_escape_string($_POST['inboxitem'])."')";
/* for second table post $sql2="INSERT into tabel_anders(achternaam,tussenv,voornaam,geb_datum) VALUES ('i')"; */
/* $sql="INSERT INTO `gtdphp_items`
(`title`,`description`,`desiredOutcome`,`recurdesc`,`recur`)
VALUES ('{$values['title']}','{$values['description']}',
'{$values['desiredOutcome']}',
'{$values['recurdesc']}','{$values['recur']}')"; */
$res = mysql_query($sql,connectdb($config));
/* $res2 = mysql_query($sql2); */
if(!$res)
{
echo("Something went wrong with the query: ".mysql_error($connection)." (".$sql.")");
}
else
{
echo "Item Added<hr>";
}
}
?>
<form action="" method="post" name="quickaddinbox">
Quick add: <input type="text" name="inboxitem" />
<input type="button" name="add" value="add" />
</form>
</div>
I hope someone can help me out a bit! When i figure this out i am all good

Another question, my shortcut keys don't work. Alteast not in Chrome, didn't try another browser yet. Any else has this problem or a solution for this?