Insert session variable into MySQL database
<?php
session_start();
if(!isset($_SESSION['Username'])){
header("Location: login.php");
}
?>
$eventname=$_POST['eventname'];
$Username = $_SESSION['Username']
$sql = mysql_query("INSERT INTO tbl_name VALUES('','$eventname','{$_SESSION['Username']}')");
echo "You have been added to the event";
Comments
Post a Comment