Jump to content

Php Code Desteği


Recommended Posts

 

Ben Durum diye bir bölüm oluşturdum ama tck.ini'ide gecti yazarsam geçti kodunu getirsin kaldı yazarsam KALDI kodunu getirsin istiyorum

B2A8yv.png

 

Alıntı

 

<center><!DOCTYPE html>
<html lang="tr">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Ajax Best Practice</title>
        <link href="scr/bootstrap.min.css" rel="stylesheet">
        <style type="text/css">
            .container {width: 820px;}
        </style>
        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
            <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="container">
            <div class="page-header">
                <br><h1 class="text-center">TCK Sorgulama</h1>
            </div>
            <div class="row">
                <div class="col-lg-9">
                    <br><center><form action="index.php" method="get" class="form-inline">
                        <div class="form-group">
                            <input type="text" name="num" class="form-control" placeholder="TC Giriniz" autofocus="autofocus">
                        </div>
                        <center><div class="form-group"></div>
                        <br><button type="submit" class="btn btn-primary">Sorgula</button>
                    </form>
    
                    </form>
                </div>
            </div>
            <br><br>
            <?php
            if (isset($_GET["num"]) && strlen($_GET["num"]) > 3)
            {
                echo '<table border="1" width="70%">
                <th>TCK No</th>
                <th>İsim</th>
                <center><th>Soyisim</th>
                
                <th>Durum</th>';                 
                $ini = "tck.ini";
                $tck = $_GET["num"];
                
                $ini_array = parse_ini_file($ini, true); // ini dosyasını tara
                
                // döngüye sok
                foreach($ini_array as $key => $val)
                {
                    if (strpos($key, $tck) !== false) // eğer sıradaki tck no metninin içinde gönderilen değer varsa verileri yazdır
                    {                
            ?>
                        <tr>
                            <td><?php echo $key; ?></td>
                            <td><?php echo $ini_array[$key]['isim']; ?></td>
                            <td><?php echo $ini_array[$key]['soyisim']; ?></td>
 <td><b><font color="red"><?php echo $ini_array[$key]['Durum']; ?></td>
 <b><font color="green"><?php echo $ini_array[$key]['Durum']; ?></td>

</font>    <b>                    </tr>
            <?php
                    }
                }
            }
            
            ?>
        </table>
        </div>

        <script src="scr/jquery.js"></script>
        <script src="scr/bootstrap.min.js"></script>
        <script src="scr/script.js"></script>
    </body>
</html>

 

 

 

Alıntı

<!DOCTYPE html>
<html lang="tr">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Ajax Best Practice</title>
        <link href="scr/bootstrap.min.css" rel="stylesheet">
        <style type="text/css">
            .container {width: 820px;}
        </style>
        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
            <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="container">
            <div class="page-header">
                <h1 class="text-center">TCK Sorgulama</h1>
            </div>
            <div class="row">
                <div class="col-lg-9">
                    <form action="index.php" method="get" class="form-inline">
                        <div class="form-group">
                            <input type="text" name="num" class="form-control" placeholder="Numara giriniz.." autofocus="autofocus">
                        </div>
                        <div class="form-group"></div>
                        <button type="submit" class="btn btn-primary">Sorgula</button>
                    </form>
    
                    </form>
                </div>
            </div>
            <br><br>
            <?php
            if (isset($_GET["num"]) && strlen($_GET["num"]) > 3) // eğer form gönderilmişse ve gonderilen karakter sayısı 3 ten büyükse
            {
                echo '<table border="1" width="70%">
                <th>TCK No</th>
                <th>İsim</th>
                <th>Soyisim</th>
                <th>Durum</th>'; // tablo başlığını yazdır
                
                $ini = "tck.ini"; // ini yolu
                $tck = $_GET["num"]; // giriş yapılan tck no
                
                $ini_array = parse_ini_file($ini, true); // ini dosyasını tara
                
                // döngüye sok
                foreach($ini_array as $key => $val)
                {
                    if (strpos($key, $tck) !== false) // eğer sıradaki tck no metninin içinde gönderilen değer varsa verileri yazdır
                    {                
            ?>
                        <tr>
                            <td><?php echo $key; ?></td>
                            <td><?php echo $ini_array[$key]['isim']; ?></td>
                            <td><?php echo $ini_array[$key]['soyisim']; ?></td>
                            <font color="#renk"><td><?php echo $ini_array[$key]['Durum']; ?></td>
                        </tr>
            <?php
                    }
                }
            }
            
            ?>
        </table>
        </div>

        <script src="scr/jquery.js"></script>
        <script src="scr/bootstrap.min.js"></script>
        <script src="scr/script.js"></script>
    </body>
</html>

 

 

Sorun düzelmiştir.

Edited by MostWanted
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...