Ability to post
This is HUUUUUUUGE milestone B)
This commit is contained in:
		
							parent
							
								
									f717080e8a
								
							
						
					
					
						commit
						de4cbe9ee6
					
				
					 3 changed files with 36 additions and 4 deletions
				
			
		
							
								
								
									
										14
									
								
								src/post.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/post.php
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| <?php | ||||
| if (empty($_POST) || !isset($_POST['submit'])) { | ||||
| 	die("Post canceled: no post / no submit"); | ||||
| } | ||||
| 
 | ||||
| require_once('inc/database.php'); | ||||
| $db = new DataBase(); | ||||
| $userid = $db->getAuthedUserId(); | ||||
| $persid = $_POST['persona']; // TODO: CHECK OWNERSHIP! (db schema?)
 | ||||
| if($userid) { | ||||
| 	$db->addPost($_POST['text'], $userid, $persid); | ||||
| } | ||||
| header("Location: /"); | ||||
| ?>
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue