current FILE
?>
Example 1
The code is as follows:
Function getUrlRoot ($ url ){
# Add the header and tail
$ Url = $ url ."/";
# Determining domain names
Preg_match ("/(\ w *):\/\/)? \ W *\.? ([\ W |-] * \. (com.cn | net.cn | gov.cn | org.cn | com | net | cn | org | asia | tel | mobi | me | TV | biz | cc | name | info ))
\\// ", $ Url, $ ohurl );
# Determining IP addresses
If ($ ohurl [3] = ''){
Preg_match ("/(\ d + \.) {3} \ d +) \ //", $ url, $ ohip );
Return $ ohip [1];
}
Return $ ohurl [3];
$ _ SERVER ["HTTP_REFERER"];$ _ SERVER ['request _ URI ']; // Obtain the suffix of the current domain name$ _ SERVER ['http _ host']; // Obtain the current domain nameDirname (_ FILE _); // Obtain the physical path of the current FILEDirname (_ FILE _). "/../"; // Obtain the upper-level physical path of the current FILE?>
Example 1
The code is as follows:
Function getUrlRoot ($ url ){# Add the header and tail$ Url = $ url ."/";# Determining domain namesPreg_match ("/(\ w *):\/\/)? \ W *\.? (
*******************************************/
function Setattachments ($inAttachments) {
if (strlen (Trim ($inAttachments)) > 0) {
$this->mailattachments = $inAttachments;
return true; }
return false; }
/*********************************
function Checkemail ($inAddress): This function has been called before, mainly
To check the legality of an email address
*****************************************/
function Checkemail ($inAddress) {
Return (Ereg ("^[^@]+@" ([a
lacus EU nulla bibendum ID euismod urna sodales. "; $compressed = gzcompress ($string); echo "Original size:". Strlen ($string). " \ n "; /* Prints Original size:800 */echo "Compressed size:". Strlen ($compressed). " \ n "; /* Prints COMPRessed size:418 *///Getting it back $original = gzuncompress ($compressed);
9. Use PHP for whois checking
function Whois_query ($domain) {//fix the domain name: $domain = Strtolower (Trim ($domain)); $domain = preg_replace ('/^http:\/\//i ', ' '
on your server, // read the image file $ Gimg = new GetImage (); $ Gimg-> source = $ img; $ Gimg-> save_to = '. /data/temp/'; $ FILE = $ Gimg-> download (); // move the image to a local location // save it to the album to get the image saved $ img_path = pic_save ($ FILE, 0 ,''); // replace the text path $ message = str_replace ($ img, $ img_path, $ message );}}
... At this time, the image in $ message has been replaced with the local address of your server, and the image is saved to your serve
. you can also include multiple files and separate them with commas. the default return value is true.**************************************** ***/Function setAttachments ($ inAttachments ){If (strlen (trim ($ inAttachments)> 0 ){$ This-> mailAttachments = $ inAttachments;Return true ;}Return false ;}/*********************************Function checkEmail ($ inAddress): This function has been called before, mainlyUsed to check the validity of the email address**************************************
similar requirements on the Internet for reference only: http://www.bacysoft.cn/thread-58-1-1.html
------ Solution --------------------
You know too much ....
Discussion
Use PHP to encrypt the words that will be filtered, and decrypt them in JavaScript on the client!
There are similar requirements on the Internet for reference only: http://www.bacysoft.cn/thread-58-1-1.html
------ Solution --------------------
Obviously, he certainly does not know the number of words in the default
PHP regular expressions get domain names from URLs, read PHP regular expressions get domain names from URLs, the following code can get domain names from URLs such as http://souzz.net/html/database/oracle/69613.htmlto souzz.netfunctionget_domain ($ url) {$ pattern = "> The following code retrieves a domain name from a URL:
Example: http://souzz.net/html/database/ORACLE/69613.html
Obtain souzz.net.
Function get_domain ($ url ){$ Pattern = "/[\ w-] + \. (com | net | org |
Php obtains the code of the primary domain in the MAC address and URL of the NIC.
// Obtain the MAC address of the NIC
@ Exec ("ipconfig/all", $ array );
For ($ Tmpa; $ Tmpa
If (eregi ("Physical", $ array [$ Tmpa]) {
$ Mac = explode (":", $ array [$ Tmpa]);
Echo $ mac [1];
}
}
// Obtain the url primary domain
// By http://bbs.it-home.org
Function GetDomain ($ url ){
$ Pattern = "/[\ w-
specified name, this part will be discussed in section 2.4.9.2.1 create a CookieYou can call the constructor of a Cookie object to create a Cookie. The constructor of a Cookie object has two string parameters: Cookie name and Cookie value. Both names and values cannot contain white spaces and the following characters:[] () = ,"/? @:;9.2.2 read and set Cookie attributesBefore adding a Cookie to the response header to be sent, you can view or set various attributes of the Cookie. The following de
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.