.


:




:

































 

 

 

 


php-




.

, , . , . , , .

: , . , .

: , , URL ( php-). , .

.

php-, :

( !) html-, ;

, ( !), .

, action .

3 (php- " ")

1. " ". , name 'firstname'.

, "".

POST.

2. , ( $_POST['firstname']).

, php-, , .

, .

, $_POST . .

1. ( , , ) $_POST['firstname']. , , , value="".

2. here-doc echo , $_POST .

3. action .

, action, . , . $_SERVER, , $_SERVER['PHP_SELF'].

1. , ?

2. html- php-?

3. here-doc now-doc?

4. ?

5 echo print?

6. html- ?

7. , ?

8. isset empty?

9. , ? ?

10. php-, ? ?

 

-

- .php. :

) html- ( javascript)

) , .

html-. php-, html- ( <html>, <body> ..).

, HTML.

<?

if($what){

?>

html-

<?

} else {

?>

html-

<?

}

?>

php- , , . ( ).

, . .

<html><body>

<?php

$var = "!";

print $var;

?>

</body></html>

, , , ( ).

. , , . html-, php- . , .

. , JavaScript , .

) , () , .

) , , . , , . , .

.

, , , . , . Javascript : str = 'x=' + x;, + .

:

$str = 'x='. $x;

$str = "x=$x";

"" :

$str='

';

here-doc now-doc

HTML (XHTML), HTML- . ,

<a href="javascript:alert('Hello')"

style="color:red;" target='_self'> Hello</a>

-, escape-. HTML-, .

, HTML-, "Here Document" here-doc. , .

) Here Document <<< ( "here document"). . , .. !

) , .

:

$str = <<< HERE_NAME //

html-, here-document

HERE_NAME; // ,

here-doc HERE_NAME. here-doc , , .

here-doc , .

5.3 nowdoc , . .. , . here-doc :

$str = <<<' NOW_NAME' // ,

...

NOW_NAME; // ,

 

echo print

-, HTML- (.. document.write JavaScript). .

) print.

:

<?php

print(' html-');

print " !";

?>

, .

) echo.

, print.

echo print: echo , print :

<? echo "", ""; //

print "", ""; // !!!

?>

"" .

<? echo "

"; //

print "

"; //

?>

echo , .

.

echo print () html-. Ÿ "" php- php-, . , html-.

, HTML-, .





:


: 2017-04-15; !; : 329 |


:

:

, .
==> ...

1384 - | 1219 -


© 2015-2024 lektsii.org - -

: 0.033 .