Jump to content

Simple Form Submission Doesn't Work


makamo66

Recommended Posts

The file test2.php consists of these simple forms:

<?php

for($i=0; $i<=5; $i++){

echo "<form action='reset4.php' method='get' name='yourForm'>";

echo "<button type='submit' value='delete' name='remove_" . $i . "' class='deletebtn'>X</button>";

echo "</form>";

}

?>

It submits to reset4.php which is this simple code:

<?php
header("Location: test2.php");
exit;


for($i=0; $i<=5; $i++){
if (isset($_REQUEST["remove_$i"])){
echo "Deleted";
}}

?>

But it doesn't work. The $_REQUEST doesn't populate the address field and it apparently never gets submitted to reset4.php like it should. This is such a simple program, I can't imagine why it doesn't work. 

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.

Loading...
×
×
  • Create New...