無料スクリプト配布のPHP.TO   PHPの実用的なtips PHPマニュアル MySQLマニュアル Apacheマニュアル PostgreSQLマニュアル マニュアル検索    

PHP ?

?PHP???????? ??

PHP ???????????

PHP ??????????? ?????????? ???

? ?? "needle, haystack" ?? ?? ?? "haystack, needle" ???

???????? PHP????POST?????? ??????

PHP$_POST ??? ???$_POST?? ????POST??????? foreach ??? empty() ? ???

<?php
$empty 
$post = array();
foreach (
$_POST as $varname => $varvalue) {
    if (empty(
$varvalue)) {
        
$empty[$varname] = $varvalue;
    } else {
        
$post[$varname] = $varvalue;
    }
}

print 
"<pre>";
if (empty(
$empty)) {
    print 
"None of the POSTed values are empty, posted:\n";
    
var_dump($post);
} else {
    print 
"We have " count($empty) . " empty values\n";
    print 
"Posted:\n"var_dump($post);
    print 
"Empty:\n";  var_dump($empty);
    exit;
}
?>

: ?: ?????

PHP 4.1.0 ?? $_GET, $_POST, $_SERVER ???????? ???????? superglobals ???

??(')??? ??(\')????? ?????????? ?? " \" ?\ \\ ??

????????????? ????????? MySQL ? mysql_real_escape_string() PostgreSQL ? pg_escape_string() ??? ?? addslashes() stripslashes() ?? ?? PHP ?????

: ??????: magic_quotes_gpc

PHP ???magic_quotes_gpc ??? on ???? GET, POST, COOKIE ? addslashes() ??? ? stripslashes() ??? ??

" \" ?? ' \' ??? ????????? ??????????

???????????PHP magic_quotes_gpc ???? On ??????? PHP ?????????????? ????PHP stripslashes() ????

: ??????: magic_quotes_gpc

PHP ???magic_quotes_gpc ??? on ???? GET, POST, COOKIE ? addslashes() ??? ? stripslashes() ??? ??

PHP register_globals ?????
?

? PHP 5.3.0 ???? PHP 5.4.0 ?

??? ini ?????? ?? URL ?? http://example.com/foo.php?animal=cat foo.php ????????

<?php
// ? $_GET ????
echo $_GET['animal'];

// $animal ?? register_globals  on ????
// ?????
echo $animal;

// ?????????? $_SERVER ????
echo $_SERVER['PHP_SELF'];

// $PHP_SELF ?? register_globals  on ????
// ???????
echo $PHP_SELF;
?>

????register_globals ????? ?????????? ? register_globals ??????? ?? register_globals ???? ? register_globals on ??????? ??

??????

:

???? URL ??? ??? GET HTTP ???? ?? $_GET ??

????????????
function myfunc($argument)
{
    echo $argument + 10;
}
$variable = 10;
echo "myfunc($variable) = " . myfunc($variable);
??

??????(???? ??)??echo ??? ? return ??

???
<pre>
<?php echo "1"?>
<?php 
echo "???????"?>
</pre>

PHP??"?>""?>\n"(\n????)PHP?? ????????? ???1????????? ?PHP?????1??? ???

?PHP???????HTML? ?????????1? ??????????? ??1????????? ??

'Warning: Cannot send session cookie - headers already sent...' 'Cannot add header information - headers already set...'? ?? sent...'.

header(), set_cookie() ????? ????????? ???headers_sent()? ??????????? ???

????????

?PHPApache?????? getallheaders()??? ????????? ?????

$headers = getallheaders();
foreach ($headers as $name => $content) {
    echo "headers[$name] = $content<br />\n";
}

apache_lookup_uri(), apache_response_headers(), fsockopen()???

IIS????'No Input file specified'?? ??

IIS???IIS??CGI?? ?????????(PHP ??)HTML??META?PHP ???????? PHP?????????ISAPI? ??????NT? ?????» http://support.microsoft.com/kb/q160422/ HTTP ? ??

Windows: ???????IIS ???

Go to Internet Information Services ????PHP ?? ????? ??? Edit -< Anonymous access and authentication control

? Anonymous Access ? Integrated Window Authentication ???? ? Anonymous Access ??????

?XMLPHP????XML <?xml>PHP?????

<?xml PHP??? PHP????short_tags 0 ???? ????ini_set()???? ??short_open_tags /??????: <?php echo '<?xml'; ?> ??????????

???????? ?PHP???????

?? ??? ?????????? ??????????? phpinfo()????????? ?? PHP?? ??HTML?CookieURL ?????????

: register_globals: ?

PHP 4.2.0 ??PHP ??? register_globals ??? off ???? PHP ?????????? superglobals ???????

????????? PDFLib?? PDF?????? ???PDF?????? ?

PHP?????? » FPDF » TCPDF ???

?Haru ??? ?????? libHaru ???

??? ($DOCUMENT_ROOT $HTTP_REFERER ) CGI???PHP???? ?????

PHP???? register_globals ???????????? register_globals = off (PHP4.2.0?????off)? $DOCUMENT_ROOT?? $_SERVER['DOCUMENT_ROOT']?? register_globals = on $DOCUMENT_ROOT $GLOBALS['DOCUMENT_ROOT']??

: ?: ?????

PHP 4.1.0 ?? $_GET, $_POST, $_SERVER ???????? ???????? superglobals ???

PHP ??????? integer ??????????? ? php.ini ???? ?

??? K???M???? G?: PHP 5.1.0 ????????????? ???? 1M ?1 ??? 1048576 ????1K ?1 ?? 1024 ???? php.ini ??? ?? integer ??? ??? ini_get() ?? ?

: ? ??

PHP ?? 1 = 1024 ???? IEC ???? 1024 ?? 1 ? (kibibyte) ???????? ??: PHP ? k K = 1024 ?

Windows ? "127.0.0.1" ?? localhost ?????

PHP 5.3.4 ??? PHP ???????? IPv6 ???????????? localhost ?????? ? "127.0.0.1" ??? IPv6 ? hosts ??????



powered by SEO.CUG.NET