m_stamp_catalog.php
File
filter option not work can you find what happend
I checked the uploaded file. m_stamp_catalog.php
From this file alone, the filter logic in m_stamp_catalog.php is actually correct. The problem is likely not in this file, but in how the filter pages (m_year.php, m_countries.php, m_thems.php) send the selected values back.
1. Filter tabs don't actually filter
Your tabs only redirect:
document.querySelectorAll('.filter-tab').forEach(tab => {
tab.addEventListener('click', function() {
const link = this.getAttribute('data-link');
if (link) {
window.location.href = link;
}
});
});
They only open
m_year.php
m_countries.php
m_thems.php
They never set
?year=
?country=
?theme=
so no filtering happens.
2. The PHP filter only works if GET parameters exist
Your PHP expects
$year = $_GET['year'] ?? '';
$country = $_GET['country'] ?? '';
$theme = $_GET['theme'] ?? '';
and later
WHERE
s.year = :year
or
LOWER(c.name)=LOWER(:country)
or
LOWER(t.name)=LOWER(:theme)
If the URL is
m_stamp_catalog.php
nothing is filtered.
It must become something like
m_stamp_catalog.php?year=2024
or
m_stamp_catalog.php?country=Sri Lanka
3. Hidden fields don't help
These hidden inputs
only preserve existing values.
They never change.
4. Theme page filename looks suspicious
I noticed
data-link="m_thems.php"
Is that filename really
m_thems.php
or should it be
m_themes.php
If the filename is wrong, the Theme filter will never work.
5. Theme filter can fail because of GROUP BY
Since you're joining
LEFT JOIN stamp_themes st
LEFT JOIN themes t
then
GROUP BY s.id
filtering generally works, but if a stamp has multiple themes, I usually recommend using
WHERE EXISTS (
SELECT 1
FROM stamp_themes st2
JOIN themes t2 ON st2.theme_id=t2.id
WHERE st2.stamp_id=s.id
AND LOWER(t2.name)=LOWER(:theme)
)
This avoids duplicate/grouping issues.
6. Check these URLs
Try manually opening:
m_stamp_catalog.php?year=2020
m_stamp_catalog.php?country=Sri Lanka
m_stamp_catalog.php?theme=Birds
If these work, then the problem is definitely in your filter pages, not in m_stamp_catalog.php.
I need these files to find the exact bug:
m_year.php
m_countries.php
m_thems.php (or m_themes.php if that's the correct name)
Those files are almost certainly where the filter value is not being passed back to m_stamp_catalog.php.
can you regenarate this file
I’ll regenerate the PHP file with the filter flow fixed, keeping your existing design and search suggestions intact. I’ll make the filter tabs preserve current search and point users to the correct filter selection pages.
Thought for 53s
Regenerated fixed file:
Download m_stamp_catalog_fixed.php
Important: rename it to m_stamp_catalog.php after backup. Also make sure your theme page filename is m_themes.php; I fixed the old m_thems.php typo.
d_stamp_catalog.php
File
same eroor of this not work
I see the desktop catalog file now. I’ll check the exact form action, reset link, JavaScript selector bugs, and regenerate the file with those fixed.
Thought for 43s
Fixed regenerated file:
Download d_stamp_catalog_fixed.php
Main problem in your uploaded file: form action/reset still used stamp_catalog.php, not the current file, so filters may submit to the wrong page. I fixed that and improved filter submit/suggestions. d_stamp_catalog.php
m_stamp_catalog.php File filter option not work can you find what happend I checked the uploaded file. m_stamp_catalog.php From this file alone, the filter logic in m_stamp_catalog.php is actually correct. The problem is likely not in this file, but in how the filter pages (m_year.php, m_countries.php, m_thems.php) send the selected values back. 1. Filter tabs don't actually filter Your tabs only redirect: document.querySelectorAll('.filter-tab').forEach(tab => { tab.addEventListener('click', function() { const link = this.getAttribute('data-link'); if (link) { window.location.href = link; } }); }); They only open m_year.php m_countries.php m_thems.php They never set ?year= ?country= ?theme= so no filtering happens. 2. The PHP filter only works if GET parameters exist Your PHP expects $year = $_GET['year'] ?? ''; $country = $_GET['country'] ?? ''; $theme = $_GET['theme'] ?? ''; and later WHERE s.year = :year or LOWER(c.name)=LOWER(:country) or LOWER(t.name)=LOWER(:theme) If the URL is m_stamp_catalog.php nothing is filtered. It must become something like m_stamp_catalog.php?year=2024 or m_stamp_catalog.php?country=Sri Lanka 3. Hidden fields don't help These hidden inputs only preserve existing values. They never change. 4. Theme page filename looks suspicious I noticed data-link="m_thems.php" Is that filename really m_thems.php or should it be m_themes.php If the filename is wrong, the Theme filter will never work. 5. Theme filter can fail because of GROUP BY Since you're joining LEFT JOIN stamp_themes st LEFT JOIN themes t then GROUP BY s.id filtering generally works, but if a stamp has multiple themes, I usually recommend using WHERE EXISTS ( SELECT 1 FROM stamp_themes st2 JOIN themes t2 ON st2.theme_id=t2.id WHERE st2.stamp_id=s.id AND LOWER(t2.name)=LOWER(:theme) ) This avoids duplicate/grouping issues. 6. Check these URLs Try manually opening: m_stamp_catalog.php?year=2020 m_stamp_catalog.php?country=Sri Lanka m_stamp_catalog.php?theme=Birds If these work, then the problem is definitely in your filter pages, not in m_stamp_catalog.php. I need these files to find the exact bug: m_year.php m_countries.php m_thems.php (or m_themes.php if that's the correct name) Those files are almost certainly where the filter value is not being passed back to m_stamp_catalog.php. can you regenarate this file I’ll regenerate the PHP file with the filter flow fixed, keeping your existing design and search suggestions intact. I’ll make the filter tabs preserve current search and point users to the correct filter selection pages. Thought for 53s Regenerated fixed file: Download m_stamp_catalog_fixed.php Important: rename it to m_stamp_catalog.php after backup. Also make sure your theme page filename is m_themes.php; I fixed the old m_thems.php typo. d_stamp_catalog.php File same eroor of this not work I see the desktop catalog file now. I’ll check the exact form action, reset link, JavaScript selector bugs, and regenerate the file with those fixed. Thought for 43s Fixed regenerated file: Download d_stamp_catalog_fixed.php Main problem in your uploaded file: form action/reset still used stamp_catalog.php, not the current file, so filters may submit to the wrong page. I fixed that and improved filter submit/suggestions. d_stamp_catalog.php Library / d_stamp_catalog.php More actions 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
I’ll make a stronger fix now: instead of sending users to separate filter pages, I’ll add Year/Country/Theme dropdown filters directly inside m_stamp_catalog.php, so the mobile page can filter by itself.
Thought for 44s
Yes. The real issue: mobile file has no actual filter controls. It only opens separate pages, so year/country/theme values are not submitted.
I regenerated a stronger fixed version with dropdown filters inside the same page:
Download fixed mobile file
Use it as:
m_stamp_catalog.php
This version fixes:
Year/Country/Theme filters directly on mobile page
Auto-submit when dropdown changes
Reset button
Theme filter using safer EXISTS
Keeps your search suggestions
Original file checked: m_stamp_catalog.php
Library
/
d_stamp_catalog.php
More actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61