Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Forum De Bell Tolls > no randomizer? no party
Pages (2): [1] 2 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
no randomizer? no party

ecco lo script php incriminato

<?
$img=rand(1,8);
print ("<img src=\"images/".$img.".jpg\"></img>");
?>

fondamentalmente dovrebbe visualizzare un'immagine diversa ad ogni apertura della pagina....

problema...non funzona una mazza... lui randoimizza una volta ( la prima) e poi non c'è maniera di randomizzare un bel ca@@o di niente...

qualcuno ha voglia di dirmi come risolvo sto problema? Anche cancellando la cache del browser non si randomizza nulla...
denghiu
.f

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

18-02-2003 17:50
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Mino
In pensione :)

User info:
Registered: Mar 2002
Posts: 2997 (0.35 al dì)
Location: Dublin!
Corso: Informatica 3ennale
Anno: Laureato :)
Time Online: 12 Days, 2:11:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

che versione di php c'hai? prima della 4.2 c'è bisogno di usare srand per inizializzare.

altrimenti usa mt_rand() (è un consiglio stupido in realtà, non avresti grandi benefici se è solo per caricare una immagine a caso)

altrimenti voto per un problema di cache (?)

cmq http://www.php.net/manual/en/function.rand.php

__________________
icq: 57553717 - mail: mino@ngi.it - web: www.minux.it - Fattori Arcani

18-02-2003 17:56
Click Here to See the Profile for Mino Click Here to See the Blog of Mino Visit Mino's homepage! Find more posts by Mino Add Mino to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

php 4.0....

provo con srand....te faccio sapé....

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

18-02-2003 18:37
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Mino
In pensione :)

User info:
Registered: Mar 2002
Posts: 2997 (0.35 al dì)
Location: Dublin!
Corso: Informatica 3ennale
Anno: Laureato :)
Time Online: 12 Days, 2:11:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

DEVI usare srand

__________________
icq: 57553717 - mail: mino@ngi.it - web: www.minux.it - Fattori Arcani

18-02-2003 18:40
Click Here to See the Profile for Mino Click Here to See the Blog of Mino Visit Mino's homepage! Find more posts by Mino Add Mino to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

fatto...risultato uguale...cache?

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

19-02-2003 09:56
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lorenzo
...ma anche no.

User info:
Registered: Jun 2002
Posts: 3149 (0.38 al dì)
Location: Milano
Corso: F49
Anno: 00000011
Time Online: 49 Days, 1:47:46 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Come hai usato la srand()? Cioè, con che seme l'hai inizializzata?


Prova con l'esempio della guida del PHP:

PHP:

// seed with microseconds
function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$randval = rand();

19-02-2003 10:20
Click Here to See the Profile for lorenzo Click Here to See the Blog of lorenzo Click here to Send lorenzo a Private Message Visit lorenzo's homepage! Find more posts by lorenzo Add lorenzo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by lorenzo

PHP:

// seed with microseconds
function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$randval = rand();

[/B]


uhm...io semplicemente srand(1)

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

19-02-2003 10:29
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.13 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Bella roba il php!!

:sbocco:

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

19-02-2003 11:27
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

[mode flame=on]
ERETICO!!! ALLE ARMI!!!!
[mode flame=off]

scusa cosa useresti? ASP???? MUAHAHAHAHA!

non ho parole per certi commenti..

giusto per consocenza.. il vBullettin che stai usando esiste grazie a php...

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

19-02-2003 12:39
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Mino
In pensione :)

User info:
Registered: Mar 2002
Posts: 2997 (0.35 al dì)
Location: Dublin!
Corso: Informatica 3ennale
Anno: Laureato :)
Time Online: 12 Days, 2:11:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

fabpicca: beh, se usi come seme una costante non cambierà mai nulla :)

ripe: ma lol

__________________
icq: 57553717 - mail: mino@ngi.it - web: www.minux.it - Fattori Arcani

19-02-2003 12:57
Click Here to See the Profile for Mino Click Here to See the Blog of Mino Visit Mino's homepage! Find more posts by Mino Add Mino to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Mino
fabpicca: beh, se usi come seme una costante non cambierà mai nulla :)

ripe: ma lol


che pirla che sono...evabbè...

tencs

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

19-02-2003 17:30
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
AlphaGamma
.piano ma pieni.

User info:
Registered: Jun 2002
Posts: 6732 (0.80 al dì)
Location:
Corso: Eh?
Anno: Io cosa?
Time Online: 21 Days, 21:22:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Bello il PHP (ho appena comprato un manuale di programmazione... io i documenti a video mi rompo a leggerli, devo avere il libro stampato). Poi mi piace l'idea dell'open source, secondo me si impara prima e meglio.

Una domanda: che differenza c'e' tra php 4.2 e 4.0, spiegato in termini non nerd?

__________________
Attenzio', concentrazio', ritmo e VITALITÀ

19-02-2003 19:08
Click Here to See the Profile for AlphaGamma Click Here to See the Blog of AlphaGamma Click here to Send AlphaGamma a Private Message Visit AlphaGamma's homepage! Find more posts by AlphaGamma Add AlphaGamma to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.13 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Non mi piace il php... basta! Dov'è l'xml in php?

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

19-02-2003 19:21
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fozzy
apprentice monk

User info:
Registered: May 2002
Posts: 1968 (0.23 al dì)
Location: Bollate (MI)
Corso: SA-299
Anno: primo...di studio "serio"
Time Online: 10 Days, 10:57:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

XML? :sbocco:
cmq ce lo puoi mettere
1-1 palla al centro

e poi perche' dici basta se poi continui tu?

utilita' del tuo post critico che non ammette riposte?

mah...

__________________
I sense much NT in you, NT leads to Blue Screens,
Blue Screens lead to downtime, downtime leads to suffering.

NT is the path to the Dark Side....

19-02-2003 22:59
Click Here to See the Profile for fozzy Click here to Send fozzy a Private Message Visit fozzy's homepage! Find more posts by fozzy Add fozzy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.13 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by fozzy
XML? :sbocco:
cmq ce lo puoi mettere
1-1 palla al centro

e poi perche' dici basta se poi continui tu?

utilita' del tuo post critico che non ammette riposte?

mah...


Intendevo... il php non mi piace e basta! Non basta alla discussione!

XML ce lo puoi anche mettere mi sembra un pò esagerata come affermazione: ce lo puoi mettere, ma non è supportato, non è integrato e soprattutto non è al passo coi tempi!

Potrà anche non piacerti, ma ce lo insegnano a scuola e personalmente credo che faccia parte del futuro!

P.S.: xml non piace neanche a me! :D

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

22-02-2003 09:39
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 22:18.    Post New Thread    Post A Reply
Pages (2): [1] 2 »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.096 seconds (69.89% PHP - 30.11% MySQL) con 22 query.