[PHP-DB] Passing selection to next page

2002-12-19 Thread Alex Francis
I have a drop down list created using the following code and am having
trouble passing my selection to the next page. Can anyone help?

?
$query = select distinct department from courses order by department;
$result = mysql_query($query);

echo SELECT ID='Category Combo Box' NAME='department';
echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;

While ($row = mysql_fetch_assoc($result))
{
   echo OPTION VALUE=';
   echo stripslashes($row[department]);
   echo ' ;
   echo stripslashes($row[department]);
   echo /OPTION;
}

echo /SELECT;
mysql_free_result($result);
?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Passing selection to next page

2002-12-19 Thread Snijders, Mark

I guess this all is in a form

so on the next page it should be in:

echo $_POST[department];

or in

echo $department   depending on the php version





-Original Message-
From: Alex Francis [mailto:[EMAIL PROTECTED]]
Sent: donderdag 19 december 2002 12:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Passing selection to next page


I have a drop down list created using the following code and am having
trouble passing my selection to the next page. Can anyone help?

?
$query = select distinct department from courses order by department;
$result = mysql_query($query);

echo SELECT ID='Category Combo Box' NAME='department';
echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;

While ($row = mysql_fetch_assoc($result))
{
   echo OPTION VALUE=';
   echo stripslashes($row[department]);
   echo ' ;
   echo stripslashes($row[department]);
   echo /OPTION;
}

echo /SELECT;
mysql_free_result($result);
?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Passing selection to next page

2002-12-19 Thread xxx xxxx
Hi,
you have to put this list in a form...
form name=select_name action=eval.php method=post
select
option
/select
/form

in eval.php you may write like:
$variable1=$_POST['select_name'];
//and variable1 is now the option_value selected

echo $variable1;

where option_value is the value written in the list...generated by php
if I have a list with 4 values like:
option value=onevalue number one-first/option
option value=twovalue number two -second/option
option value=threevalue number three -third/option
option value=fourvalue number four fourth/option

here the option_value is one or two or three or four

so variable1 is now passed from one page to another..

if you have any questions or you are of a different opinion write to me again

cybercop78


On Thu, 19 Dec 2002 11:04:34 -, Alex Francis wrote
 I have a drop down list created using the following code and am 
 having trouble passing my selection to the next page. Can anyone help?
 
 ?
 $query = select distinct department from courses order by department;
 $result = mysql_query($query);
 
 echo SELECT ID='Category Combo Box' NAME='department';
 echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;
 
 While ($row = mysql_fetch_assoc($result))
 {
echo OPTION VALUE=';
echo stripslashes($row[department]);
echo ' ;
echo stripslashes($row[department]);
echo /OPTION;
 }
 
 echo /SELECT;
 mysql_free_result($result);
 ?
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





http://www.idilis.ro - Stiri, e-mail gratuit, download,
SMS, server de counter-strike, hosting gratuit, servicii internet...
Fii cu un pas inaintea celorlati!


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php