By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

select

P: n/a
Hi,

I have following problem.

In a form I have a control lsDocent. I want send the value to another page.
He send the second parameter 'code' but he send the string lsDocent to the
other page instead of the value of lsDocent.

What's wrong with this?

<form name="verwijder" action="vak_info.php?doc=lsDocent&&code=<?echo
$code?>" method = "post">
<SELECT name="lsDocent">
<?php
while ($line = mysql_fetch_array($resultaat, MYSQL_ASSOC)) {
?>
<!--
genereren van lijst van docenten
-->
<OPTION selected value="<?print $line["Leraarscode"];?>"><?print
$line["Familienaam"];?> <?print " - "?> <?print
$line["Voornaam"];?></OPTION>

<?php
}
?>
</SELECT>
</td>
<td>
<input type = "submit" Value="OK">
</td>
</form>
</TR>
ALain
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Alain Dhaene <al**********@worldonline.be> wrote:
In a form I have a control lsDocent. I want send the value to another page.
He send the second parameter 'code' but he send the string lsDocent to the
other page instead of the value of lsDocent.

What's wrong with this?
At first glance nothing (except it quite ugly and inconsistent).
<form name="verwijder" action="vak_info.php?doc=lsDocent&&code=<?echo $code?>" method = "post"> ^^ one & to many
<SELECT name="lsDocent"> [snip] <OPTION selected value="<?print $line["Leraarscode"];?>"><?print
$line["Familienaam"];?> <?print " - "?> <?print
$line["Voornaam"];?></OPTION>


What's the output of the script? Is the value realy in the row
'Leraarscode' and not in 'Leraarcode'?

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
The output is
lsDocent and the value of the code e.g A

In the select box I get a row of Stings (the code of a docent). I thought
when I select one of them then the value of lsDocent will retrieve this
value and so I post this value to the other form. But I retrieve the text
lsDocent.

Alain

"Daniel Tryba" <ne****************@canopus.nl> schreef in bericht
news:bp**********@news.tue.nl...
Alain Dhaene <al**********@worldonline.be> wrote:
In a form I have a control lsDocent. I want send the value to another page. He send the second parameter 'code' but he send the string lsDocent to the other page instead of the value of lsDocent.

What's wrong with this?
At first glance nothing (except it quite ugly and inconsistent).
<form name="verwijder" action="vak_info.php?doc=lsDocent&&code=<?echo

$code?>" method = "post"> ^^ one & to many
<SELECT name="lsDocent">

[snip]
<OPTION selected value="<?print $line["Leraarscode"];?>"><?print
$line["Familienaam"];?> <?print " - "?> <?print
$line["Voornaam"];?></OPTION>


What's the output of the script? Is the value realy in the row
'Leraarscode' and not in 'Leraarcode'?

--

Daniel Tryba

Jul 17 '05 #3

P: n/a
Alain Dhaene wrote:
Hi,

I have following problem.

In a form I have a control lsDocent. I want send the value to another page.
He send the second parameter 'code' but he send the string lsDocent to the
other page instead of the value of lsDocent.

What's wrong with this?

<form name="verwijder" action="vak_info.php?doc=lsDocent&&code=<?echo
$code?>" method = "post">
<SELECT name="lsDocent">
<?php
while ($line = mysql_fetch_array($resultaat, MYSQL_ASSOC)) {
?>
<!--
genereren van lijst van docenten
-->
<OPTION selected value="<?print $line["Leraarscode"];?>"><?print
$line["Familienaam"];?> <?print " - "?> <?print
$line["Voornaam"];?></OPTION>

<?php
}
?>
</SELECT>
</td>
<td>
<input type = "submit" Value="OK">
</td>
</form>
</TR>
ALain

I think it is an error in the first line:
<form name="verwijder" action="vak_info.php?doc=<? echo $lsDocent;
?>&&code=<?echo
$code?>" method = "post">
So you must attribute lsDocent in a php script.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.