Hello,
I would like to know:
how can I define a variable so its value is higher than 1000 and lower
than 2000
2000 >variable >1000
and which sentence must a "select" have, so that it is able to search
between the values of a column.
Thank you very much for your help.
Best regards,
JoanR
one question
Moderator: General Moderators
If I got the point with "2000 >variable >1000 "http://www.php.net/manual/de/function.rand.php
Code: Select all
$variable = rand(1001, 1999); // after a srand(...) somewherewhat search on what column?so that it is able to search between the values of a column
uh, I have a horrible vision of beeing on a page with <select>-elements each having a thousand options
If it is this you intend to do I beg you to consider at least using something likeor to let the user enter the value in an <input>-element. You have to check the value server-side anyway.
Code: Select all
<html><body>
<form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<select>
<?php
for ($i=1001; $i!=2000; $i++)
echo '<option>', $i, '</option>';
?>
</select>
</body></html>Code: Select all
<html><body>
<form method="GET" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<select name="upper">
<?php
for ($i=10; $i!=20; $i++)
echo '<option>', $i, '</option>';
?>
</select>
<select name="lower">
<?php
for ($i=1; $i!=100; $i++)
echo '<option>', ($i<10)? '0'.$i:$i, '</option>';
?>
</select>
</form>
</body></html>