swich.php

<form name="form1" method="post" action="">
  <p>1) <a href="?test=andrey">?test=andrey</a></p>
  <p>1.1) <a href="?test=andrey&p=yes">?test=andrey&amp;p=yes</a></p>
  <p>1.1.1) <a href="?test=andrey&p=yes&c=com">?test=andrey&amp;p=yes&amp;c=com</a></p>
  <p>2) <a href="?test=id">?test=id</a></p>
</form>


<?php 
switch($test) { 
case "andrey":          
echo '@andrey@<br>'; // јдрес: ?test=andrey
if ($p=='yes') {
	echo'@yes@<br>';  // јдрес: ?test=andrey&p=yes
 if ($c=='com') {
 echo'@com@';  // јдрес: ?test=andrey&p=yes&c=com
 }
}
break;
case "id":
echo 'id';  // јдрес: ?test=id
}
?>
Теги:
switch, case, break
Добавлено: 11 Апреля 2018 07:34:55 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...