Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
u2_progc [2011-01-19 19:37]
Joakim Forsgren
u2_progc [2011-01-20 13:03]
Joakim Forsgren
Line 33: Line 33:
 </php> </php>
  
 +<code php>
 +if($_POST['a']=='InsertItem') {
 + if (!$_POST['Item']) {
 + $session->AddError('You can\'t post empty item...');
 + header ('location: ' . INDEX . '?c=' . $_GET['c'] . '&a=' . $_GET['a']);
 + exit();
 + }
 + $data = array (
 + 'Item' => $_POST['Item'],
 + 'UserID' => $session->Get('UserID'),
 + 'ThreadID' => $_POST['ThreadID'] ,
 + 'CreateDate' => date('Y-m-j H:i:s'),
 + 'ChangeDate' => date('Y-m-j H:i:s')
 + );
 + $forum->InsertItem($data);
 + $session->AddSuccess('Item saved!');
 + header ('location: ' . INDEX . '?c=' . $_GET['c'] . '&a=' . $_GET['a'] . '&id=' . $_POST['ThreadID']);
 + exit();
 +}
 +</code>