我成功创建了会话,它适用于所有页面,但是当执行以下页面时,它不显示任何会话变量并再次要求登录..
这是代码:
if(!session_id())
session_start();
$con = mysql_connect("0.0.0.0 ","db_name","pwd");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db_name", $con);
if($_GET['rating']=='like')
{
$rcount = $_GET['rcount'] + 1;
$id= $_GET['id'];
mysql_query("UPDATE networx_notes SET up='$rcount' WHERE id='$id' ");
header( 'Location: http://adrress.com/somewhere.php' ) ;
}