Jump to content

BoklSh333

New Members
  • Posts

    7
  • Joined

  • Last visited

BoklSh333's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I found out the issue has nothing to do with my code, when i took the forum and moved it to an empty PHP page along with the html and php code and everthing it worked fine, its only in this particular page that it did not work
  2. I did that recently and still no luck 😕 Thanks for the help though
  3. 1. I don't see the PHP code when i do view source 2. Yes 3. Leaving out that parameter didn't change anything, still got the same issue 4. What do you mean by validate all inputs before using them? can i get an example if thats okay 5. Yeah, i was trying to check for an error but nothing would come up, i would manually check the database itself to see if the row got deleted and it wouldn't get deleted. 6. Oh, so how do i do that, can i get an example? sorry im new to php
  4. The button one is commented out, pretend its not there. Im using the input tag where the type is submit and the name is remove
  5. 1. Sorry my bad, that was the old code, i changed it to _POST ages ago and still no luck 2. Again, Sorry my bad again, $del is $result, forgot to change it, still no luck 3. I cant use prepared statements because the user is meant to input what ID they want to delete, but even when i set the ID manually myself, lets say '110" it still doesn't work, it doesn't enter the php function at all EDIT: btw, the form is part of a much bigger section section tag along with other forms if that helps
  6. Hello, I have this PHP and HTML code and i recently figured out, it doesn't even enter the PHP function to execute and i have no idea whats wrong <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" id="trashy"> <table id="RemoveItem"> <tr> <b><label for="Itemid">Enter the item ID you want to delete : </label></b> <input type="number" name="Iid"><br><br> </tr> <tr> <td></td> <td></td> <td></td> <td> <!-- <button type="button" class="button1" name="remove" type="submit" href="AdministratorPanel.php?click=1">Remove</button> --> <input id="btn-login" class="btn btn-success" style="right: 50px;" type="submit" name="remove" value="remove"> </td> </tr> </table> </form> <?php if($_SERVER["REQUEST_METHOD"] == "POST") { if(isset($_POST['remove'])) { $ido = $_GET['Iid']; $result = mysqli_query($conn, "DELETE FROM productinfo WHERE ID = '$ido'") or die ("error"); if($del) { echo "success deleting record"; } else { echo "Error deleting record"; // display error message if not delete } } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.