HOW TO CONTROL MULTIPLE BUTTONS REFRESHING INPUT VALUES |
HOW TO CONTROL MULTIPLE BUTTONS REFRESHING INPUT VALUES |
shankar from vizag |
May 11 2019, 08:49 AM
Post
#1
|
Advanced Member Group: Members Posts: 202 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) filesearch.php ( 3.52k ) Number of downloads: 723 |
CharlesEF |
May 13 2019, 09:49 PM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Sorry for the delay, I've been out all day. I'll have to look over your code to be sure. It sounds like after you click on the update or delete button, and the code runs, then you are taken back to the main page, in this case the search page. Now the search page comes up blank but you want the original search done again. Is this correct?
If I'm understanding correctly then why not just pass 'frmdate' and '$todate' in the URL. Then rewrite your search code to check for the $_GET values. If found do the search and show the results. If not found then display the empty search page. |
shankar from vizag |
May 14 2019, 09:26 AM
Post
#3
|
Advanced Member Group: Members Posts: 202 Joined: 18-June 13 Member No.: 19,316 |
Sorry for the delay, I've been out all day. I'll have to look over your code to be sure. It sounds like after you click on the update or delete button, and the code runs, then you are taken back to the main page, in this case the search page. Now the search page comes up blank but you want the original search done again. Is this correct? If I'm understanding correctly then why not just pass 'frmdate' and '$todate' in the URL. Then rewrite your search code to check for the $_GET values. If found do the search and show the results. If not found then display the empty search page. Tons of thanks to CHARLES ji for your wonderful guidance. Problem solved. regards |
Lo-Fi Version | Time is now: 18th March 2024 - 11:52 PM |