Reply to An HTML Form, a hidden form field, and a dropdown box

Your name:

Reply:


Posted by Sky High on 02/24/06 00:46

Hi Guys,
Hope you can give me some pointers, you're my last resort before all my hair
falls out! ;-)
The problem is this.

I bought a script, EZUpload, which works great, but my question is about
HTML \ PHP.

The code is below, but I have read a database, put the contents into a
dropdown list box, and then am trying to pass the dropdown value to another
script page to read it as a $POST variable echo $_POST['theuser']

For some reason it doesn't pass it across, and I guess I've been looking at
the screen too long to realise how obvious it probably is.

I'm guessing, but does it need Javascript to make the hidden field the same
value as the dropdown box or ? I'm baffled.

Any help appreciated, it's sending me crazy!

Best Regards,
Paul



<?php
// START OF CODE
$hostname_xchange = "xxxxxxxxxxxxxxx";
$database_xchange = "xxxxxxxxxxxxxxxx";
$username_xchange = "xxxxxxxxxxxxxxxxxxx";
$password_xchange = "xxxxxxxxxxxxxxxxxxxx";
$xchange = mysql_pconnect($hostname_xchange, $username_xchange,
$password_xchange) or trigger_error(mysql_error(),E_USER_ERROR);

?>

<?php
mysql_select_db($database_xchange, $xchange);
$query_customerlist = "SELECT id, name, email FROM ezu_users";
$customerlist = mysql_query($query_customerlist, $xchange) or
die(mysql_error());
$row_customerlist = mysql_fetch_assoc($customerlist);
$totalRows_customerlist = mysql_num_rows($customerlist);
// END OF CODE
?>

<table border="0" cellspacing="0" cellpadding="2">
<SCRIPT SRC="<?=$sitepath?>checkfields.php" LANGUAGE="JavaScript"></SCRIPT>
<form name="uploadfrm" method="post" action="<?=$_SERVER['PHP_SELF']?>"
enctype="multipart/form-data" onSubmit="return checkfields(uploadfrm);">

<div align="center"<label>Select Customer to Upload to: <select
name="customerlist" title="<?php echo $row_customerlist['name']; ?>">
<?php
do {
?>
Select Customer Name <option value="<?php echo
$row_customerlist['name']?>"><?php echo $row_customerlist['name']?></option>
<?php
} while ($row_customerlist = mysql_fetch_assoc($customerlist));
$rows = mysql_num_rows($customerlist);
if($rows > 0) {
mysql_data_seek($customerlist, 0);
$row_customerlist = mysql_fetch_assoc($customerlist);
}
?>
</select></label></div><br />

<input type="hidden" name="formurl" value="<?=$_SERVER['PHP_SELF']?>">
<input type="hidden" name="MAX_FILE_SIZE" value="<?=$maxsize?>">
<input type="hidden" name="mode" value="upload">
<input type="hidden" name="theuser" value="<? $row_customerlist['name']?>">

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация