Re: Carrying a variable

From: Date: Tue, 15 Jul 2003 10:04:12 +0000
Subject: Re: Carrying a variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-155265@lists.php.net to get a copy of this message
Hi :) It's really simpel //$Unit = ($_GET['Unit']); //... //echo "<FORM METHOD=POST ACTION=basefull.php>"; You use "post" as method and then you want to read your value with $_GET - that couldnt't work - you must use $_POST. ->$Unit = ($_POST['Unit']); Greetings from Germany Kristin Schesonka > 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 (#155265) next »