Discuz Forum admin password forgot what to do?
Today, a friend on the QQ asked me, "If the Discuz forum Administrator password forgot where to find ah from MySQL?" ”,
He's using Hostmonster's virtual mainframe.
yun~~~,
Oneself also did not use
Copy CodeThe code is as follows:
intercepts the string length. Supports Utf-8 and gb2312 encoding. If it is gb2312, first turn it into Utf-8, intercept it on the basis of utf-8 and then convert it back.function cut_string ($str, $from =1, $length =1
Here's how to use it.
For example:
Copy the Code code as follows:
function Db_connect ()//Connect to Database{@ $db =mysql_connect (' localhost ', ' root ', ' test ');if (! $db)throw new Exception (' failed to connect to database! Please try
Very good explains the difference between addslashes and mysql_real_escape_string, although many PHP coder in the country still rely on addslashes to prevent SQL injection (including me), I still recommend that you strengthen the Chinese to prevent
user-define-session-inc.php File Code:
Copy the Code code as follows:
function Mysession_open ($save _path, $session _name){@mysql_connect ("localhost", "root", "1981427")//Select the database before you need to connect to the database serverOr
The idea of uploading and downloading PHP files is similar. That is, there is one more header statement in the code.
The following is the detailed code. For reference only.
Entry file
Copy the Code code as follows:
Processing files written by PHP
For example:
Copy the Code code as follows:
$USERID = "Phper";$CookieTime = 0;Setcookie ("USERID", "$USERID", Time () + $CookieTime, "/", "btcuxiao.com");?>
You will find that after this statement is executed, there is nothing in the cookie,
A simple example is calculating the number of days to borrow, which requires PHP to calculate on a daily basis, and here are a few ways to implement this date calculation:
(1) It's easy if you have a database! If MSSQL can use a trigger! Use a
The PHP batch gets the value of the checkbox
1. Naming
2. Use
When the plan is part of a SQL instruction: if the field that participates in the control is numeric, the
if (! empty ($_post[' checkbox '))) {
$expr = Join (",", $_post[' checkbox ');
The standard code is as follows:
Copy the Code code as follows:
...?>
Short label mode (this mode needs to modify the PHP configuration to allow PHP to support the short tag mode):
Copy the Code code as follows:
...?>
Comments:
Copy
"Php_self"
The file name of the currently executing script, which is related to document root. For example, using $_server[' php_self ' in a script with a URL address of Http://www.jb51.net/test.php/foo.bar will give the result/test.php/foo.bar. The
Also have the question friend can add me qq:460634320, everybody discuss together.
:
Copy the Code code as follows:
function CreateImage ($data, $twidth, $tspace, $height) {Header ("Content-type:image/jpeg");$dataname = Array ();$datavalue =
I write a snippet of PHP code as follows:
Copy the Code code as follows:
if (test case)printEOF;ElseprintEOF;?>
If this is not possible, you need to shelf the EOF identifier:
Copy the Code code as follows:
if (test
Problem:
PHP function Date ("y-n-d h-i-s"); The output time differs from local time by 8 hours.
Solution Ideas
Beijing time is the East 8 district, may be the time zone question. But before all the problems ah, after Google found that the
Finally resolved through exploration. Documented, and by the way, a general-purpose solution was recorded. If you also encounter Xmlflash garbled situation, you can quickly check:
1. The case that there is absolutely no problem with XML:
First, the
Copy CodeThe code is as follows:
//Gets the number of days that can be used for any month function getDays ($month, $year) { switch ($month) { Case 4: Case 6: CA SE 9: Case one by one: $days = 30; break; Case 2: if ($year%4==0) { if
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