Home Backend Development PHP Tutorial php登录思路有关问题

php登录思路有关问题

Jun 13, 2016 am 10:07 AM
mysql php session

php登录思路问题
想了半天,没结果,求思路

问题如下:
现在想做一个PHP+mysql的聊天室,要先登录才能进入聊天室,
一张表记录用户的注册信息
一张表记录用户的发言信息


现在的问题是怎么输出带用户名的发言

现在只能输出发言,因为发言后先记录到数据库然后从数据库输出,
不知道怎么输出带用户名的发言,
想实现的方式就是 用户名+发言
不知道用户名和发言用什么方式联系在一起。

就像很多网站登录后输出评论就是带用户名的,不知道咋实现,求思路。。

------解决方案--------------------
...这有什么思路?登录后用户名保存在session.
输出的时候加上 $_SESSION['UserName']; 不就行了?

Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

How to fix mysql_native_password not loaded errors on MySQL 8.4

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

See all articles