PHP and MySQL novice to do Web site (backstage) How to pass a form data

Source: Internet
Author: User
Tags php and mysql

My introductory book is PHP and MySQL Web development from Novice to Master (5th edition), This book is very good, code style I also like.

1. Software in use

XAMPP N-In-place software (MySQL, php, Apache, etc.) Installation: Very simple, download can be used, no need to configure the environment and so on, get started quickly. If you encounter MySQL or Apache boot failure, and prompt port blocking and so on. Click Config to change the port inside, PHP is the scripting language, is to the Web server recognized language, so not directly open with the browser, but through the Apache Web server so the correct open posture is in the browser address bar input http://localhost/xx.php (if you have already launched Apache and this PHP file is to be placed in the HTDOCs folder in the XAMPP directory );

2. Start with the simplest login page. Account password, these two are forms, the properties of the form have action and method, etc., action= "xxx.php" (the target page is the thing to do after clicking login) method = "POST", if the form entered for post then the information will be the default $_post [‘???’] (??? is the name of the form);

Sample code

<!--login.html Simple Form Codes -<!DOCTYPE HTML><HTML><Head><MetaCharSet= "UTF-8"><title>Insert Title here</title></Head><Body><formAction= "login.php"Method= "POST">        <b>School Number:</b> <inputname= "id"type= "text"  />        <b>Password:</b> <inputname= "Password"type= "Password"  />        <inputname= "Submit"type= "Submit"value= "Submit"/></form></Body></HTML>

1<?PHP2     #Simple login.php file3     4     if(isset($_post[' ID ']) &&isset($_post[' Password ']))5     {6         Echo"The ID you entered is:".$_post[' ID '];7         Echo"The password you entered is:".$_post[' Password '];8}

After clicking Submit:

PHP and MySQL novice to do Web site (backstage) How to pass a form data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.