<?php
echo ":\n";
$filename = "count.txt";
$fd = fopen($filename,"r");
$cont = fread($fd, filesize($filename));
fclose($fd);
$cont=$cont+1;
$fd = fopen($filename,"w");
fwrite($fd, $cont);
fclose($fd);
echo $cont;
echo " ().\n";
?>
HTML PHP . GET POST.
GET
: GET ? HTTP/1.0
: REQUEST_URI; QUERY_STRING , REQUEST_METHOD GET.
( POST) . , ( , , ). HTTP/1.0 - , HTTP/1.1. , , .
? , URL. - , . URI (UniversalResourceIdentifier - ). URL ( , HTTP). URL Web- , URI - , ( IP-) .
$a, $b $c GET . :
$a = $_GET['a']; |
$b = $_GET['b']; |
$c = $_GET['c']; |
$summa = $a + $b + $c; |
echo " $a + $b + $c = $summa"; |
POST
: POST ? HTTP/1.0
: REQUEST_URI; QUERY_STRING , REQUEST_METHOD POST.
POST. POST:
POST /script.cgi HTTP/1.0\n
Content-length: 6\n
\n
Hello!
, . , \n\n, , Hello! 6 - . , POST- ( , ), . , , . . , ? Content-Length, .
|
|
POST? , . , Web , . , POST : , GET, , , , URL . , POST- URL .
. post-1.php
<!-- --> | |
<form action="post-2.php" method="post" name="form1" target="_blank"> |
<!-- --> | |
<p><input name="name" type="text" size="20"></p> |
<p><input name="lastname" type="text" size="20"></p> | |
<!-- --> |
<p><input name="submit" type="submit" value=""></p> | |
</form> |