开发者

How to properly check if an html textbox is empty

开发者 https://www.devze.com 2023-01-11 07:21 出处:网络
I always get the undefined index notice, when I run this on wampserver. Tried doing some research before going here, and I integrated the code into this, but still no luck. Please help.

I always get the undefined index notice, when I run this on wampserver. Tried doing some research before going here, and I integrated the code into this, but still no luck. Please help.

<?php 
    if(!empty($_GET['lurl']) || ($_GET['lclass']) || ($_GET['lnotes'])) {

    $url=$_GET['lurl'];
    $clas=$_GET['lclass'];
    $notez=$_开发者_如何学运维GET['lnotes'];



    $sql="CALL geturl('$url')";
    $result1=mysql_query($sql);

    ?>

                <center>

    <table border="1">

    <thead>
        <tr>
        <th>URL</th>
        <th>CLASS</th>
        <th>NOTES</th>
        </tr>
    </thead>


    <?php
    while($row=mysql_fetch_assoc($result1)){


    ?>


        <tbody>
                <tr>
            <td><?php echo $row['URL']; ?></td>
            <td><?php echo $row['Class']; ?></td>
            <td><?php echo $row['Notes']; ?></td>

                </tr>
            </tbody>

    <?php } ?>
    <?php } ?>


At 1st line

if(!empty($_GET['lurl']) || ($_GET['lclass']) || ($_GET['lnotes']))

Must be

if(!empty($_GET['lurl']) || !empty($_GET['lclass']) || !empty($_GET['lnotes']))

Reference for empty function http://php.net/manual/en/function.empty.php

0

精彩评论

暂无评论...
验证码 换一张
取 消