ziyad ziyad - 7 months ago 43
HTML Question

redirect to another page

hello guys i have this problem that i couldn't solve the thing is i have two buttons one for delete and the other for edit, the delete is working flawlessly, but edit button doesn't seems to work to make it redirect to a php file + how i can get the meeting name with edit button when it's redirect to another page don't know how here's my code

<table class="table table-striped custab" >
<th> Date & Time</th>

$findMeetings = "SELECT * FROM `meeting` WHERE chairman='".$name."'";

$result = mysqli_query($db, $findMeetings);

$numRows = mysqli_num_rows($result);

if($numRows == 0){

$empty = "<div class='alert alert-danger'>You are currently managing no meetings!</div>";


$x = 0;

while($rows = mysqli_fetch_array($result)){

$title = $rows['title'];
$chairman = $rows['chairman'];
$date = $rows['time'];
$summary = $rows['summary'];

$meeting = "
<th><form method='post'>
<input type='submit' class='btn btn-success' name='edit".$x."' value='Edit'/>
<input type='submit' class='btn btn-danger' name='delete".$x."' value='Delete'/>

echo $meeting;


$query = "DELETE FROM meeting WHERE title='".$title."' LIMIT 1";

if($result = mysqli_query($db, $query)){









so how to get the meeting name and the passed it to editmeeting.php cause there's multiple data.

if i do it like delete button nothing happen like this





You should wrap a <form> around each submit button, and specify the action in each <form> so that it posts to the correct url with respect to the button the <form> is wrapped around.

Then use <hidden> fields inside each <form> to pass data to the url you are posing to example: <input type="hidden" name="row_id" value="99" />