为什么中显示Notice: Undefined index: **,我上次明明显示出,保存关机后,下次打开又出现这种情况。**是我数据库查找的数据
回复讨论(解决方案)
关联键改成小写的
关联键改成小写的 你说的关联键是指数据表中的命名吗?还是查询语句还是什么别的?
摆脱您贴出出错行的代码
摆脱您贴出出错行的代码 好的, 但我觉得这样没错啊!就只是简单的引用,输出!
摆脱您贴出出错行的代码 我在别的页面已经有$_SESSION[*]的赋值了,难道真的还要$_POST[*]才可以吗?mysql_fetch_row取值赋值不行吗?
1、第8行之前有 session_start(); 吗?
2、你的 $_SESSION 数组的关联键都是小写子母,为何错误信息中有大写字母?贴错了代码?
3、session 在浏览器关闭时就失效了,更不要说是重新开机了
1、第8行之前有 session_start(); 吗?
2、你的 $_SESSION 数组的关联键都是小写子母,为何错误信息中有大写字母?贴错了代码?
3、session 在浏览器关闭时就失效了,更不要说是重新开机了 失效后,我再打开浏览器不就重启启动了吗?如果不是这样,我该怎么启动啊?是打开apache?php?mysql?,1,2点是没问题的,我都改过了,我想问题可能出在第3点!
你只给了从 $_SESSION 中取值的代码
并没有给出向 $_SESSION 赋值的代码,那么如何讨论呢?
我想问题可能出在第3点!
if(mysql_num_rows($select)==1){//当有一条合理就执行下面语句 $record = mysql_fetch_row($select); $_SESSION['emp_id'] = $record[0]; //获取用户编号 $_SESSION['emp_acco'] = $_POST['name']; $_SESSION['emp_name'] = $record[3]; $_SESSION['department'] = $record[4];这是赋值代码!
这段代码前也需要有 session_start();
赋值是有条件的,所以不合条件 $_SESSION 就不会有值
在赋值页面和取值页面操作最前面都加上session_start();表示要操作session了,否则不生效的,同时确保你的保存和取值的键是相同的。

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Mac version
God-level code editing software (SublimeText3)

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
