Jump to content

Seaholme

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by Seaholme

  1. Hi, I'm struggling to solve what seems to be potentially quite a simple problem with my form! It's for a really basic web-based racing game, and basically the issue is that in the form, the option I've named "teamid" isn't sending any information forwards so $newteamid in the next section is always =0, which is the default in the MySQL database. I just don't know how to set it! I want the team id from the first part to send through into the second part. Is it possible to have the value of a form option set to being a variable like this?? //Find their teams and let them pick which team to use $findteams = mysql_query("SELECT * FROM team WHERE owner='$id'") or die(mysql_error()); echo "Select which team to race with:<br><form action='regional.php' method=post> <select name=teamid value=teamid> Team:"; while($row = mysql_fetch_array( $findteams )) { $teamid = $row['id']; echo "<option name=teamid value={$row['id']}>{$row['teamname']}</option>"; } echo '</select>'; echo "<bR><br>Is your team ready to go?<br><br><input type=submit name='stage1' value='Begin Race!'></form><br><br>"; if(isset($_POST['stage1'])) { $_POST['teamid'] = $newteamid; echo $newteamid; $startrace = @mysql_query("INSERT INTO regionals (teamid, stage, ownerid) VALUE ('$newteamid', '1', '$id')") or die("Error: ".mysql_error()); Please let me know if I need to explain or elaborate at all, I'd appreciate any help. Thanks guys!
  2. I apologise in advance if this is a simple question, but essentially I have a forum with the following code: if($a_answer == '') die("You must enter in a reply!"); And my problem is that when nobody enters a reply and it does default to the die option, that nothing subsequent to the die command shows up on the page below it, including the footer of the website, which leaves the whole thing looking very unprofessional. Is there a way to add the website footer into the 'die' command? (I've tried and failed). Or should I be using a different command from die that's more suited to what I'm trying to achieve? The footer is attached to the page via an include command. Any suggestions gratefully received!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.