1. Simple judgment IP address legitimacy if (! StrCMP (Sprintf ("% U", IP2long ($ IP))))), $ IP)) ECHO "IP / N"; ---- 2.Email Regular judgment EREGI ("^ [_ /. 0-9a-za-z -] @ ([0-9A-ZA-Z] [0-9A-ZA-Z_-] /.) [A-ZA -Z] {2,6} $ ", $ email); ---- 3. Examples for detecting IP addresses and Mask
---- 4. Today, I solved a huge question IPB's add user page toadduser.php seems to be submitted, resulting in always reporting the user existing when adding new users ... already depressed me 3 days Finally, I finally got, big fun! ---- 5. About the form of the form Refreshment: Why is I cleared after clicking the back button of the browser? A: This is because you use the Session_Start function in your form commit page. This function will force the current page to not be cached. The solution is to join Header ("Cache-Control: Private") after your session_start function; pay attention to your PHP program before you have any output. Supplement: There is also a session-based solution, plus session_cache_limiter (// empty form session_cache_limiter ('private "; // does not empty the form, only session_cache_limiter (' public ') ; // Do not empty the form, if you do not use session, you can usually be in session_start (); before adding session_cache_limiter; picking from phpe.net ---- 6. Quickly get file Download Head Output Header ("Content-Type: Application / X-Download"); Header ("Content-Disposition: attachment; filename = $ file_download_name;"); Header ("Accept-Ranges: Bytes"); Header ("Content-Length : $ download_size "); echo 'xxx' ....... 2004-08-19 11:50:30 ---- 7. Use the header output FTP download mode, and support breakpoints to continue one example: Header ('Pragma: public'); Header ('cache-control: no-cache, muilt-revALIDATE'); Header ('accept-ranges: bytes'); Header (' Connection: close '); Header ("Content-Type: Audio / MPEG"); Header ("Location: ftp: // Download: 1BK3L4S3K9S2@218.30.116.103/1001/ Curry Pepper / Curry Pepper.rmvb"); .. ..... 2004-10-08 13:26:45 ----