$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£
$_GET ±äÁ¿
$_GET ±äÁ¿ÊÇÒ»¸öÊý×飬ÄÚÈÝÊÇÓÉ HTTP GET ·½·¨·¢Ë͵ıäÁ¿Ãû³ÆºÍÖµ¡£
$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£´Ó´øÓÐ GET ·½·¨µÄ±íµ¥·¢Ë͵ÄÐÅÏ¢£¬¶ÔÈκÎÈ˶¼ÊǿɼûµÄ£¨»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸£©£¬²¢ÇÒ¶Ô·¢Ë͵ÄÐÅÏ¢Á¿Ò²ÓÐÏÞÖÆ£¨×î¶à 100 ¸ö×Ö·û£©¡£
Àý×Ó
<form action="welcome.php" method="get">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
µ±Óû§µã»÷Ìá½»°´Å¥Ê±£¬·¢Ë굀 URL »áÀàËÆÕâÑù£º
http://www.w3school.com.cn/welcome.php?name=Peter&age=37
"welcome.php" ÎļþÏÖÔÚ¿ÉÒÔͨ¹ý $_GET ±äÁ¿À´»ñÈ¡±íµ¥Êý¾ÝÁË£¨Çë×¢Ò⣬±íµ¥ÓòµÄÃû³Æ»á×Ô¶¯³ÉΪ $_GET Êý×éÖÐµÄ ID ¼ü£©£º
Welcome <?php echo $_GET["name"]; ?>.<br />
You are <?php echo $_GET["age"]; ?> years old!
ΪʲôʹÓà $_GET£¿
×¢ÊÍ£ºÔÚʹÓà $_GET ±äÁ¿Ê±£¬ËùÓеıäÁ¿ÃûºÍÖµ¶¼»áÏÔʾÔÚ URL ÖС£ËùÒÔÔÚ·¢ËÍÃÜÂë»òÆäËûÃô¸ÐÐÅϢʱ£¬²»Ó¦¸ÃʹÓÃÕâ¸ö·½·¨¡£²»¹ý£¬ÕýÒòΪ±äÁ¿ÏÔʾÔÚ URL Ö ......
1.Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿
get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
2.Win32ÏÂapache2 ÓÃget·½·¨´«µÝÖÐÎIJÎÊý»á³ö´í
ÀýÈ磺test.php?a=ÄãºÃ&b=ÄãÒ²ºÃ
´«µÝ²ÎÊýÊǻᵼÖÂÒ»¸öÄÚ²¿´íÎó
½â¾ö°ì·¨:"test.php?a=".urlencode(ÄãºÃ)."&b=".urlencode(ÄãÒ²ºÃ)
urlencode($myname)Ö÷ÒªÓÃÓÚÕýȷʶ±ðºº×Ö ¿Õ¸ñÒÔ¼°ÆäËûÌØÊâ×Ö·û¡£
3.win32ϵÄsession²»ÄÜÕý³£¹¤×÷
php.iniĬÈϵÄsession.save_path = /tmp ÕâÏÔÈ»ÊÇlinuxϵÄÅäÖã¬win32ÏÂphpÎÞ·¨¶ÁдsessionÎļþµ¼ÖÂsessionÎÞ·¨Ê¹Ó㬰ÑËü¸Ä³ÉÒ»¸ö¾ø¶Ô·¾¶¾Í¿ÉÒÔÁË£¬ÀýÈçsession.save_path = c:windows emp ,Ò»°ãÕâ¸ö¹¤×÷ÔÚÅäÖÃphpÔÚwinµÄ°²×°»·¾³µÄʱºò¾ÍÓ¦¸Ã½â¾öµÄ¡£
4.ÏÔʾ´íÎóÐÅÏ¢
µ±php.iniµÄdisplay_errors = On²¢ÇÒerror_reporting = E_ALLʱ£¬½«ÏÔʾËùÓеĴíÎóºÍÌáʾ£¬µ÷ÊÔµÄʱºò×îºÃ´ò¿ªÒÔ±ã¾À´í¡£
5.¸ü¸Äphp.iniºóûÓб仯
......
ÓÃPHPʵÏÖ½ø¶ÈÌõЧ¹û¡£
<?php
set_time_limit(0);
echo '<h2>ÕýÔÚ°²×°£¬ÇëÉÔºó...</h2>',
'<div style="border:1px solid #000;width:500px;"><div id="progress_bar">loading...</div></div>';
for($i=1;$i<=100;$i++){
$width = '500';
$width = ceil(($i/100)*$width);
echo '<mce:script type="text/javascript"><!--
',
'var progress_bar = document.getElementById("progress_bar");',
'progress_bar.style.background="#ff0000";',
'progress_bar.style.width ="'.$width.'px";',
"progress_bar.innerHTML = '{$i}%';",
'
// --></mce:script>';
sleep(1);
flush();
}
echo 'done';
?>
......
Îļþphp.ini·ÅÈëwindowsÏ£¬½«ÏÂÃæÄÚÈÝ¿½±´µ½¼Çʱ¾ÃüÃûΪphp.ini·ÅÈëc:/windowsÏÂ,ÖØÆôApache server£º
[PHP]
;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for production purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
; and http://php.net/manual/en/security.php.
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior. In order for PHP to
; read it, it must be named 'php.ini'. PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory. The
; path in which t ......
Îļþphp.ini·ÅÈëwindowsÏ£¬½«ÏÂÃæÄÚÈÝ¿½±´µ½¼Çʱ¾ÃüÃûΪphp.ini·ÅÈëc:/windowsÏÂ,ÖØÆôApache server£º
[PHP]
;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for production purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
; and http://php.net/manual/en/security.php.
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior. In order for PHP to
; read it, it must be named 'php.ini'. PHP looks for it in the current
; working directory, in the path designated by the environment variable
; PHPRC, and in the path that was defined in compile time (in that order).
; Under Windows, the compile-time path is the Windows directory. The
; path in which t ......
PHPµÄÓŵãÊǼòµ¥ÊµÓá£ÓÃËüÀ´Ð´Ò»Ð©½Å±¾£¬»òÕßÊÇwebservice¡¢Êý¾Ý¿âÀàµÄһЩ·ÃÎÊ£¬È·ÊµÊǺܼòµ¥·½±ã¡£
µ«ËüÓÐÒ»¸öºÜ´óµÄÎÊÌ⣬¾ÍÊÇÄÚ´æµÄ»ØÊÕÎÊÌâ¡£¸ù¾ÝʹÓõľÑé¾õµÃÊǼ¸ºõÊÇûÓлØÊÕ¡£±ÈÈç½âÎöÒ»¸ö1°ÙÕ×µÄXMLÎļþ£¬ÄÚ´æÊ¹ÓÃÄܵ½1G¶à£¬¶øÇÒ»¹²»ÊÍ·Å¡£
ËùÒÔÓÃphpдºǫ́³ÌÐò£¬Ò»¶¨²»Òª×ö³ÉËÀÑ»·µÄ£¬ÖÁÉÙÊǹýÒ»¶Îʱ¼äÍ˳öÒ»´Î£¬È»ºóÀûÓÃShell½Å±¾À´×öÑ»·¡£
......
<?php
/**
* PHP100.com - ¸öÈ˸оõ·Ç³£¼òµ¥£¬Ö»ÒªÓеãPHP»ù´¡µÎÈ˶¼Ó¦¸ÃÄÜ¿´¶®~~
* Apache2 + PHP5.0
* Version:1.0
* ͬʱ¸ÐлPHP100ËùÓеÄÐÖµÜÃÇ
* ————————————————————————————————— Example —
* test.php @ ´¦Àí±íµ¥ÎļþÃû
* <?php
*
* include("upload.php"); # ¼ÓÈëÀàÎļþ
* $f_upload = new upload_other; # ´´½¨¶ÔÏó
* $f_upload->set_file_type($_FILES['src']['type']); # »ñµÃÎļþÀàÐÍ
* $f_upload->set_file_name($_FILES['src']['name']); # »ñµÃÎļþÃû³Æ
* $f_upload->set_file_size($_ ......