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
Previous revision
Next revision Both sides next revision
u2_progc [2011-01-19 19:35]
Joakim Forsgren
u2_progc [2011-01-20 13:03]
Joakim Forsgren
Line 25: Line 25:
 echo "<hr>"; echo "<hr>";
 highlight_file('../../code/mvc2/classes/service/session.php'); highlight_file('../../code/mvc2/classes/service/session.php');
-echo "<hr>";+echo "<hr>index.php<br>";
 highlight_file('../../code/mvc2/htdocs/index.php'); highlight_file('../../code/mvc2/htdocs/index.php');
-echo "<hr>";+echo "<hr>setup.php<br>";
 highlight_file('../../code/mvc2/include/setup.php'); highlight_file('../../code/mvc2/include/setup.php');
  
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>