search
HomeBackend DevelopmentPHP TutorialA complete collection of messages recorded by classmates Xinglin's classmates recorded one

Main features:
php+mysql, session page protection, private message function, photo upload, online modification of information, email query and automatic reply, guest mode,
Convenient class management
Program list:
Configuration part:
Configuration file: class/ config.php Database file: class/mysql.txt Counter file: class/counter.txt
Main program:
Login home page: index.php Member home page: main.php Guest home page: class/guest.php
Personal management:
Class Address book: class/address.php Profile modification: class/modify.php Upload photo: class/uploadphoto.php
Password query: class/querypsw.php Private message: privatenote.php
Registration section:
Registration step 1: class/ register_step1.php Registration step 2: class/register_step2.php
Photo section:
Class photo: class/classphoto.php School photo: class/schoolphoto.php Personal photo: class/privatephoto.php
Guestbook section:
Class members’ messages Book: Display message: class/notebook/index.php Add message: class/notebook/addnote.php
Guest guest book: Display message: class/notebookg/index.php Add message: class/notebookg/addnote.php
Class management Parts:
Home page: superadmin.php Add members: class/admin/addmember.php Display and delete members: class/admin/member.php
Modify member information: class/admin/editmember.php Modify member information Step 2: class/ admin/editmember_step2.php
Class member guestbook management: class/notebook/delnote.php Guest guestbook management: class/notebookg/delnote.php
Others:
Help file: readme.txt Picture: class/image
Notes:
1. First modify the configuration file config.php and then upload it, and create a database according to the content of mysql.txt.
2. Change the attribute of counter.txt to 777 when uploading
3. The photo upload program cannot be implemented in some homepage spaces. Please try 51.net, and be sure to keep the class/upload/image directory.
4. When debugging on this machine, the mail() function may make an error. Just ignore it and upload it to the server.
5. Due to the rush of time and considering that it is not easy to upload photos on the personal homepage, please modify the class photos, personal photos and other pages yourself.
6. I am new to PHP and the program needs to be further improved. This program is for reference only.
Program example: http://medguider.host.wayall.com/
Contact information: webmaster@medguider.51.net
Because there are too many program codes, only some important codes are posted here.完整程序请到我的主页下载:http://www.medguider.com
配置部分:
数据库文件:class/mysql.txt
create table user (id char(2),user char(12),psw char(8),name char(8),sex char(2),birth char(10),work varchar(50),ad varchar(50),post char(6),ph varchar(30),bp varchar(20),email varchar(35),oicq char(12),photo varchar(255),account varchar(255),count int(4) default '1',signature varchar(255),face int(2));
//成员资料表 id 记录号 user 用户名 psw 密码 name 姓名 sex 性别 birth 生日 work 工作单位 ad 通讯地址 post 邮编 ph 电话 bp 传呼 email 电子信箱 oicq oicq count 计数默认值为1
photo 个人照片 account 个人说明 signature 个人签名 face 头像(default=1)
create table notebook (user char(12),time char(30),ip varchar(16),title varchar(255),nnote text);
//班级成员留言簿 user 用户名 time 时间 ip title 标题 nnote 内容
create table notebookg (name char(8),email varchar(35),time char(30),face char(2),ip varchar(16),title varchar(255),nnote text);
//访客留言簿 name 姓名 email time 时间 face 头像 ip title 标题 nnote 内容
create table privatenote (id char(10),fromuser char(12),touser char(12),time char(30),message text,look char(1) default '0');
//悄悄话 id 记录号 fromuser 发消息人姓名 touser 接受人用户名  time 发出时间 message 信息 look 是否看过,默认值为0
配置文件:class/config.php
$sitename="杏林同学录";                 //站点名
$url="http://medguider.host.wayall.com/";           //站点url
$db = mysql_connect("localhost", "root");//这里改为您的mysql用户名密码
mysql_select_db("test",$db);
$supervisor="demo";                      //超级管理员名
$superpsw="demo";                      //超级管理员密码
$superemail="demo@demo.com";//超级管理员email
$questi//注册提示问题1
$answer1="demo";                        //注册提示答案1
$questi//注册提示问题2
$answer2="demo";                        //注册提示答案2
?>
主程序:
  登陆首页:index.php


班级成员登录

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How can you protect against Cross-Site Scripting (XSS) attacks related to sessions?How can you protect against Cross-Site Scripting (XSS) attacks related to sessions?Apr 23, 2025 am 12:16 AM

To protect the application from session-related XSS attacks, the following measures are required: 1. Set the HttpOnly and Secure flags to protect the session cookies. 2. Export codes for all user inputs. 3. Implement content security policy (CSP) to limit script sources. Through these policies, session-related XSS attacks can be effectively protected and user data can be ensured.

How can you optimize PHP session performance?How can you optimize PHP session performance?Apr 23, 2025 am 12:13 AM

Methods to optimize PHP session performance include: 1. Delay session start, 2. Use database to store sessions, 3. Compress session data, 4. Manage session life cycle, and 5. Implement session sharing. These strategies can significantly improve the efficiency of applications in high concurrency environments.

What is the session.gc_maxlifetime configuration setting?What is the session.gc_maxlifetime configuration setting?Apr 23, 2025 am 12:10 AM

Thesession.gc_maxlifetimesettinginPHPdeterminesthelifespanofsessiondata,setinseconds.1)It'sconfiguredinphp.iniorviaini_set().2)Abalanceisneededtoavoidperformanceissuesandunexpectedlogouts.3)PHP'sgarbagecollectionisprobabilistic,influencedbygc_probabi

How do you configure the session name in PHP?How do you configure the session name in PHP?Apr 23, 2025 am 12:08 AM

In PHP, you can use the session_name() function to configure the session name. The specific steps are as follows: 1. Use the session_name() function to set the session name, such as session_name("my_session"). 2. After setting the session name, call session_start() to start the session. Configuring session names can avoid session data conflicts between multiple applications and enhance security, but pay attention to the uniqueness, security, length and setting timing of session names.

How often should you regenerate session IDs?How often should you regenerate session IDs?Apr 23, 2025 am 12:03 AM

The session ID should be regenerated regularly at login, before sensitive operations, and every 30 minutes. 1. Regenerate the session ID when logging in to prevent session fixed attacks. 2. Regenerate before sensitive operations to improve safety. 3. Regular regeneration reduces long-term utilization risks, but the user experience needs to be weighed.

How do you set the session cookie parameters in PHP?How do you set the session cookie parameters in PHP?Apr 22, 2025 pm 05:33 PM

Setting session cookie parameters in PHP can be achieved through the session_set_cookie_params() function. 1) Use this function to set parameters, such as expiration time, path, domain name, security flag, etc.; 2) Call session_start() to make the parameters take effect; 3) Dynamically adjust parameters according to needs, such as user login status; 4) Pay attention to setting secure and httponly flags to improve security.

What is the main purpose of using sessions in PHP?What is the main purpose of using sessions in PHP?Apr 22, 2025 pm 05:25 PM

The main purpose of using sessions in PHP is to maintain the status of the user between different pages. 1) The session is started through the session_start() function, creating a unique session ID and storing it in the user cookie. 2) Session data is saved on the server, allowing data to be passed between different requests, such as login status and shopping cart content.

How can you share sessions across subdomains?How can you share sessions across subdomains?Apr 22, 2025 pm 05:21 PM

How to share a session between subdomains? Implemented by setting session cookies for common domain names. 1. Set the domain of the session cookie to .example.com on the server side. 2. Choose the appropriate session storage method, such as memory, database or distributed cache. 3. Pass the session ID through cookies, and the server retrieves and updates the session data based on the ID.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function