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

phpÓëjavascriptÖ®¼ä±äÁ¿ÒýÓÃÎÊÌâ

JavaScript ==> PHP£º
·½·¨Ò»: ÏÈÓÃPHPÉú³Éjs´úÂ룬Ȼºóͨ¹ýä¯ÀÀÆ÷µÄ×Ô¶¯Ë¢Ð£¬½«javascript±äÁ¿´«µÝµ½PHP½Å±¾ÖС£
            ×¢Ò⣺ÔÚʵ¼ÊÓ¦ÓÃÖÐÒª·ÀÖ¹Óû§ÔÚµØÖ·À¸ÄÚ¸ü¸Ä´«µÝµÄ±äÁ¿Öµ¡£
<?php
if($qq) echo $qq.'<br>';
else echo "<script language='javascript'>var qq='ÎÒµÄQQÊÇ1234567'; location.href='?qq='+qq; </script>";
echo $qq;
?>
·½·¨¶þ£ºÏÈÓÃdocument.cookie·½·¨°Ñjs±äÁ¿Ð´ÈëcookieÖУ¬ÔÙÓÃPHPÈ¡³ö¡£
<script language="javascript" type="text/javascript">
var name = "myqq",value="10000";  
document.cookie = name+" = "+value+";"
</script>
<?php  
echo $_COOKIE["myqq"]."<br/>";  
$my = "ÎÒµÄQQÊÇ".$_COOKIE["myqq"];  
echo $my;  
?>
·½·¨Èý£º
<script>
var a = 'ÎÒÊÇÐñÈÕ£¡';
</script>
<?php
$c = "<script>document.write(a);</script>";
echo $c;
?>
PHP ==> JavaScript £º
//·½·¨Ò»£ºÒÔhtmlΪý½é, php±äÁ¿-->html¶ÔÏó-->javascriptµ÷Óá£
<?php
$val_overview_pic = "ÎÒÊÇÐñÈÕ£¡";
?>
<input type="hidden" name="did" value="<?=$val_overview_pic;?>">
<script language="javascript" type="text/javascript">
alert(did.value);
//window.location ="/topic/isoktoshow.php?pic="+did.value;
</script>
·½·¨¶þ£ºÓÃphpÊéдjavascript¡£
<?php
$val_overview_pic = "/pic/pic1.jpg";
echo "<script language='javascript' type='text/javascript'>";
echo " alert('".$val_overview_pic."');";
//echo " window.location ='/topic/isoktoshow.php?pic='".$val_overview_pic ."';";
echo "</script>";
?>


Ïà¹ØÎĵµ£º

PHPµãµãµÎµÎ

1¡¢²¼¶ûÖµ£ºfalse(0,¿Õ°×,null);    true(-1,·Ç0Öµ)£» 2¡¢echo '$s'Êä³öÄÚÈÝÊÇ $s;  
    Èç¹û""ÀïÃæ°üº¬ÁË$s»òÕß{$s}£¬ÄÇô½«ÏÔʾµÄ±äÁ¿µÄÖµ¡£ÍƼöʹÓÃ{$s}µÄ·½Ê½¡£
    ʹÓÃ""ʱºò£¬Èç¹ûÔÚ""ÀïÃ滹ҪʹÓÃ"",¾Í±ØÐëÓÃ\À´×ªÒå,ÀýÈ磺 echo "\"sss\""; 3¡¢ ......

JavaScript¾«´â¶ÁÊé±Ê¼Ç(3)

µÚ3Õ  ¶ÔÏó
JavaScriptµÄ¼òµ¥ÀàÐÍ°üÀ¨Êý×Ö¡¢×Ö·û´®¡¢²¼¶ûÖµ£¨trueºÍfalse£©¡¢nullÖµºÍundefinedÖµ¡£ÆäËûËùÓеÄÖµ¶¼ÊǶÔÏó¡£Êý×Ö¡¢×Ö·û´®ºÍ²¼¶ûÖµ“òËÆ”¶ÔÏó£¬ÒòΪËüÃÇÓµÓз½·¨£¬µ«ËüÃÇÊDz»¿É±äµÄ¡£JavaScriptÖеĶÔÏóÊǿɱäµÄ¼ü-Öµ¼¯ºÏ(keyed collections)¡£ÔÚJavaScriptÖУ¬Êý×éÊǶÔÏ󣬺¯ÊýÊǶÔÏó£¬Õý ......

¿Í»§¶Ëä¯ÀÀÆ÷Ö§³Öµ±Ç°JavaScript½Å±¾´æÔڵĽéÉÜ

 ¿Í»§¶Ëä¯ÀÀÆ÷²»Ö§³Öµ±Ç°JavaScript½Å±¾´æÔÚÈçÏÂÈýÖÖ¿ÉÄÜ£º
¿Í»§¶Ëä¯ÀÀÆ÷²»Ö§³ÖÈκÎJavaScript½Å±¾£»
¿Í»§¶Ëä¯ÀÀÆ÷Ö§³ÖµÄJavaScript½Å±¾°æ±¾Óë¸Ã½Å±¾´úÂëʹÓõİ汾ËùÖ§³ÖµÄ¶ÔÏó¡¢ÊôÐÔ»ò·½·¨²»Í¬£»
¿Í»§¶ËΪÁË°²È«Æð¼û£¬ÒѾ­½«ä¯ÀÀÆ÷¶ÔJavaScript½Å±¾µÄÖ§³ÖÉèÖÃΪ½ûÖ¹¡£
  ÒÔÉÏÈýÖÖÇé¿ö×ܽáÆðÀ´£¬¾ÍÊÇä¯ÀÀÆ÷¶ ......

phpÖÐsession²»ÄÜ¿çÒ³´«ÊäµÄ½â¾ö·½°¸

ÔÚPHPÖÐʹÓùýSESSIONµÄÅóÓÑ¿ÉÄÜ»áÅöµ½Õâôһ¸öÎÊÌ⣬SESSION±äÁ¿²»ÄÜ¿çÒ³´«µÝ¡£ÕâÁîÎÒ¿àÄÕÁ˺ÃЩÈÕ×Ó£¬×îÖÕͨ¹ý²é×ÊÁÏ˼¿¼²¢½â¾öÁËÕâ¸öÎÊÌâ¡£ÎÒÈÏΪ£¬³öÏÖÕâ¸öÎÊÌâµÄÔ­ÒòÓÐÒÔϼ¸µã£º
1¡¢¿Í»§¶Ë½ûÓÃÁËcookie
2¡¢ä¯ÀÀÆ÷³öÏÖÎÊÌ⣬ÔÝʱÎÞ·¨´æÈ¡cookie
3¡¢php.iniÖеÄsession.use_trans_sid = 0»òÕß±àÒëʱûÓÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ