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

PHP ¶ÁÈ¡µØÖ·À¸ ²ÎÊý


1.  $_GET
£º
http://localhost/a.php?a=ok  
   
  <?  
  echo  
$_GET['a'];   //ÏÔʾ"ok"  
  ?>
2.  $_SERVER['QUERY_STRING']
http://localhost/a.php?a=1&b=2&c=3  
   
  a.php  
  <?  
  echo   $_SERVER['QUERY_STRING'];   //out  
a=1&b=2&c=3  
  ?>
¸½£º
        PHP 4.2.0 ÒÔ¼°ºóÐø°æ±¾ÖУ¬PHP Ö¸Áî register_globals
µÄĬÈÏֵΪ off
¡£ÕâÊÇ PHP µÄÒ»¸öÖ÷Òª±ä»¯¡£ÈÃ
register_globals µÄֵΪ off

½«Ó°Ïìµ½Ô¤¶¨Òå±äÁ¿¼¯ÔÚÈ«¾Ö·¶Î§ÄÚµÄÓÐЧÐÔ¡£ÀýÈ磬ΪÁ˵õ½ DOCUMENT_ROOT
µÄÖµ£¬½«±ØÐëʹÓÃ
$_SERVER['DOCUMENT_ROOT']
´úÌæ $DOCUMENT_ROOT
£¬ÓÖÈ磬ʹÓà $_GET['id']

À´´úÌæ $id
´Ó URL http://www.example.com/test.php?id=3
ÖлñÈ¡ id Öµ£¬Òà»òʹÓà $_ENV['HOME']
À´´úÌæ $HOME
»ñÈ¡»·¾³±äÁ¿
HOME 掙歜
Àý£º
<html>
<head>
</head>
<body>
<?php
    //echo $_SERVER['QUERY_STRING'];
   
    if(isset($_GET["id"]))
    {
        $b = $_GET["ix"];
        $b +=1;
    }else
    {
        $b = 7;
    }
    echo $b;
?>
<input type="button" value = "aaaaa" onclick = "aaa();">
</body>
<script>
    function aaa(){
        window.location="test.php?id=7&ix=<?php echo $b?>";
    }
</script>
<html>


Ïà¹ØÎĵµ£º

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

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

PHP·Ö¸îtextareaת»ØµÄÊý¾Ý

¼ÙÈçÒ»¸ötextareaÖÐÓÐN¶àÐеÄÊý¾Ý,Òª½«ËüתΪPHPµÄһάÊý×é,
 <form id="textarea_test" action="textarea.php" method="post">
<textarea cols="50" rows="5" name="aa" id="abc" >

<?php
$str = $_POST['aa'];
//var_dump($str);
//$str = "chenjinle le";
$array = explode("\n", trim($ ......

PHPÈëÃŵÚÒ»²½

Ò»£¬PHP½Å±¾´úÂë±ê¼Ç
PHPµÄ½Å±¾ÊÇÎļþÖÐÒ»¶ÔÌØÊâ±ê¼ÇËù°üÀ¨µÄÄÚÈÝ£¬ÈçASPÊÇ“<%....%>”,PHP¿É¿´³ÉÊÇ“<?...?>”¡£
È»¶øÎªÁËÊÊÓ¦XML±ê×¼ÒÔ½«PHPǶÈëµ½XML»òXHTMLÖУ¬PHP²»½¨ÒéʹÓö̸ñʽµÄ“<?...?>”£¬¶ø½¨ÒéʹÓó¤¸ñʽ±ê¼Ç“<?php...?>”
´ËÍâPHP´úÂ ......

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 followin ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ