Wich bir anahtar yapısı içinde çıkış html için doğru yolu nedir?
Ben de feryat, hiçbiri iş denedim:
<?php
switch($x){
case "a":
$var = <<< EOM;
...the html...
EOM;
break;
case "b":
...some code...
break;
}
?>
OR
case "a":
?>
...the html...
<?php
break;
case "b":
...some code...
break;
}
?>
Daha fazla bilgi:
switch ($_REQUEST['act']){
case 'editdiretorio':
$sql="select * from diretorio where did=$_GET[edit]";
$row=mysql_fetch_assoc(mysql_query($sql));
?>
<h1>Cadastro de Serviço</h1>
<form id="fdiretorio" method="post" action="diretorioconfirm.php">
<?php if($edit){echo "<input name='act' type='hidden' value='update'>";?>
Nome completo de quem preenche o questionário:<br />
<input type="text" name="dnome" class="form-default" style="width:200px;" value="<?php echo "$row[dnome]";?>"/>
<br />
... Daha fazla kod 400 satır ...
<?php
break;
case "b":
... other code ...