<?php
include_once 'includes.php';
if(isset($_SESSION["uid"]))
{
	$setLogged=mysql_query("UPDATE users SET last_login='".time()."'WHERE uid='".$_SESSION["uid"]."'") or die(mysql_error());
}
if(isSet($_POST['update'])) {
	 //Who can see this message
	$secret_option=mysql_real_escape_string($_POST['secret_option']);
	// Updating text
	$update=mysql_real_escape_string($_POST['update']);
	$hashtags = hashtag($update);
	$p_mention = mention($update);
	 // Insert message from data
	$data=$Mat->Insert_Text_Update($uid,$update,$secret_option, $hashtags,$p_mention); 
	if($data) {
		// Show the post
		include("html_posts.php");
	}
}
?>