• 26-12-2008, 15:15:49
    #1
    arkadaşlar bu bizim hoca bir şey öğretmeden çok şey istiyor. muhtemelen bu sorduğu soruyu yazılıda soracak. yardımcı olabilirmisiniz acaba resimde ekliyorum soruyla ilgili. 4 işlem olacak.

    formdan girilen sayılar açılır kutuda yazan işlemlerden herhangi biri seçildiği takdirde sonucu çıkacak. mantığını kavrayamadım bi türlü deniyorum olmadı. yazılıda çıkacağı içinde mecbur yapmam lazım. bi yardımcı olursanız çok makbule geçer.
  • 26-12-2008, 15:19:05
    #2
    Üyeliği durduruldu
    Sen Denediğin Kadarını Yaz Buraya Gerisi İçin Sana Yardım Ederler.
  • 26-12-2008, 15:19:43
    #3
    Üyeliği durduruldu
    Can't download attachment BEFORE 50 posts
  • 26-12-2008, 15:39:35
    #4
    Üyeliği durduruldu
    index.html yi resimdeki gibi yap ve form.php ye postlat
    form.php de şöyle olsun
    $sayi1 = $_POST['sayi1'];
    $sayi2 = $_POST['sayi2'];
    $islem = $_POST['islem']; // + - * / burada
    if($islem == "+"):
      echo ($sayi1+$sayi2);
    else:
      if($islem == "-"):
         echo ($sayi1-$sayi2);
      else:
         if($islem == "*"):
           echo ($sayi1*$sayi2);
         else:
           echo ($sayi1/$sayi2);
         endif;
      endif;
    endif;
  • 26-12-2008, 15:47:20
    #5
    Üyeliği durduruldu
    İncelersen Yakarlarsın Olayı.
    <form id="metematix" name="metematix" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
      <table width="200" border="1">
        <tr>
          <td width="80">Sayı 1 </td>
          <td width="104">
            <input name="s1" type="text" id="s1" size="9" maxlength="9" />
          </td>
        </tr>
        <tr>
          <td>Sayı 2 </td>
          <td><input name="s2" type="text" id="s2" size="9" maxlength="9" /></td>
        </tr>
        <tr>
          <td>İşlem : </td>
          <td>
            <select name="islem" id="islem">
              <option value="+">Topla</option>
              <option value="*">Çarp</option>
              <option value="/">Böl</option>
              <option value="-">Çıkar</option>
            </select>
          </td>
        </tr>
        <tr>
          <td>Gönder : </td>
          <td>
            <input type="submit" name="Submit" value="Ok'le" />
            <input name="hesapla" type="hidden" id="hesapla" value="evet" />
          </td>
        </tr>
      </table></form>
      <?php 
    error_reporting(E_ALL ^ E_NOTICE); 
    if ((isset($_POST["hesapla"])) && ($_POST["hesapla"] == "evet")) { 
    switch($_POST['islem']) { 
    case"+": $sonuc = $_POST['s1']+$_POST['s2']; break; 
    case"*": $sonuc = $_POST['s1']*$_POST['s2']; break; 
    case"/": $sonuc = $_POST['s1']/$_POST['s2']; break; 
    case"-": $sonuc = $_POST['s1']-$_POST['s2']; break; 
    default: $sonuc = "İşlem Sonucu Bilinmiyor. Daha Doğrusu Senin Ne Yaptığın Bilinmiyor :D";
    } echo "<strong>Sonuc :</strong> $sonuc"; }?>
    Kolay Gelsin

    Semih VURAL.
  • 26-12-2008, 15:58:24
    #6
    evde inceleyeceğim tek tek teşekkür ederim. ellerinize sağlık.
  • 26-12-2008, 16:52:47
    #7
    sorunun çözülmediyse başka bir yere upload et,
    göremiyoruz ne yaızk ki 50 posttan önce