Issue with webform used for adding and deleting customer names

前端 未结 1 995
死守一世寂寞
死守一世寂寞 2021-01-29 13:02

I\'m trying to create a web form which lists all of the customers and then gives you a text field with a button next to it where you can add customers. Then it should show the l

相关标签:
1条回答
  • 2021-01-29 13:27

    try changing index.php from this:

    <form action="disable_customer.php" method="get"><input type="submit" name="url" value="Disable Customer2"/></form>
    

    to this:

    <form action="disable_customer.php" method="get">
    put the url in here: <input type="text" name="url"/>
    <input type="submit" value="submit"/>
    </form>
    

    If that works - but you don't want the user to be entering their own urls - then you need to read those urls out of the database first:

    Going back to your original code in index.php, change the foreach to output the value of the url into 'value' attribute of the button:

    <?php foreach ($tempArray as $row) : ?>
        <tr>
            <td><?php echo $row; ?></td>
            <td><form action="disable_customer.php" method="get"><input type="submit" name="url" value="<? echo $row['url'] ?>"/></form></td>
        </tr>
    <?php endforeach; ?>
    
    0 讨论(0)
提交回复
热议问题