Page 1 of 1
one question
Posted: Thu Mar 13, 2003 2:50 pm
by jrts
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
Posted: Thu Mar 13, 2003 3:05 pm
by volka
If I got the point with "2000 >variable >1000 "
Code: Select all
$variable = rand(1001, 1999); // after a srand(...) somewhere
http://www.php.net/manual/de/function.rand.php
so that it is able to search between the values of a column
what search on what column?
Posted: Thu Mar 13, 2003 3:20 pm
by jrts
thanks for your fast reply
this variable is for use in a html form, the form have a list/menu with different values and each value is between two numbers.
sorry but I don't write english very well
thx
Posted: Thu Mar 13, 2003 3:43 pm
by daven
If you have any code written, post it here so we can look at it.
Posted: Thu Mar 13, 2003 4:52 pm
by volka
uh, I have a horrible vision of beeing on a page with <select>-elements each having a thousand options
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>
If it is this you intend to do I beg you to consider at least using something like
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>
or to let the user enter the value in an <input>-element. You have to check the value server-side anyway.
Posted: Thu Mar 13, 2003 4:53 pm
by JPlush76
volka you should start charging for code writing services

Posted: Thu Mar 13, 2003 4:58 pm
by volka
I already do
But not here. Take the example codes as my deep regret for what I sell!
Or take it from this point of view: If I can avoid e.g. a site with thousand <option>-entries... a site I might vist... woohoo

Posted: Thu Mar 13, 2003 5:01 pm
by JPlush76
lol
