emediastudios Posted December 16, 2008 Share Posted December 16, 2008 Hi everyone I have this code that i want to only run if the session is registered. <?php include_once('includes/include.php'); $themename=$_POST['themename']; $query = "INSERT INTO theme SET themename='$themename'"; $result = mysql_query($query) or die(mysql_error()); header("Location: admin.php"); ?> what code would i put at the top of the file to stop anyone running this script, sorry but im a newbe. Link to comment https://forums.phpfreaks.com/topic/137129-solved-session/ Share on other sites More sharing options...
peranha Posted December 16, 2008 Share Posted December 16, 2008 <?php if (isset($_SESSION['session_name_here'])) { // Code to be run here } ?> Link to comment https://forums.phpfreaks.com/topic/137129-solved-session/#findComment-716302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.