Summary of recent work (unfinished)

2010-09-20  来源:本站原创  分类:PHP  人气:115 

- Apache
SetEnv HOME "/ usr / local / home"
SetEnv PHP_ENV "DEV"
--- Php
$ Home = getenv ('HOME');
switch (getenv ('PHP_ENV'))
(

case 'RLS':
require 'config_release.inc.php';
break;

case 'TEST':
require 'config_test.inc.php';
break;

case 'DEV':
require 'config_dev.inc.php';
break;
)

================================================= Php . ini disable_functions to disable php function

disable_functions = phpinfo, exec, passthru, shell_exec, system, proc_open, popen, curl_exec, curl_multi_exec, parse_ini_fil

allow_url_fopen = ON server and the administrator will often cause trouble, but regular (at least I think so) is something we need to remotely read, if you set allow_url_fopen = OFF to turn it off, we have no way to remotely read.

Fortunately, we have a very good PHP module - curl. Here I talk about an example I use the curl method of the remote read:
First, allow_url_fopen = ON in the case:
$ Str = file_get_contents ("http://www.csdn.net/");
if ($ str! == false) (
/ / Do something with the content
echo $ str;
)
?>

Second, allow_url_fopen = Off circumstances:
$ Ch = curl_init ("http://www.csdn.net/");
curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);
$ Str = curl_exec ($ ch);
if ($ str! == false) (
/ / Do something with the content
echo $ str;
)
curl_close ($ ch);
?>

---- Direct use memcache for session to deal with I wrote a series of memcache to store the session of the code, accidentally discovered that can be directly set in the php.ini to use memcache as a session handle, without additional coding method is:
Modify the php.ini in the following values
session.save_handler = memcache
session.save_path = 'tcp: / / host1: 11211' # have more than one time directly, "" can be separated in a specific application if just want to use the memcache store session, you can use the ini_set method on these two parameters set

================================================== ====== php.ini session memcache

Session of the function to achieve basically through
* Set the client's Cookie to save SessionID,
* Then the user's data stored on the server side, and finally through
* Cookie in the Session Id to determine whether a data user,

Original
session.save_handler = files

memcache:

session.save_handler = memcache

session.save_path = "tcp: / / 192.168.0.26:13001, tcp: / / 192.168.0.26:13002"

session.use_cookies = 1

--------------- PHP function empty isset () only for variables, arrays, can not be empty (function)

Which can act on the function intval

Error: if (isset (func:: post ('action')))

Use the unset () the release of the variable, it will no longer be isset ().
PHP function isset () only for the variable, pass any other parameters will result in parsing error.
Test whether the constant is set to use defined () function.

if (empty (trim ($ _POST ["content "]))){

)

Error Can't use function return value in write context

If you remove the trim, then no problem

If empty, then no problem to remove

As empty in the parameter is a variable, the result is a string trim

---------------

var_dump (in_array ('1 and 123123 = 1233311 ', array (1,2,3,4,5)));

Output

bool (true)
/////////////////////////////////
var_dump (in_array ('1 and 123123 = 1233311 ', array ('1', '2 ', '3', '4 ', '5')));

Output

bool (false)

相关文章
  • Summary of recent work (unfinished) 2010-09-20

    - Apache SetEnv HOME "/ usr / local / home" SetEnv PHP_ENV "DEV" --- Php $ Home = getenv ('HOME'); switch (getenv ('PHP_ENV')) ( case 'RLS': require 'config_release.inc.php'; break; case 'TEST': require 'config_test.inc.php'; break; ca

  • Summary of recent use oracle 2011-01-25

    1: Check the sql execution plan explain plan for sql Then run select * from table (dbms_xplan.display ()); Such as explain plan for select rownum no, id, name from product_group order by name Then run select * from table (dbms_xplan.display ()); Outp

  • windows 7 PowerShell notes 2010-05-07

    Summary of recent own powershell Start powershell # String Manipulation Object Manipulation "hello".Length # Process operation PS C:\> notepad PS C:\> $process=get-process notepad PS C:\> $process.Kill() # Default object operation PS C:

  • How heterogeneous database synchronization (Part I) 2011-07-25

    1, a summary of recent progress while I accomplish the same function of two simultaneous heterogeneous database systems work, there are some feelings and experiences to share to you, welcome to technical colleagues Paizhuan. The project has a number

  • In recent years programming experience summary 2010-07-01

    Are a bit ridiculous, in nearly eight years. Net development, has never been specifically written summary of their own, from last October to work as java project has been committed to Ext + SSH application development framework that is in development

  • A recent two Java / JVM share summary 2010-09-17

    This month the first Friday and today were made plays Java / JVM sharing. Did not do new presentations, and presentations before the giant has accumulated too bloated, not suitable for use to do presentations. These two are the only simple strung thi

  • Recent ext project summary 2010-07-20

    Ext Js 2.2 + Spring 2.5, not using struts, hibernate 1) directory structure a) js part Established under the root directory / js / ext / directory, containing all relevant js file and ext. / Js / ext / directory can establish the relevant subdirector

  • A recent summary of outer chain 2010-07-24

    Many people do SEO "content is king, outside the chain for the Emperor", but the content is really hard to do, but also involved a lot of rich content sites tend to rank very simple Zuo. (For SEO and for the pseudo-original content do not), but

  • In recent days, and set up MySql connection problems summary 2011-04-26

    1.mysql default installation file in C: \ Program Files \ MySQL \ MySQL Server 5.0 When a computer is not the first time to build on the start service when the problem need not be 360 ​​uninstall, the uninstall not ordinary, because it involves a reg

  • On a small summary of python in the class 1 2010-12-06

    Small summary on the class: First, what is the class? class Name ( Parent class name, not the parent class wrote object): pass Second, what is the method? Function is defined inside the class methods, such as: class Name ( Parent class name, not the

  • Mantis maintenance project summary 2009-04-18

    Maintaining the company's recent Mantis, done several times before adjustment, are different, this project obviously nervous than ever. Projects, but in the small projects I learned a lot through it I can clearly feel an even bigger "under high press

  • Summary of learning J2EE 2009-07-22

    Summary of learning J2EE J2EE learning for some time, today javaEye sum up, when we look back to learn some things themselves, while summing up the work must be under the hope of learning java from a friend there. Technology-related (and more time to

  • J2ME experience summary of the Proguard confused overflow 2010-03-29

    J2ME experience summary of the Proguard confused overflow by: hunhun1981 From: http://blog.csdn.net/hunhun1981/ I believe most J2ME developers are using this open source Proguard Obfuscator. However, in previous projects, they have discovered one of

  • Java MD5 encryption generated summary 2010-03-29

    Recent projects just need to use something a bit encryption, java security library provides a class java.security.MessageDigest This MessageDigest class provides applications with message digest algorithm features, such as MD5 or SHA algorithm. Messa

  • JSTL Learning Summary 2009-05-03

    JSTL There are plenty of easy to overlook areas of study Summary: 1 FOREACH Learning: <c:forEach items="${ personList }" var="person"> <tr> <td> $ (person.id) </ td> </ tr> ........ </ c: forEach> In

  • CAS (single sign) --- A Summary 2010-03-27

    Single sign-on (sso) is based on user / session authentication in a process, users simply provide a one-time certificate (only one log), you can access multiple applications. 1, the most recent system integration company, the company decided to use y

  • [Summary] CSS greater transparency of the aggregate 2010-04-02

    In recent years, CSS opaque considered as a very popular technology, but on cross-browser support, for developers, can be said to be a cause for headache. There is no one universal way to ensure transparency setting can be used in all current browser

  • oracle ranks conversion summary (reproduced) 2010-03-31

    oracle sum up the ranks of conversion Recent Forum raised the issue many people have a relationship with the ranks of conversion, so I converted the ranks of knowledge made a summary Hope to be helpful, while thinning the wrong place, I implore you t

  • Oracle ranks Conversion Summary 2010-04-19

    oracle sum up the ranks of conversion Recent Forum raised the issue many people have a relationship with the ranks of conversion, so I converted the ranks of knowledge made a summary Hope to be helpful, while thinning the wrong place, I implore you t

  • Sql optimization of large-scale systems development summary (change) 2010-04-20

    Problem Description: 1. The structure of each table and the primary key index case 2. Each table count (*) records the number of 3. To create an index of the column, the index of the type that? count (distinct indexcol) What is the value? 4. The last