Carrying a variable

From: Date: Tue, 15 Jul 2003 09:55:20 +0000
Subject: Carrying a variable
Groups: php.general 
Request: Send a blank email to php-general+get-155261@lists.php.net to get a copy of this message
I am using PHP 4.3.0 The way that I usually carry variables from one page to another is $Unit = ($_GET['Unit']); This is the page that is referencing it! <?PHP echo "<br><br>"; $DBName = "SIGO"; $table1 = "sigo"; include 'drop.php'; $db = mysql_connect("$DBhost","$DBuser","$DBpass") or die("Problem connecting"); mysql_select_db("$DBName") or die("Problem selecting database"); $query = "SELECT distinct (Unit) FROM $table1"; $result = mysql_query($query) or die ("Query failed"); //let's get the number of rows in our result so we can use it in a for loop $numofrows = mysql_num_rows($result); echo "<FORM METHOD=POST ACTION=basefull.php>"; echo "<center>"; echo "<select name=Unit>"; for($i = 0; $i < $numofrows; $i++) { $row = mysql_fetch_array($result); //get a row from our result set echo "<option>".$row['Unit']."\n"; } echo "</select>"; echo "<BR><br>"; echo "<INPUT TYPE=submit value=Submit>"; echo "</center>"; ?> Oviously this isn't working.....any clues as to why I can't carry the variable?

« previous php.general (#155261) next »