// index.php session_start(); if (!isset($_SESSION['user_id'])) { header("Location: login.php"); exit(); } $user_id = $_SESSION['user_id']; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['tweet'])) { createTweet($user_id, $_POST['tweet']); } $feed = getFeed($user_id); ?> Twitter Clone