Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHP: How to Get the Current Page URL

Sometimes, you might want to get the current page URL that is shown
in the browser URL window. For example if you want to let your visitors
submit a blog post to Digg you need to get that same exact URL. There
are plenty of other reasons as well. Here is how you can do that.
Add the following code to a page:
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
You can now get the current page URL using the line:
<?php
echo curPageURL();
?>

Sometimes it is needed to get the page name only. The following example
shows how to do it:
<?php
function curPageName() {
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
echo "The current page name is ".curPageName();
?>


Ïà¹ØÎĵµ£º

GyPSii API PHPÇëÇóʾÀý

¸ù¾ÝGyPSii APIÌṩµÄ²Ù×÷ÀàºÍ·½·¨£¬·¢ÏÖÇëÇó»áʧ°Ü£¬·µ»ØµÄÊÇÒ»¸öbed request¡£Ô­ÒòÆäʵºÜ¼òµ¥£¬µ«Ò»Ö±Ã»ÓÐÕÒµ½£¬×îÖÕÔ­ÒòÊǶԷ½ÌṩµÄhostÊÇ´íÎóµÄ£¬Ã»ÌìÀí¡£
¶Ô·½ÌṩµÄhostºÍuri£º
host:http://dev3.gypsii.com/gypsii
uri:http://dev3.gypsii.com/gypsii/xmlservice.cgi
Õâ¸öhost¾ÍÊÇ´íµÄ£¬Ó¦¸ÃÊÇ£ºdev3.gypsii.co ......

ÓÃPHPʵÏÖ¼òµ¥µÄ·´Ïò×î´óÆ¥ÅäÖÐÎÄ·Ö´Ê£¨´úÂ룩

ÀàÎļþwordsplit.class.php£º
<?php
/********************************************************************
* DirCMSÖÐÎÄ·Ö´ÊÀà beta 1.0
* ---------------------------
* begin : 2010-5-11 beta 1.0
* update : 2 ......

ÎÞÐֵܣ¬²»±à³Ì ¶¥ÐÖµÜÁ¬PHPѧԺ

         ÕæÐֵܣ¬½²Ò寸£¬Í¬¸Ê¿à£¬¹²½øÍË¡£
        ¡¶ÐÖµÜÁ¬¡·µçÓ°µÄÉÏÓ³£¬´ó¼Ò·×·×¸ø³öÁËºÃÆÀ¡£²»¾ÍÊÇÒ»²¿Õ½ÕùƬô,ΪºÎÓÐÈç´ËÇ¿ÁÒµÄÏìÓ¦?Ê×ÏÈÕâÊÇÒ»²¿Õ½ÕùƬ²¢Ã»´í£¬µ«¡¶ÐÖµÜÁ¬¡·µçÓ°¸ü¶àµÄÊÇÑóÒç×ÅÄÇÖÖÏàå¦ÒÔÄ­µÄÐÖµÜÇéÒ壬¼áÈçÅÍʯ¡£¶à ......

PHP·â×°ÀàЧÂʲâÊÔ

½ñÌì¸ÕѧÍêmysqli£¬È¥ÎÒµÄIDCÔËÓªÉÌÄÇ¿´ÁËһϣ¬·¢ÏÖËûÃǵÄÐéÄâÖ÷»ú¾ÓÈ»²»Ö§³Ö£¬ÎÒÓÖÈ¥ÆäËû¼¸¼Ò¿´ÁË¿´£¬ÓеÄÖ§³ÖÓеIJ»Ö§³Ö¡£
ÎÒ¾ÍÏë×Ô¼ºÐ´¸öÀ࣬ÈÃËûÈ¥Åжϣ¬ÄÜÓÃmysqli¾ÍÓÃmysqli£¬·ñÔò¾ÍÓÃԭʼµÄmysqlº¯Êý¡£²»¹ýÎÊÌâÂíÉϾÍÀ´ÁË£¬×Ô¼ºÐ´Àà»á²»»áµ¼ÖÂÖ´ÐÐЧÂʱäµÍÁËÄØ£¿ÓÚÊÇÎҾͽøÐÐÁËÈçϲâÊÔ¡£
ÕâÊÇÓÃÀ´¼ÆÊ±µÄÀࣺ
/* ......

Ò»¸öPHPÈÕÀú³ÌÐò

//calendar.php
<?¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
/*******************************¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡*¡¡ ÓÃÀ´ÅжÏÊÇ·ñÈòÄêµÄº¯Êý¡¡¡¡*¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡*¡¡ ¿ÉÒÔ¸ù¾Ý¸ü¸´ÔÓµÄËã·¨¸Ä½ø¡¡*¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ