Undefine index:会话错误

时间:2015-12-02 16:08:46

标签: php session

每当有人登录pygame.init() AttributeError: 'module' object has no attribute 'init' $_SESSION['semail'];时。每当我进入个人资料页面,然后我将会话设置为像$_SESSION['username2']这样的变量 然后在错误日志中将错误记录为:

$email = $_SESSION['semail'];

我的会话在页面顶部开始:

Undefined index: semail in /home/twekr/public_html/profile.php on line 11

以下是创建错误的脚本的一小部分:

session_name('twekr');
session_start();
ob_start();

这是我设置会话的登录脚本的一小部分:

 <?php 
 session_name('twekr');
 session_start();
 ob_start();
 if(!isset($_SESSION['semail']))
 {
 header("Location:https://www.twekr.com/");
 }
 if(isset($_GET['user']))
 {
 $id = $_GET['user'];
 $user = $_SESSION['semail'];
 $userid1 = $_SESSION['username2']; 
 include_once('config/db.php');
 include_once('frnds/functions.php');
 require('config/dbsettings.php');
 $userquery= "SELECT * FROM users WHERE email='$user'";
 $userquery=$sp->query($userquery) or die($sp->error);
 $info=$userquery->fetch_object();
 $userr = $info->username;

$_SESSION['username2'] = $get['username']; $_SESSION['semail'] = $uemail; 在此处执行:

$get

0 个答案:

没有答案