IPB

Google Frontpage Forums Unattended CD/DVD Guide
 
Reply to this topicStart new topic
> help with php script, checkboxes to query a sql
smartie91
post Jan 1 2008, 02:39 PM
Post #1


Member
**

Group: Members
Posts: 173
Joined: 20-October 03
From: Peterborough,England
Member No.: 8338
Country Flag


please help


what i need to do is to have a list of 8 checkbuttons with a maxinum of 3 buttons being checked when
you click a combinations of 3 buttons i wont then to connect to my Sql database and produce a query
of the 3 and display in a html page.

i hope i have made this clear and thanks for your help

smartie91
Go to the top of the page
 
+Quote Post
ripken204
post Jan 1 2008, 09:15 PM
Post #2


The Hardware Guy
**********

Group: Members
Posts: 6113
Joined: 23-December 04
From: Rochester, New York
Member No.: 39158
OS: Vista Ultimate x64
Country Flag


can you at least make some code for the checkboxes so that we can see what you are talking about?
Go to the top of the page
 
+Quote Post
smartie91
post Jan 6 2008, 04:37 PM
Post #3


Member
**

Group: Members
Posts: 173
Joined: 20-October 03
From: Peterborough,England
Member No.: 8338
Country Flag


sorry for the deley in getting back

this is basically what i need but instead of going to a webpage i need to query a database if you click on tennis and
football and boxing to find all collages that does tennis and football and boxing 3 will be the maxium of sports you could choose

CODE
<?php
if ($_POST['tennis']=="1" OR $_POST['reading']=="1" OR $_POST['basketball']=="1" OR $_POST['boxing']=="1" OR $_POST['football']=="1" OR $_POST['cricket']=="1") {
if ($_POST['tennis']=="1" AND $_POST['reading']=="1" AND $_POST['boxing']=="1") {
header('Location: http://www.tennisreadingandboxing.com');
}
if ($_POST['tennis']=="1" AND $_POST['reading']=="1") {
header('Location: http://www.tennisandreading.com');
}
} else {
?>
<form id="myform" class="cssform" action="<?php echo $SERVER['PHP_SELF']; ?>" method="POST">
<p>
<label for="comments">Hobbies:</label><br>
<input type="checkbox" value="1" name="tennis" class="threepxfix" /> Tennis<br />
<input type="checkbox" value="1" name="reading" class="threepxfix" /> Reading <br />
<input type="checkbox" value="1" name="basketball" class="threepxfix" /> Basketball <br />
<input type="checkbox" value="1" name="boxing" class="threepxfix" /> Boxing<br />
<input type="checkbox" value="1" name="football" class="threepxfix" /> Football<br />
<input type="checkbox" value="1" name="cricket" class="threepxfix" /> Cricket <br />
</p>
<div style="margin-left: 150px;">
<input type="submit" value="Submit">
<input type="reset" value="reset" />
</div>

</form>
<?php
}
?>
Go to the top of the page
 
+Quote Post
ripken204
post Jan 6 2008, 07:19 PM
Post #4


The Hardware Guy
**********

Group: Members
Posts: 6113
Joined: 23-December 04
From: Rochester, New York
Member No.: 39158
OS: Vista Ultimate x64
Country Flag


well do you have a database yet? i can easily write the query code but i would need to know how it is all structured..
Go to the top of the page
 
+Quote Post
smartie91
post Jan 7 2008, 02:22 AM
Post #5


Member
**

Group: Members
Posts: 173
Joined: 20-October 03
From: Peterborough,England
Member No.: 8338
Country Flag


thankyou

yes we have a temporary one at the moment to see if we can do this i could pm you the password and name if you like

thanks again

smartie91
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

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: 4th December 2008 - 11:23 AM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy