[solved] forgot session_start
Posted: Tue Jul 03, 2007 12:12 pm
Hi
I want to insert the posted article into database plus the username of sender using this code:
But it says:
Notice: Undefined variable: _SESSION in g:\programs(2)\easyphp1-8\www\ha\previous\new folder\another\htdocs\sendarticle.php on line 6
and the username is not sent. why is is not working?
I want to insert the posted article into database plus the username of sender using this code:
Code: Select all
<?php
$title = $_POST['title'];
$subject = $_POST['subject'];
$article =$_POST['article'];
$username =$_SESSION['username'];
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("articles") or die(mysql_error());
mysql_query("INSERT INTO articles (subject, title, text ,username ) VALUES('$subject','$title','$article','$username' )")
or die(mysql_error());
mysql_close();
?>Notice: Undefined variable: _SESSION in g:\programs(2)\easyphp1-8\www\ha\previous\new folder\another\htdocs\sendarticle.php on line 6
and the username is not sent. why is is not working?