The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> HOW TO CONTROL MULTIPLE BUTTONS REFRESHING INPUT VALUES
shankar from vizag
post May 11 2019, 08:49 AM
Post #1


Advanced Member
****

Group: Members
Posts: 150
Joined: 18-June 13
Member No.: 19,316



Greetings,

I am having two php pages. 1) filesearch.php 2)filedelete.php

filesearch.php is attached.

<!--filedelete.php contains the following -->
<?php
$link = mysqli_connect("localhost","root","");
mysqli_select_db($link,"stores_bgts");

$id = $_GET['id'];
$q = "DELETE FROM `filetrack` WHERE id = $id";
mysqli_query($link,$q);
header('location:filesearch.php');

?>

In filesearch.php, I had 3 buttons, one is search and the other two are delete and update. while clicking search button, somehow with an input attribute I manage to display input values after search button click. Whereas, clicking on any of the delete, update refreshing the input values. I just want to display the remaining records searched after deleting the opted record. But the delete query executing and redirecting to filesearch.php and there all records searched are refreshed. Kindly guide me to fix this issue. Thanks in advance.


Attached File(s)
Attached File  filesearch.php ( 3.52k ) Number of downloads: 218
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
shankar from vizag
post May 13 2019, 07:43 AM
Post #2


Advanced Member
****

Group: Members
Posts: 150
Joined: 18-June 13
Member No.: 19,316



Greetings.

in detail,

my filesearch.php has 3 buttons.

1. search
2. delete
3. update

the following portion, retaining the input values even after displaying the search items after pressing the search button
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$frmdate=$_POST['frmdate'];
$todate=$_POST['todate'];
?>
</select>
<input type="text" id="myDatepicker" placeholder="Click to pick from date" name = "frmdate" autocomplete="off" value="<?php if(isset($frmdate)) {echo $frmdate;}?>"/> <input type="text" id="myDatepicker2" placeholder="Click to pick to date" name = "todate" autocomplete="off" value="<?php if(isset($todate)) {echo $todate;}?>"/> <br>
<br><input name="search" class="btn btn-primary" type="submit" value="SEARCH"/></center>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

after clicking either delete / update buttons, the code is executing but all the content on the screen disappearing. Kindly guide me in this regard to overcome the issue.

This post has been edited by shankar from vizag: May 13 2019, 07:45 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd August 2019 - 07:28 PM