Php-web- > Php
Php - . ?
, . Php,
, ,
html- " ".
.
1. html :
, .
, ,
.
"top.htm" -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN"> <html><HEAD><TITLE>%title%</TITLE></HEAD><body>
"end.htm" -
</body></html>
<? //
Title. $title = "Php-web-"; $t_mha = @file
('top.htm'); for($mha = 0 ; $mha
< count($t_mha); $mha++) { $t_mha[$mha] =
str_replace("%title%",$title,$t_mha[$mha]); echo "$t_mha[$mha]"; } //
include("zentr.htm"); //
include("end.htm"); ?>
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"> <html><HEAD><TITLE>Php-web-</TITLE></HEAD><body> ,
, zentr.htm. </body></html>
,
title,
(zentr.htm) html
.
, .
,
. ,
title - ,
.
: title,
( ),
,
. ,
, html
( ),
. ,
,
, .
2. php-.
, ,
all.php. html
"all.php?act=omsk&fon=velikie".
. ,
all.php Get
: "$act=omsk" "$fon=velikie".
,
. <? // $act "omsk" $fon ,
// //
: "all.php?act=omsk&fon=velikie" if($act == "omsk" and $fon != "") {
include("one.htm");
} // $act "omsk" $fon ,
// //
: "all.php?act=omsk" if($act == "omsk" and $fon == "") {
include("too.htm");
} ?>
, .
3.
?
Get Post, -
submit.
Get, ,
:
all.php?1_=&2_=&3_=.
Post,
. ,
Get , ,
. ,
, : ,
email .
, ,
, Get. Php
, ,
Javascript, ,
html, .
4.
? ,
, administ.php.
. <? //
function
form() { echo " <!DOCTYPE HTML PUBLIC
\"-//W3C//DTD HTML 4.0 Transitional//EN\"> <html><HEAD> <title></title> <meta
http-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1251\"> </head><body> <form
action=administr.php method=post> <table border=0
width=600 align=center cellspacing=1 cellpadding=1
bgcolor=#333399> <tr><td align=center
bgcolor=#D7DCF7> <font face=verdana size=2
color=de0000>
</font></td></tr> <tr><td
align=center bgcolor=#D7DCF7><input type=password name=p
size=25></td></tr> <tr><td
align=center bgcolor=#D7DCF7><input type=submit
value=></td></tr></table> </form>"; } //
if ($p == "$password") { //
echo "</body></html>"; exit; } //
,
if
($p != "$password") //
ip ,
{ if(empty($log_ip)){
if (getenv('HTTP_X_FORWARDED_FOR')) {$log_ip=getenv('HTTP_X_FORWARDED_FOR');
} else
{$log_ip=getenv('REMOTE_ADDR');
}} else
{$log_ip=getenv('REMOTE_ADDR');
} $log_host=gethostbyaddr("$log_ip"); $log_date=date('d\.m\.Y,
H:i:s'); $log_file =
fopen("admin.log","a+"); $p = eregi_replace("<","<","$p"); $p = eregi_replace(">",">","$p"); if($p == "") {
$p = " ";
} fputs
($log_file,"$log_ip<>$log_host<>$log_date<>$p\n"); fclose ($log_file); form(); echo "</body></html>"; } ?>
, , ,
ip .
,
,
,
.
5.
? for - ,
,
.
- ,
- "::". , : 1 - ::::40 ::/::
2 - ::.::35 ::/:: 3
- ::.::45 ::/::
(,
, ), ,
for.
,
, - file,
,
, , ,
,
. , $base - ,
. <? //
$general // $general - ,
: // $general[0] -
, 1 // $general[1] - , 2
// $general[2] - , 3
// , ,
// file
//
$general = file("$base"); //
// fopen, "w", ,
// , $general, // $general $fp = fopen("$base","w"); // count($general) -
, // $general. //
, : $j = 0
$j < forum'>count($general) for ($j = 0; $j <
count($general); $j++) { //
, , // $general[$j] -
, 1 $general[0] // $general[$j] -
, // 2 $general[1]. 1, 0.
// , .
// $j <
count($general), //
- $j
, //
. $j++, //
, 0. //
,
// ,
, // - fputs($fp,$general[$j]) //
$general[$j],
// , ,
if ($j != ($del)){
$erg = fputs($fp,$general[$j]); }
} // $j < count($general),
// .
- fclose($fp); ?>
file, count, for, fopen, fclose.
|