Публикации с тегом "HTML"

?????????? ?????????? CSS-??????? ? ?????? HTML-????????

????? ???????? ???????? ??????????? ?????????? ?????????? CSS-??????? ? ?????? HTML-????????. ??? ????? ????? ??????????? ??? ??????????? ?????? ? ???????? class ???????? ????? ??????. ??????? ????????? ?????????:

.bolded {font-weight: bold;}
.centered {text-align: center;}
<div class="bolded centered">?  ?????? ????? ?? ??????!</div>

????????? ???????? ?????????? ????? ?? ????? ??????

?????? ?????????? ????????? ?????????? ????? ?? ??????? ???? ?? ?? ?????????? ?? ??????. ??? ????? ??????? ? ??????? ???? nobr:

<nobr>???? ????? ?????????????? ????? ???????????? ? ???? ??????</nobr>

????? ?? ????? ???????? ??? ?????? CSS-????? white-space, ????????? ?????????? ????????-??????????. ????????:

<span style="white-space: nowrap">???? ????? ?????????????? ????? ???????????? ? ???? ??????</span>

?????? ??????? ????? ?????????????? (??? nobr ??????????? ? ????????? XHTML).

????????? ?????? ?? HTML-???? ??? ?????? PHP ????? 2

? ??????? ????????????? (HTML-???????? input ???? radio) ??? ????????? ??????. ?? ?????? ????? ??????? ?????? ????, ??????? ? ???????? ?????????? ????. ????, ???? ??????, ????? ?? ???? ?? ????????? ?? ???????. ??????? ????????? ????????? HTML-?????:

<?php
 
  if ( count($_GET) > 0 )
  {
      if ( isset($_GET['color']) ) //--?????????, ??? ?? ??????? ???????? color
      {
          echo '?? ???????: ';
          switch( $_GET['color'] )
          {
              case 'red': echo '???????'; break;
              case 'green': echo '???????'; break;
              case 'blue': echo '?????'; break;
          }
      }
      else
      {
          echo '?? ?????? ?? ???????!';
      }
      exit;
  }
 
?>
 
<form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  <input type="radio" id="red" name="color" value="red" /> <label for="red">???????</label> <br />
  <input type="radio" id="green" name="color" value="green" /> <label for="green">???????</label> <br />
  <input type="radio" id="blue" name="color" value="blue" /> <label for="blue">?????</label> <br />
  <input type="submit" name="submit" value="Send" />
</form>

PHP-?????????? ????? ?????????? ????????? ????????????? ????????, ? ????? ?????????? ??????. ???????, ????? ????? ???????????? ?????????? ????? ?????????? ??????? (?? ????, ????? ????????? ??????? ????????? ??????????). ??????? ???? radio ???????????? ??????????, ???? ?? ????? ??????? checked ?? ????????? checked. ??????? ???????? ????? ? ???????, ? ???????????? ???????? ????? ??????????? ? ??????? PHP.

????????? ?????? ?? HTML-???? ??? ?????? PHP

?????????? ?????????? ? HTML-???????. ? ??????? ?????? ? ??? ??????? ?????????? ?????? ????????? ?????? ?? HTML-????, ????? ?? ?????????? ???? ?????? ????? ????????.

????, ?????? ?? HTML-???? ???????????? ??? ?????? GET ??? POST HTTP-????????. ? GET-??????? ????????? ????????? ??????????????? ? URL ? ????? ? ???????? ?????? ????????. ? POST-??????? ?????? ????????? ? ???? HTTP-??????. ?????? ???????? ????????, ????????? ? ???????? action ???? HTML-????? form, ????????, PHP-??????.

???????? ????????, ???????????? HTML-????? ? ????????, ??????????? ?????? ?? ??? ????????? ???????????? ?? ???? ???? PHP-????. ??? ?????? ? ??? ??????, ?????, ????????, ??? ???????????? ????????? ?????? ?????????? ???????? ???????? ????? ???????????? ? ??????? ?? ??? ??????. ????? ??? ???????? ????????? ?????? ????? ? ??? ??????????? ??????. ?? ??? ??????? ?? ?????????? ?????.

? ????? ?????? PHP ??????????????? ??????? ????? GET ? POST-??????????? ???. GET-????????? ??????????? ? ?????????? ??????? $_GET, POST ? $_POST.

?????????? ????? ??????:

<form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  <input type="text" name="name" /><br />
  <input type="submit" value="Send" />
</form>

????? ???????? ????????, ??? ???????? ???????? action ???????????? ????? PHP-???????. ?????????? $_SERVER['PHP_SELF'] ???????? ??? ? ???? ???????? ???????????? PHP-??????? ???????????? ????????? ???????? ???-???????. ????? ???????, action ?????? ????? ????????? ?? ?????? ????, ? ????????????? ?? ???????????? ? ????? ?????.

HTML-?????

??? ?? ??? ??????, ???-?????? ????? ??????????? ?????????? ???-??????? ????????? ?????????? ??? ?????? GET ? POST-????????. HTML-????? ??? ???????? ?????????? ??? ???????? ????? ????????. ?? ????, HTML-????? ???????????? ????? ???? ??? ???? ??? ????? ?????????? ?? ???-????????. ????????? ???????? HTML-????? ?????? ????? ????? ?????? ? ?????? ??? ??????????? ?? ?????.

HTML-????? ??????????? ? ??????? ??????? ???? form. ???? ??? ????? ??? ????????? ????????: method ? action. ? ???????? method ???????? ??? HTTP-??????? (get ??? post), ? action ????????????? ????????, ?? ???? ???? ? ?????, ?????? ???????? ????? ???????????. ???? ????? ???? ??? ?????????? (? ????????? ?????? ?????), ??? ? ?????????????. ????????:

<form method="get" action="/login.php">
...
</form>

?????????? ????????? ????????? ????? ????????? ??? ????? ??????, ??????? ?????????? ?????? ?????. ???????, ? ???????? ? ????? ?? ??????, ?????????? submit:

<input type="submit" value="?????" />

??????? ???????????? ????? ??????, ??????? ?? ??????? ???????? ? ?????????? HTTP-???????. ??????? value ?????? ??????? ?? ??????. ????? ????? ????????? ????????? ????????? submit. ????? ? ????????????? ????????? ??????????, ?? ????? ?????? ?? ?????? ???? ??????????? ???????, ?????????? ????????? submit ?????????? ???????? name. ????????:

<form method="get" action="/control.php">
  <input type="submit" name="submit" value="Add" />
  <input type="submit" name="submit" value="Edit" />
</form>