kendallkamikaze Posted December 17, 2008 Share Posted December 17, 2008 So on my game we're holding a winterfest with 6 rounds...I want each person to be able to enter in a round only 1 time. With the code below people are only able to enter in 1 round, I'm assuming because of "if($num_rows >= 1)" part, but I instead need it to allow them to enter 6 rounds only 1 time each...I have no idea how to code this. If I change "if($num_rows >= 1)" to "if($num_rows >= 6)" it will allow them to enter 1 round, up to 6 times...i need it to specifically allow them to enter 1 round, 1 time. Any ideas? <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows >= 1) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/ Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 I'm new to coding but maybe: <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); if($classtype = breed, age, other, trait, genetics, finale) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-717993 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 how about if you would keep track of rounds for each entry, and check if the "horseid" was entered for that round? Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-717996 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 the rounds are '$classtype' so they are tracked, but im not sure how I would code it to track a horses ID and the Classtype. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718000 Share on other sites More sharing options...
gevans Posted December 17, 2008 Share Posted December 17, 2008 Does every winterfest have it's own id? Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718001 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 code for selecting a horse to enter: <?php include 'header.php'; ?> <table border="0" bordercolor="#ffffff" cellpadding="2" cellspacing="0"> <tbody> <tr> <td></center><div style="height:200px; width:600px; overflow: auto"> <center> <img src="christmas08/winterfestbanner.png"><BR> Select a horse to enter it in <a href="winterfestinfo.php">Winterfest Classes/Information</a><br> <br> <form action='winterfest_ent2.php' method='post'> <select name='horseid'> <?php $sql="SELECT * FROM horsedata WHERE Owner='$id' and DOB < 36"; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $horseid=$r["id"]; $Name=$r["Name"]; $Points=$r["Points"]; echo " <option value='$horseid'>$Name</option>"; } ?> </select> <input type="submit" value="go enter!"> </form> </table> Code for selecting a class/round to enter: <?php include 'header.php'; ?> <table border="0" bordercolor="#ffffff" cellpadding="2" cellspacing="0"> <tbody> <tr> <td></center><div style="width:600px; overflow: auto"> <center> <img src="christmas08/winterfestbanner.png"><BR> <?php $thehorse = $_POST['horseid']; $sql="SELECT * FROM horsedata WHERE id='$thehorse'"; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $horseid=$r['id']; $Name=$r['Name']; $Points=$r['Points']; $winterfest=$r['winterfest']; if($winterfest=='no') { echo " </b><font size='2px'><U>You are entering $horseid - $Name </U></font><br /> <br /> Use the forms below to select winterfest entries for this horse.<BR> You are about to start entering Winterfest Classes. Horses are limited to 1 entry per level.<BR><BR> </center><B>Your horses will be dropped from any classes for being entered into the wrong class.</b> <I>Also if you do have a horse that is a breed that is not listed, enter the 'Purebreds' class. If your breed class is listed and you enter in 'Purebreds' your horse will be disqualified.</I><BR><BR> If you enter a horse into the picture class and do not have a picture for that horse, you will be fined and your horse will lose points.<br /> <br /><center> <form method='post' action='winterfest_enter.php' name='breed'> 1st Round of Classes: Breed classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='breed' name='classtype' type='hidden' /> <select name='classname'> <option>Crossbred</option> <option>Thoroughbred </option> <option>Appaloosa </option> <option>Arabian</option> <option>American Breeds </option> <option>Gaited Breeds</option> <option>Purebreds</option> <option>Stock Breeds</option> <option>Paint</option> <option>Spanish Breeds</option> <option>Warmbloods </option> <option>Quarter Horse </option> <option>Draft Breeds</option> <option>Pony</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='discipline'> 2nd Round of Classes: Discipline classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='discipline' name='classtype' type='hidden' /> <select name='classname'> <option>Racing</option> <option>Eventing </option> <option>Driving </option> <option>Showjumping</option> <option>Halter</option> <option>Rodeo</option> <option>Dressage</option> <option>Saddleseat</option> <option>Reining</option> <option>Western Pleasure</option> <option>Trail</option> <option>Hunter Jumper</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='age'> 3rd Round of Classes: 'Age' classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='age' name='classtype' type='hidden' /> <select name='classname'> <option>Foal [0-1 year old]</option> <option>2 year olds</option> <option>3 year olds</option> <option>4-10 year olds</option> <option>11-22 year olds</option> <option>Veteran</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='trait'> 4th Round of Classes: Trait classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='trait' name='classtype' type='hidden' /> <select name='classname'> <option>Intelligence</option> <option>Speed</option> <option>Power</option> <option>Sociability</option> <option>Scope</option> <option>Obedience</option> <option>Endurance</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='other'> 5th Round of Classes: 'Other' classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='other' name='classtype' type='hidden' /> <select name='classname'> <option>Best Pedigree</option> <option>Best Genetics</option> <option>Best Foal</option> <option>Best Intermediate</option> <option>Best Advanced</option> <option>Best Mare</option> <option>Best Stallion</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='picture'> 6th Round of Classes: Picture class.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='picture' name='classtype' type='hidden' /> <select name='classname'> <option>Best Picture</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> "; } else { echo "Your horse has not qualified for finale classes, sorry!"; } } ?> </table> Code for entering the class info onto the MYSQL <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows >= 1) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718003 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 and yes each class has their own name being put into the mysql winterfest table Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718008 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 if you can only enter one horseid per classtype (per user) try to modify the select query to something like $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid AND classtype = $classtype AND userid = $userid"; if you already have a row with the same horseid and classtype, no insert. A little crude, but hope it works. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718016 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 *woo post 50 im on a roll* ... ignore me so I'm getting: "Unknown column 'discipline' in 'where clause'" Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718018 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 the collums in the winterfest table go: id, horseid, userid, classname, classtype. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718025 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 well somewhere in your script you are using the column discipline, which does not exists in the table where you are looking for it Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718037 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 it inserts 6 different variables into the 'classtype' on the table. discipline is one of them, so is traits, finale, breed, etc. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718044 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 I basically need a code thats like this: <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); if($classtype = breed OR age OR discipline OR picture OR trait OR other) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> i need it to search the sql winterfest table to see if the horses id already has a class...something like this, i know its not functional but yah: if($classtype = breed OR age OR discipline OR picture OR trait OR other) but having it this way only allows you to enter each round once. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718073 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 i tried <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); if($classtype = breed) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } if($classtype = age) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } if($classtype = trait) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } if($classtype = other) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } if($classtype = picture) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } if($classtype = discipline) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> but that just results with allowing 1 entry but repeats the 'You have entered this horse already this round.' Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718079 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 wondering if this code would work? <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; // select entry for user based on horse id and classtype $check_query = "SELECT * FROM winterfest WHERE horseid = $horseid AND classtype = $classtype AND userid = $userid"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); // if there is an entry, display warning if($num_rows >= 1) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { // record entry $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718111 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" I think the issue is because there is a total of 6 entries that will be in the winterfest table but with 'if($num_rows >= 1)' it only allows 1 entry on the table. so it needs to search the table for each classtype. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718114 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 might be just my mistake Correct / replace code for $check_query variable: $check_query = "SELECT * FROM winterfest WHERE horseid = "'".$horseid."'"; It is trying to select empty ( '' ) from the mysql table. So, either the horse id is missing, or it requires single quotes around the variable. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718178 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 i added the quotes and now : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718190 Share on other sites More sharing options...
premiso Posted December 17, 2008 Share Posted December 17, 2008 $horseid is not defined, or whatever variable you are using. Check where it is being set and make sure it is in deed being set. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718193 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 im pretty sure it is defined heres whats on the winterfest mysql file: id horseid userid classname classtype here's the code: <?php include 'header.php'; $horseid = $_POST['horseid']; $userid = $_POST['userid']; $classtype = $_POST['classtype']; $classname = $_POST['classname']; // select entry for user based on horse id and classtype $check_query = "SELECT * FROM winterfest WHERE horseid = '$horseid' AND classtype = $classtype"; $result = mysql_query($check_query) or die(mysql_error()); $num_rows = mysql_num_rows($result); // if there is an entry, display warning if($num_rows >= 1) { echo "<img src='christmas08/winterfestbanner.png'><BR><h1>You have entered this horse already this round.</h1>"; } else { // record entry $sql="INSERT INTO winterfest (horseid, userid, classname, classtype) VALUES ('$horseid','$userid','$classname','$classtype')"; mysql_query($sql) or die(mysql_query()); echo "<img src='christmas08/winterfestbanner.png'><BR><h2>Success! You have entered Winterfest!</h2>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718234 Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 yes, but is it posting it? try to echo out the horseid or the whole post variable to see what is being posted to the script. Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718242 Share on other sites More sharing options...
kendallkamikaze Posted December 17, 2008 Author Share Posted December 17, 2008 <?php include 'header.php'; ?> <table border="0" bordercolor="#ffffff" cellpadding="2" cellspacing="0"> <tbody> <tr> <td></center><div style="width:600px; overflow: auto"> <center> <img src="christmas08/winterfestbanner.png"><BR> <?php $thehorse = $_POST['horseid']; $sql="SELECT * FROM horsedata WHERE id='$thehorse'"; $result=mysql_query($sql); while($r=mysql_fetch_array($result)) { $horseid=$r['id']; $Name=$r['Name']; $Points=$r['Points']; $winterfest=$r['winterfest']; if($winterfest=='no') { echo " </b><font size='2px'><U>You are entering $horseid - $Name </U></font><br /> <br /> Use the forms below to select winterfest entries for this horse.<BR> You are about to start entering Winterfest Classes. Horses are limited to 1 entry per level.<BR><BR> </center><B>Your horses will be dropped from any classes for being entered into the wrong class.</b> <I>Also if you do have a horse that is a breed that is not listed, enter the 'Purebreds' class. If your breed class is listed and you enter in 'Purebreds' your horse will be disqualified.</I><BR><BR> If you enter a horse into the picture class and do not have a picture for that horse, you will be fined and your horse will lose points.<br /> <br /><center> <form method='post' action='winterfest_enter.php' name='$breed'> 1st Round of Classes: Breed classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='$breed' name='classtype' type='hidden' /> <select name='classname'> <option>Crossbred</option> <option>Thoroughbred </option> <option>Appaloosa </option> <option>Arabian</option> <option>American Breeds </option> <option>Gaited Breeds</option> <option>Purebreds</option> <option>Stock Breeds</option> <option>Paint</option> <option>Spanish Breeds</option> <option>Warmbloods </option> <option>Quarter Horse </option> <option>Draft Breeds</option> <option>Pony</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='$discipline'> 2nd Round of Classes: Discipline classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='$discipline' name='classtype' type='hidden' /> <select name='classname'> <option>Racing</option> <option>Eventing </option> <option>Driving </option> <option>Showjumping</option> <option>Halter</option> <option>Rodeo</option> <option>Dressage</option> <option>Saddleseat</option> <option>Reining</option> <option>Western Pleasure</option> <option>Trail</option> <option>Hunter Jumper</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='$age'> 3rd Round of Classes: 'Age' classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='$age' name='classtype' type='hidden' /> <select name='classname'> <option>Foal [0-1 year old]</option> <option>2 year olds</option> <option>3 year olds</option> <option>4-10 year olds</option> <option>11-22 year olds</option> <option>Veteran</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='$trait'> 4th Round of Classes: Trait classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='$trait' name='classtype' type='hidden' /> <select name='classname'> <option>Intelligence</option> <option>Speed</option> <option>Power</option> <option>Sociability</option> <option>Scope</option> <option>Obedience</option> <option>Endurance</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='$other'> 5th Round of Classes: 'Other' classes.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='$other' name='classtype' type='hidden' /> <select name='classname'> <option>Best Pedigree</option> <option>Best Genetics</option> <option>Best Foal</option> <option>Best Intermediate</option> <option>Best Advanced</option> <option>Best Mare</option> <option>Best Stallion</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> <form method='post' action='winterfest_enter.php' name='$picture'> 6th Round of Classes: Picture class.<br /> <br /> <input value='$horseid' name='horseid' type='hidden' /> <input value='$id' name='userid' type='hidden' /><input value='$picture' name='classtype' type='hidden' /> <select name='classname'> <option>Best Picture</option> </select> <input value='enter!' type='submit' /></form> <br /> <br /> "; } else { echo "Your horse has not qualified for finale classes, sorry!"; } } ?> </table> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718292 Share on other sites More sharing options...
redarrow Posted December 17, 2008 Share Posted December 17, 2008 Is ur form suppose to be like this... yes ive deleted a lot but your form never made sence to me sorry.... <?php if(isset($_POST['submit'])){ foreach($_POST['classname'] as $result){ echo "$result <br>"; } } ?> <?php echo" <form method='POST' action='multi.php'> 1st Round of Classes: Breed classes.<br /> <br /> <select name='classname[]'> <option>Crossbred</option> <option>Thoroughbred </option> <option>Appaloosa </option> <option>Arabian</option> <option>American Breeds </option> <option>Gaited Breeds</option> <option>Purebreds</option> <option>Stock Breeds</option> <option>Paint</option> <option>Spanish Breeds</option> <option>Warmbloods </option> <option>Quarter Horse </option> <option>Draft Breeds</option> <option>Pony</option> </select> <br /> <br /> 2nd Round of Classes: Discipline classes.<br /> <br /> <select name='classname[]'> <option>Racing</option> <option>Eventing </option> <option>Driving </option> <option>Showjumping</option> <option>Halter</option> <option>Rodeo</option> <option>Dressage</option> <option>Saddleseat</option> <option>Reining</option> <option>Western Pleasure</option> <option>Trail</option> <option>Hunter Jumper</option> </select> <br /> <br /> 3rd Round of Classes: 'Age' classes.<br /> <br /> <select name='classname[]'> <option>Foal [0-1 year old]</option> <option>2 year olds</option> <option>3 year olds</option> <option>4-10 year olds</option> <option>11-22 year olds</option> <option>Veteran</option> </select> <br /> <br /> 4th Round of Classes: Trait classes.<br /> <br /> <select name='classname[]'> <option>Intelligence</option> <option>Speed</option> <option>Power</option> <option>Sociability</option> <option>Scope</option> <option>Obedience</option> <option>Endurance</option> </select> <br /> <br /> 5th Round of Classes: 'Other' classes.<br /> <br /> <select name='classname[]'> <option>Best Pedigree</option> <option>Best Genetics</option> <option>Best Foal</option> <option>Best Intermediate</option> <option>Best Advanced</option> <option>Best Mare</option> <option>Best Stallion</option> </select> <br /> <br /> 6th Round of Classes: Picture class.<br /> <br /> <select name='classname[]'> <option>Best Picture</option> </select> <br> <br> <input type='submit' name='submit' value='SEND!' /> </form> "; ?> Quote Link to comment https://forums.phpfreaks.com/topic/137408-solved-need-help-with-allowing-multiple-enteries/#findComment-718339 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.