Home > Article > Backend Development > First introduction to PHP, first introduction to educational technology_PHP tutorial
1. In PHP, global variables must be capitalized;
2. In the PHP form submission method, the method attribute sets the method of obtaining and submitting data;
3. If the upload element is used in the form, then add attributes to the form: enctype="multipart/form-data";
4. Implementation of user logout function:
Delete multiple sessions: $_SESSION=array();
Traversing objects in 5.php:
6.php contains files: include("file path");
7. How to embed js script in HTML page:
8. Reference JS files in php dynamic pages:
9. Solve the problem that the browser does not support JavaScript:
a. Enable JavaScript support in IE browser;
b. Enable IE browser’s support for local JavaScript;
c. Use comment symbols to verify whether the browser supports JavaScript script function;
d. Use the tag to verify whether the browser supports JavaScript scripts.
10. In php, the processing mechanisms of single quotes and double quotes are different. Their differences:
The contents of double quotes can be interpreted and replaced, while the contents of single quotes are treated as ordinary characters. Such as:
condb.php
$con = mysql_connect("localhost","root","123456");
if (!$con) {
die("Query is failed :" . mysql_error());
}
mysql_select_db("login_schema");
mysql_query("set names 'utf8'");
?>
login.php
session_start();
if (isset($_SESSION['errorMsg']) && $_SESSION['errorStatic'] == 1){
echo "" . $_SESSION['errorMsg'] . "";
}else{
unset($_SESSION['errorStatic']);
}
?>