Ask a Question related to Dreamweaver AppDev, Design and Development.
-
PapiYoni #1
Dynamic List/Menu Passing Variables
New to Dreamweaver. Using DreamWeaverMX 6.1. I am trying to create a page
that the user can select an item from a drop down menu using Dynamic List/Menu
and pass it onto another page that will pull up a the detail about that
records. I've worked around this for days and the only variable it passes is
the first item in the list, no matter which list is selected. Any help would
be appreciated.........
Code is as follows
:confused;
<?php require_once('../../Connections/IMH.php'); ?>
<?php
mysql_select_db($database_IMH, $IMH);
$query_rsSumbit = "SELECT JobPostID, JobTitle FROM AppRecords";
$rsSumbit = mysql_query($query_rsSumbit, $IMH) or die(mysql_error());
$row_rsSumbit = mysql_fetch_assoc($rsSumbit);
$totalRows_rsSumbit = mysql_num_rows($rsSumbit);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="testapplicants.php?recordID=<?php
echo $row_rsSumbit['JobPostID'] ?>">
<select name="select">
<?php
do {
?>
<option value="<?php echo $row_rsSumbit['JobPostID']?>"><?php echo
$row_rsSumbit['JobTitle']?></option>
<?php
} while ($row_rsSumbit = mysql_fetch_assoc($rsSumbit));
$rows = mysql_num_rows($rsSumbit);
if($rows > 0) {
mysql_data_seek($rsSumbit, 0);
$row_rsSumbit = mysql_fetch_assoc($rsSumbit);
}
?>
</select>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
<?php
mysql_free_result($rsSumbit);
?>
DETAIL PAGE
?php require_once('../../Connections/IMH.php'); ?>
<?php
$colname_rsRecords = "1";
if (isset($HTTP_GET_VARS['recordID'])) {
$colname_rsRecords = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['recordID'] :
addslashes($HTTP_GET_VARS['recordID']);
}
mysql_select_db($database_IMH, $IMH);
$query_rsRecords = sprintf("SELECT * FROM AppRecords WHERE JobPostID = '%s'",
$colname_rsRecords);
$rsRecords = mysql_query($query_rsRecords, $IMH) or die(mysql_error());
$row_rsRecords = mysql_fetch_assoc($rsRecords);
$totalRows_rsRecords = mysql_num_rows($rsRecords);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border="1">
<tr>
<td>JobPostID</td>
<td>JobTitle</td>
<td>AppID</td>
<td>AppName</td>
<td>BeginWork</td>
<td>ReferredBy</td>
<td>ReferredByOther</td>
<td>FullTime</td>
<td>PartTime</td>
<td>PartTimeNB</td>
<td>Regular</td>
<td>Temp</td>
<td>Intermit</td>
<td>Shifts</td>
<td>USWorkStatus</td>
<td>Convict</td>
<td>ConvictDetails</td>
<td>PrevApp</td>
<td>PrevEmployed</td>
<td>PrevEmpTime</td>
<td>PrevEmpDept</td>
<td>Relatives</td>
<td>Signature</td>
<td>SignatureDate</td>
<td>DateSubmitted</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rsRecords['JobPostID']; ?></td>
<td><?php echo $row_rsRecords['JobTitle']; ?></td>
<td><?php echo $row_rsRecords['AppID']; ?></td>
<td><?php echo $row_rsRecords['AppName']; ?></td>
<td><?php echo $row_rsRecords['BeginWork']; ?></td>
<td><?php echo $row_rsRecords['ReferredBy']; ?></td>
<td><?php echo $row_rsRecords['ReferredByOther']; ?></td>
<td><?php echo $row_rsRecords['FullTime']; ?></td>
<td><?php echo $row_rsRecords['PartTime']; ?></td>
<td><?php echo $row_rsRecords['PartTimeNB']; ?></td>
<td><?php echo $row_rsRecords['Regular']; ?></td>
<td><?php echo $row_rsRecords['Temp']; ?></td>
<td><?php echo $row_rsRecords['Intermit']; ?></td>
<td><?php echo $row_rsRecords['Shifts']; ?></td>
<td><?php echo $row_rsRecords['USWorkStatus']; ?></td>
<td><?php echo $row_rsRecords['Convict']; ?></td>
<td><?php echo $row_rsRecords['ConvictDetails']; ?></td>
<td><?php echo $row_rsRecords['PrevApp']; ?></td>
<td><?php echo $row_rsRecords['PrevEmployed']; ?></td>
<td><?php echo $row_rsRecords['PrevEmpTime']; ?></td>
<td><?php echo $row_rsRecords['PrevEmpDept']; ?></td>
<td><?php echo $row_rsRecords['Relatives']; ?></td>
<td><?php echo $row_rsRecords['Signature']; ?></td>
<td><?php echo $row_rsRecords['SignatureDate']; ?></td>
<td><?php echo $row_rsRecords['DateSubmitted']; ?></td>
</tr>
<?php } while ($row_rsRecords = mysql_fetch_assoc($rsRecords)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($rsRecords);
?>
PapiYoni Guest
-
Passing Dynamic XML variables from CF Fusebox 3
Oh help and thanks in advance! I am converting a standard CF site to a Fusebox 3 site (encorporating it into Fusebox). I am using a DW Flash... -
passing dynamic variables
Am creating a video library using a database to store the url links to the videos - how do I pass a variable selection from one html page to another... -
Stumped on Dynamic List/Menu
I keep posting hoping that someone will have an answer to this stumper: I want to show a product (wooden hanger) with one image, one name, and one... -
Passing the value of a Dynamic List
Hi all - not sure what I am missing here, however I would like to pass the option value of my list to the desired URL within my on-change event. I... -
Multiple Dynamic List Menu Help
Hello. I'm a programming novice and I'm trying to create a two dynamically populated list and or jump menus. I'd like there to be a parent / child... -
gareth #2
Re: Dynamic List/Menu Passing Variables
Ok,
On the first page, you have for the form action:
<form name="form1" method="post" action="testapplicants.php?recordID=<?php
echo $row_rsSumbit['JobPostID'] ?>">
So the form submits to testapplicants.php?recordID = 24 for example. The
recordID will always be the first one in the recordset. You need to remove
this, and just have:
<form name="form1" method="post" action="testapplicants.php">
On the detail form, to read the variable youre using
$HTTP_GET_VARS['recordID'], which read the record ID from the url, not from
the actual form itself. Change this to:
$HTTP_POST_VARS['select']
Where select is the name of your dropdown, and it should work.
--
Gareth - TMM Dreamweaver
[url]http://www.dreamweavermxsupport.com/[/url]
[url]http://www.garethdp.com/[/url]
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
[url]http://www.phploginsuite.co.uk/[/url]
Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
Co-Author: Practical Intranet Development - Apress
Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
Co-Author: Dreamweaver MX: PHP Web Development - Wrox
gareth Guest
-
PapiYoni #3
Re: Dynamic List/Menu Passing Variables
:D Thanks so much for the info-------I will post on here again and much sooner. It work great!
PapiYoni Guest
-
chuckomalley #4
Re: Dynamic List/Menu Passing Variables
Don't forget to mark his response as the answer so we can all benefit from his
wisdom, as you can search for answered questions only on the search page and it
makes it so much easier to find good info that way.
Cheers
Chuck
chuckomalley Guest



Reply With Quote

