search
Homephp教程php手册php表单提交至数据库

php表单提交至数据库

Jun 06, 2016 pm 07:52 PM
linuxphpsubmitdatabaseCommunityformEnter

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 一、php配置MySQL 1、将php安装目录下的php_mysql.dll和MySQL安装目录下的libmysql.dll文件拷贝至c:/windows/system32中; 2、配置php.ini extension=php_gd2.dll extension=php_mbstring.dll extens

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  一、php配置MySQL

  1、将php安装目录下的php_mysql.dll和MySQL安装目录下的libmysql.dll文件拷贝至c:/windows/system32中;

  2、配置php.ini

  extension=php_gd2.dll

  extension=php_mbstring.dll

  extension=php_mysql.dll

  extension=php_mysqli.dll

  把上面四个。dll的最前面的;去掉

  二、php表单提交至数据库的实现过程

  1、login.php页面

  

  

  Name:

  Email:

  

  

  

  2、add.php页面

  

  include("conn.php");

  ?>

  

  if(isset($_POST["submit"]))

  {

  $sql = "insert into users(username, email) values('$_POST[username]', '$_POST[email]')";

  mysqli_query($conn, $sql);

  echo "添加成功";

  }

  ?>

  3、conn.php页面

  

  $conn = new mysqli("localhost", "root", "159357");

  $conn->select_db("db_test");

  //mysql_query("set name 'gb2312'");

  $conn->set_charset("utf8");

  ?>

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

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 Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

DVWA

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

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools