The example in this article describes the solution to invalid PHP session verification. Share it with everyone for your reference. The specific method is as follows:
1. Problem
I spent a long time configuring the apache+php environment today. Later, I succeeded, but I found that the verification code image could be generated. During the login verification, I found that the session was empty and had no value.
2. Solution
Environment: apache+php
The program code is as follows:
<input name="username" type="text" class="input" id="username"> <input name="password" type="password" class="input" id="password"> <input name="ver" type="text" class="input1" id="ver" size="5"> <img src="/static/imghwm/default1.png" data-src="../inc/ver.php" class="lazy" onclick="this.src='../inc/ver.php';" / alt="Solution to invalid php session verification" >
Process the file after submission. This post.php file
if($_SESSION['ssioner']!=$ssever){ echo("<script>alert('验证码必须由4位数字组成!');history.back();</script>");exit; }
It turns out that it keeps prompting that the verification code must consist of 4 digits, and then prints it out. session:
echo $_SESSION['ssioner']; exit;
has always been empty, so I thought of a session file directory configured in the php environment. Now we find the php.ini configuration file and find
upload_tmp_dir
and find that this directory is
upload_tmp_dir="D:www.php. cntp"
I checked my D drive and found that there was only the www.php.cn file but no tp directory, so the problem was found. So I created a tp directory, restarted apache and found that there was the sess_i40gl0p4hfep5r69j67o1k26d01 file in the tp directory, so Logged in again and found success.
I hope this article will be helpful to everyone’s PHP programming design.
For more articles related to solutions to invalid PHP session verification, please pay attention to the PHP Chinese website!

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

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

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

SublimeText3 English version
Recommended: Win version, supports code prompts!
