Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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();
?>


Ïà¹ØÎĵµ£º

PHP½Ì³Ì ³õѧÕ߱ؿ´µÄPHP´úÂë


¾­µäÑ­»·Àý×Ó
<HTML>
<HEAD>
<TITLE>¾­µäÑ­»·Àý×Ó</TITLE>
</HEAD>
<BODY>
<?
    for($counter = 1; $counter <= 6; $counter++) 
      //Ñ­»·6´Î
    {
        print("<B& ......

PHP ¸ßЧÂÊд·¨ PHP³õѧÕ߱ؿ´

1¡¢Èç¹ûÄܽ«ÀàµÄ·½·¨¶¨Òå³Éstatic£¬¾Í¾¡Á¿¶¨Òå³Éstatic£¬ËüµÄËÙ¶È»áÌáÉý½«½ü4±¶¡£
2¡¢$row['id'] µÄËÙ¶ÈÊÇ$row[id]µÄ7±¶¡£
3¡¢echo ±È print ¿ì£¬²¢ÇÒʹÓÃechoµÄ¶àÖØ²ÎÊý(Òë×¢£ºÖ¸ÓöººÅ¶ø²»ÊǾäµã)´úÌæ×Ö·û´®Á¬½Ó£¬±ÈÈçecho $str1,$str2¡£
4¡¢×îºÃʹÓÃForeachÖ´ÐÐÑ­»·£¬ÔÚÖ´ÐÐforÑ­»·Ö®Ç°È·¶¨×î´óÑ­»·Êý£¬²»ÒªÃ¿Ñ­»·Ò»´ ......

PHPÖÐsession_registerº¯ÊýÏê½â


Óï·¨: boolean session_register(string name);
×¢²áеıäÁ¿¡£
·µ»ØÖµ: ²¼¶ûÖµ
º¯ÊýÖÖÀà: ×ÊÁÏ´¦Àí
ÄÚÈÝ˵Ã÷
±¾º¯ÊýÔÚÈ«Óò±äÁ¿ÖÐÔö¼ÓÒ»¸ö±äÁ¿µ½Ä¿Ç°µÄ Session Ö®ÖС£²ÎÊý name ¼´ÎªÓû¼ÓÈëµÄ±äÁ¿Ãû¡£³É¹¦Ôò·µ»Ø true Öµ¡£
¼ÙÈçÔÚÍ·Îļþ£¬¿ªÆôsession,¼´Ê¹ÓÃsession_start()º¯ÊýºóÃæ¼ÓÉÏsession_register(string na ......

php¶àÏß³Ì

ÒÔ϶¼ÊÇ×ªÔØ£¬ ¼òµ¥ËµÏ£¬ phpÊDz»Ö§³Ö¶àÏ̵߳ġ£¡£¡£¡£
PHPÓïÑÔ±¾ÉíÊDz»Ö§³Ö¶àÏ̵߳Ä. ×ܽáÁËÒ»ÏÂÍøÉϹØÓÚPHPÄ£Äâ¶àÏ̵߳ķ½·¨, ×ܵÄÀ´Ëµ, ¶¼ÊÇÀûÓÃÁËPHPµÄºÃ»ï°éÃDZ¾ÉíËù¾ßÓеĶàÏß³ÌÄÜÁ¦. PHPµÄºÃ»ï°éÖ¸µÄ¾ÍÊÇLINUXºÍAPACHEÀ², LAMPÂï.
  ÁíÍâ, ¼ÈÈ»ÊÇÄ£ÄâµÄ, ¾Í²»ÊÇÕæÕýµÄ¶àÏß³Ì. ÆäʵֻÊÇ¶à½ø³Ì. ½ø³ÌºÍÏß³ÌÊÇ ......

php/apc ¼à¿ØÎļþÉÏ´«½ø¶È

Ô­ÎĵØÖ·£º http://blog.csdn.net/lmss82/archive/2010/05/10/5574772.aspx
ÕâÊÇÒ»¸öÍêÕû¿ÉÓõĴúÂ룬²¿·Ö´úÂëÀ´×ÔÓÚÍøÂç¡£
PHP:
5.26
JS»·¾³£º
jquery.js,jquery_form.js
ʹÓò½Ö裺
¿ªÆôAPC.
ÏÂÔØphp_apc.dll£¬ÐÞ¸Äphp.iniÎļþÔö¼ÓÒÔÏÂÄÚÈÝ£º
extension=php_apc.dll
apc.rfc1867 = On
´úÂ룺
<?php
//< ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ