hidden

From: Date: Wed, 10 Oct 2001 16:08:00 +0000
Subject: hidden
Groups: php.general 
Request: Send a blank email to php-general+get-70689@lists.php.net to get a copy of this message
Hi everyone, I am trying to pass a variable called $username to the next page. I do not want to use a session so I am using an Input type "hidden", but its not working. Can anyone tell me why and how to make it work? Thank you. <? session_start(); //session_register("username"); $db_name = "hpool"; $connection = @mysql_connect("localhost", "hpool", "cdi986") or die("Couldn't connect."); $db = @mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql="SELECT users.accounts FROM users LEFT JOIN picks ON users.uid = picks.user_uid WHERE picks.user_uid IS NULL and users.killed ='off' and users.username = '$username' order by users.username "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); while ($row = mysql_fetch_array($result)) { $accounts = $row['accounts']; $option_block .= "<option value=\"$accounts\">$accounts</option>"; } $display_block = " <FORM METHOD=\"post\" ACTION=\"show_add_a_pick2.php\"> <P><strong>User:</strong> <select name=\"accounts\"> $option_block </select> <INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Select this User\"></P> <INPUT TYPE="hidden" name="username" value="<? echo "$username"; ?>"> </form> "; ?> <HTML> <HEAD> <TITLE>User Management: Add a Pick</TITLE> </HEAD> <BODY> <h1>User Management</h1> <h2><em>Add a Pick</em></h2> <P>Select an account from the list below to proceed.</p> <? echo "$display_block"; ?> <p><a href="contact_menu4.php" onmouseover="window.status='Return to Main Menu';return true;" target="">Return to Main Menu</a></p> </BODY> </HTML>

« previous php.general (#70689) next »