On the previous page I began to explain the importance of object-oriented and how to create a basic object. We will finalize a lot of details here and now.class variables and visibilityIn class, we first determine our variables. In this case, our
Introduction
This tutorial is just a dirty one and explains how to use the Include () function to make your PHP code life easier to write. Basically include () functions including files placed in parentheses within the main argument of the document.
It's okay to use Php+txt now realize a website counter program, the code we mainly use File_get_content and Fopen,fwrite read and write on the OK.
Class sit_count{Public $FileName = ' count.txt ';function Count_add () {if (file_exists
Okay, now let's look at the program code for the login.php file.
Session_Start ();Include ("global.php");if (isset ($_post[' username ')) && isset ($_post[' pwd ']){$result = mysql_query ("SELECT * from Xx_admin");if ($info = mysql_fetch_array
if ($submit){if ($chkme){printf ("You have selected checkbox");}Else{printf ("You did not select a CheckBox");}}Else{?> Test Submission " method=post> Choose Me}?>
JavaScript form validation is Chinese, determines whether an input is Chinese and is implemented through regular expressions.Check to see if it is Chinese
function Ischn (str) {
var reg =/^[u4e00-u9fa5]+$/;
if (!reg.test (str)) {
return false;
Filesize(PHP 4 and PHP 5)Filesize-get the file sizeDescriptionInternational filesize (string $ file name)Obtain the file of the specified size.ParametersFile nameFile path.Return valueThe size of the returned file is in bytes, or FALSE (and the
Chgrp(PHP 4 and PHP 5)Chgrp-change the file GroupDescriptionBoolean chgrp (string $ file name, mixed $ group)Filename Group of the archive that attempts to change the group.Only the Supervisor can change any file in the group. Other users may change
$ Link_id = mysql_connect ("localhist", "root", "qwaszx") or die ("connection failed! ");If ($ link_id){Mysql_select_db ("my_test ");If (! $ _ GET [id]) {$ Result = mysql_query ("select * from userinfo ");Echo " No. user name Gender age
Definition and usageTheStrpos() Position returned by the function. For the first time, a series of other internal strings appear.If the string is not found, this function returns FALSE.SyntaxStrpos (string, find,
Definition and usageThe str_shuffle () function randomly shuffles all character strings.SyntaxStr_shuffle (string)ParameterDescriptionStringString required. Specify string shufflingLet's take a look at the str_shuffle function tutorial. Output
PHP tmpfile () function example tutorialDefinition and usageThe tmpfile () function creates a unique name read/write (watt +) mode in a temporary file.SyntaxTmpfile ()Note: when a temporary file is automatically deleted, fclose () is disabled, or
PHP array_push () function example tutorial and usageDefinition and usageThis array_push () function inserts an array at the end of one or more elements.SyntaxArray_push (array, value1, value2 ...)Parameter descriptionArray required. Specify an
Php file_get_contents function,This function is used to read the content of the remote server file, which greatly facilitates the collection of friends. You can save the remote server file to your own database with a simple sentence, you can't
After the PHP function tempnam () is disabled, tempnam () can create a temporary file, and the file name will not be overwritten with the file in the same directory.The returned string is the temporary file name. If an error occurs, an empty string
About imagickImagick, which can be used by PHP to call the PHP extension of the ImageMagick function. With this extension, PHP can have the same functions as ImageMagick. You can use the APIs provided by ImageMagick to create and modify images.
The code is as follows:Copy code php file Upload Foreach ($ _ files as $ f){// Process the Chinese nameIf (function_exists ("iconv") $ f [name] = iconv ("UTF-8", "gb2312", $ f [name]);$ Unm = intval (mt_rand (1000,9999 ));$ File = "z_upload/".
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