This is really the same problem I'm trying to resolve in this thread - but to avoid confusion that one is using the same page, whereas this one is about how to pass the results through to a separate results page.
As before, I currently have :
a table Candidates :
CandidateID (primary key, autonumber)
FirstName
LastName
etc
A table Profiles :
ProfileID (primary key, autonumber)
CandidateID (integer)
And an interlinking table CandidateProfiles :
CandidateID (integer)
ProfileID (integer)
So if the CandidateProfiles table looks like :
1, 2
1, 4
1, 6
2, 2
2, 5
2, 6
3, 1
3, 6
4, 2
4, 3
4, 5
4, 6
I'd want to have a search form with a checkbox for each Profile, and if checkboxes 2, 5, and 6 were checked to return a results page listing Candidates 2 and 4, because they have matching Profiles 2, 5 and 6.
So I have a search page with various checkboxes :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SearchTechUK - technical recruitment consultancy specialising in the aviation aerospace industry - current vacancies</title>
</head>
<body>
<div id="wrapper">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="Images/bannerTop.png" alt="Aviation vacancies"></td>
</tr>
<tr>
<td><div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="homepage.htm" id="current">Home</a></li>
<li><a href="client.htm">Client Services</a></li>
<li><a href="candidate.htm">Candidate Services</a></li>
<li><a href="vacancies.htm">Vacancies</a></li>
<li><a href="psychometric.htm">Psychometric Services</a></li>
<li><a href="contact.htm">Contact Us</a></li>
</ul>
</div></td>
</tr>
<tr>
<td><img src="Images/bannerBottom.png" alt="Technical aviation vacancies" border="0"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" valign="top">Search for a candidate by selecting from the profiles below. </td>
</tr>
<tr>
<td width="59%" valign="top"> </td>
<td width="41%" valign="top"> </td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
<tr>
<td colspan="2" valign="top"><form name="form1" method="POST" action="profilesearchresults.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%" valign="middle"><input name="profiles[1]" type="checkbox" class="tickbox"></td>
<td width="22%">A1</td>
<td width="3%" valign="middle"><input name="profiles[5]" type="checkbox" class="tickbox"></td>
<td width="22%">757</td>
<td width="3%" valign="middle"><input name="profiles[9]" type="checkbox" class="tickbox"></td>
<td width="22%">Sales Engineer </td>
<td width="3%" valign="middle"> </td>
<td width="22%"> </td>
</tr>
<tr>
<td valign="middle"><input name="profiles[2]" type="checkbox" class="tickbox"></td>
<td>B1</td>
<td valign="middle"><input name="profiles[6]" type="checkbox" class="tickbox"></td>
<td>767</td>
<td valign="middle"><input name="profiles[10]" type="checkbox" class="tickbox"></td>
<td>Simulator Engineer </td>
<td valign="middle"> </td>
<td> </td>
</tr>
<tr>
<td valign="middle"><input name="profiles[3]" type="checkbox" class="tickbox"></td>
<td>737 Classic </td>
<td valign="middle"><input name="profiles[7]" type="checkbox" class="tickbox"></td>
<td>TA319</td>
<td valign="middle"><input name="profiles[11]" type="checkbox" class="tickbox"></td>
<td>Technical Instructor </td>
<td valign="middle"> </td>
<td> </td>
</tr>
<tr>
<td valign="middle"><input name="profiles[4]" type="checkbox" class="tickbox"></td>
<td>737 NG </td>
<td valign="middle"><input name="profiles[8]" type="checkbox" class="tickbox"></td>
<td>TA330</td>
<td valign="middle"><input name="profiles[12]" type="checkbox" class="tickbox"></td>
<td>Technical Support</td>
<td valign="middle"> </td>
<td> </td>
</tr>
<tr>
<td colspan="8"><input type="submit" name="Submit" value="Search">
<input type="reset" name="Reset" value="Reset form"></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td colspan="2" valign="top"> </td>
</tr>
</table>
</div>
</body>
</html>
But what I'm not sure about is how to pass through the selected checkboxes and then what the query should be in the results page.
Someone did post in the other thread a query of :
SELECT * FROM Candidates, CandidateProfiles WHERE Candidates.CandidateID = CandidateProfiles.CandidateID AND CandidateProfiles.ProfileID IN(' . implode(',', $_POST['profiles']) . ')
But it was within some PHP code - I tried it in my results page, but it wasn't liking it somewhere.
This is the very last bit of functonality I'm trying to add to this project, so if anyone could point me in the right direction here it would be hugely appreciated.
Cheers,
Iain