Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Przypisywanie losowej liczby do zmiennej
Adiqus
post
Post #1





Grupa: Zarejestrowani
Postów: 28
Pomógł: 1
Dołączył: 27.01.2009

Ostrzeżenie: (0%)
-----


Jak przypisac losową liczbę (której przedział sam okreslasz) do zmiennej (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

Próbowałem kodu w stylu:

  1. ...
  2. </head>
  3. <form atcion="jakis_plik.php" method="POST">
  4. <input type="text" name="min">
  5. <input type="text" name="max">
  6. <input type="submit" value="Wyslij">
  7. </form>
  8. </body>
  9. </html>


  1. <?php
  2.  
  3. $max=$_POST['max'];
  4. $min=$_POST['min'];
  5.  
  6. $liczba=rand($min, $max);
  7.  
  8. ?>


Jak probuje wyswietlic za pomoca echo zmienna $liczba to mi sie pokazuje 0 ...

Ten post edytował Adiqus 28.01.2009, 18:44:46
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Lion_87
post
Post #2





Grupa: Zarejestrowani
Postów: 850
Pomógł: 120
Dołączył: 15.02.2007
Skąd: Łódź

Ostrzeżenie: (10%)
X----


hee a jesteś pewnien że post jest w ()(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) a nie przypadkiem [](IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

i to tez zle
Cytat
mothod


Ten post edytował Lion_87 28.01.2009, 18:36:45
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 09:25