Вы находитесь на странице: 1из 11

HTTP

header( )
header( ) HTTP, ,
(). ,
, HTML.
:
header( ).

header( ), - -
.
, header( )
, :
header("Location: http://www.newlocation.com");
exit ;
header( ) exit ().
.
setcookie( )
setcookie( ) "cookie" .
"cookie" ,
Web-. :
setcookie("HMH", "", "_", "", "",
"") ;
, "cookie" usermame
joe,
testcompany.com:
setcookie("username", "joe", "time( ) +3600, "/", ".testcompany.com");


HTML- .
SMNP,
mail( ) .
:
mail("", "", "", "_");
,
ivan@ivanov.com " !" " -
!":

mail("ivan@ivanov.com", " !", " - !", "From:


_mail@.\n");
"From:" .

.
, (3.14159265358979323846)
(_I)
cell( )
cell( ) .
:
cell();
decbin( ) bindec( )
decbin( ) bindec( )
. :
decbin(_); bindec(_);
dechex( ) hexdec( )
dechex( ) hexdec( )
.
:
dechex(_); hexdec(_);
decoct( ) octdec( )
decoct( ) octdec( )
. :
decoct(_); octdec(_);
floor( )
floor( ) .
:
floor();
number_format( )
number_format( ) .
:

number_format("", "_ __",


"__", "_");
, 12156688
, , :
echo number_format("12156688", "2", ".", ",");
, : 12,156,688.00.
,
, .
pow( )
pow( ) .
:
pow(, );
rand( )
rand( ) .
:
rand(_, _);
round( )
round( )
. :
round();
sqrt( )
sqrt( ) .
:
sqrt();
srand( )
srand( )
. :
srand(_);

, :
srand((double)microtime( )*1000000) ;


die( ) exit( ) ,
.
, , "".
die( )
, ,
. :
die("");
, ,

:
$connection = mysql_connect("_", "_", "")
or die(" .");
exit
exit .
sleep( ) usleep( )
sleep( ) usleep( )
. :
sleep(_); usleep(_);
, sleep(
) , usleep( ) - .
uniqid( )
,
. :
uniqid("");
, "phpuser",
:
$id = uniqid("phpuser");
echo "$id";
, :
phpuser38b320a6b5482.
:

$id = md5(uniqid(rand( )));


echo "id";
, : 999d8971461
bedfc7caadcab33e65866.


, , ,
..
.
( )
. :
exec(, [], [_]);
, ( ) .
,
.
,
ping :
$command ="ping -c5 www.thicbook.com";
exec($command, $result, $rval);
for ($i=0; $i < sixeof($result); $i++) {
echo "$result [$i]<br>";
}
passthru( )
( ), passthru( )
. , passthru( )
.
:
passthu(, _);
,
.
system( )
system( )
, . :
system(, [_]);
,

.
,
ping :
$command ="ping -c5 www.thicbook.com"; system ($command);

ereg_replace( ) eregi_replace( )
ereg_replace( ) eregi_replace( )
. ereg_replace(
) , eregi_replace( ) -
. :
ereg_replace("", "", "");
eregi_replace("", "", "");
, : " ASP."
"ASP" "", :
$old_string = " ASP.";
$new_string = ereg_replace("ASP", "PHP", $old_string);
echo $new_string;
"ASP" , , "aSp",
eregi_replace( ):
$old_string = " aSp.";
$new_string = eregi_replace("ASP", "PHP", $old_string);
echo $new_string;
split( )
split( )
, (, ,
..). :
split(, , []);
, , ,
.

- ,
Web-. .
-
, ;
, : http://www.php.net/manual/.

session_start( )
session_start( ) , ,
,
. . :
session start( );
session_register( )
session_register( ) .
,
$username ,
$username, .
:
session_register("_");
, $username, :
session_register("username");
session_unregister( )
session_unregister( ) , ""
.
:
session_unregister("_");
, "" $username,
:
session_unregister("username");
session_destroy( )
session_destroy( ) ,
. .
:
session_destroy( ) ;
Cmpoo
.
.
addslashes( ) stripslashes( )
addslashes( ) stripslashes( )

. , ,
( , ,
..), ( \)
. addslashes ( ) .
:
addslashes();
stripslashes( )
(\). :
stripslashes();
chop( ), ltrim( ) trim ( )
. chop(
) , ltrim( )
, trim ( ) , .
:
chop();
ltrim();
trim();
echo( )
echo( ) .
:
echo (1, 2, ...) ;
,
echo " .";
echo 2+6;

// : .
// : 8

echo, ,.
explode( ) implode( )
explode( ) , ,
. :
explode("", "");
, $colors_list,
,
$my_colors:
$colors_list = "blue,black,red,green,yellow,orange";
$my_colors = explode(",", $colors_list);

, implode( ) ,
. :
implode("", "");
,
$my_colors $colors_list:
$colors_list = implode(",", "$my_colors ") ;
htmlspecialchars( ) htmlentities( )
htmlspecialchars( ) htmientities( )
HTML- .
htmlspecialchars( ) < (
),
> (
), (") (
)
&(
).
htmientities ( ) ISO-8859-1
HTML-. :
htmlspecialchars();
htmlentities();
nl2br()
nl2b( ) ASCII HTML-
(<BR>). :
nl2br();
sprintf( )
sprintf ( ) ,
, .
:
sprintf(, );
sprintf ( )

%


b

ASCII

d

f
double





( )
( )

strlen( )
.
:
strlen();
strtolower( )
.
:
strtolower();
strtoupper( )
.
:
strtoupper();
substr( )

. :
substr(, _, []);
,
.
, . ,
,
.
, .
:
$new_srtring = substr("PHP - !", 1);
$new_srtring = substr("PHP - !", , 7);

// "HI
//- !
// "*

//- "
$new_srtring = substr("PHP - !", -1);

// "!'

$new_srtring = substr("PHP - !", -6, 5);

//
//""

ucfirst( )
.
:
ucfirst();
ucwords( )
.
:
ucwords();

isset( ) unset( )
. isset(
) . unset( )
. :
isset(_);
unset(_);
isset( ) "", ,
"", .

Оценить