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 > [PHP] problema da newbie
Pages (2): [1] 2 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Dodo
lunatico

User info:
Registered: Jul 2002
Posts: 2340 (0.27 al dì)
Location: in una fibra ottica
Corso: Com Dig
Anno: 3+1 :P
Time Online: 42 Days, 7:55:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Unhappy [PHP] problema da newbie

premettendo che oggi ho iniziato a guardare PHP quindi non vi scandalizzate per la "complessità" del codice :asd:

PHP:
 
<?php
function addFive$num )
     {
     
$num += 5;
     }
$orignum 10;
addFive(&$orignum);
print( 
$orignum );
?>



non riesco a capire perchè mi da il seguente problema:



Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of addfive(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in c:\programmi\easyphp1-7\www\prova1.php on line 12
15


quale può esser il problema.. il codice è preso da un libro tra l'altro quindi non so spiegarmi cosa può essere

__________________
E' meglio essere ottimisti ed avere torto piuttosto che pessimisti ed avere ragione.

Albert Einstein

10-05-2004 19:09
Click Here to See the Profile for Dodo Click Here to See the Blog of Dodo Click here to Send Dodo a Private Message Find more posts by Dodo Add Dodo 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.10 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 conosco il php, ma dal messaggio di errore mi pare di capire che il problema stia nel fatto che stai passando alla funzione addFive un parametro per riferimento, e non per valore (cosa che a quanto pare non si può fare...). Prova a vedere come si può passare il parametro num per valore (ad esempio in ASP si fa facendo precedere al nome del parametro le parole chiave ByRef o ByVal).

E' solo un consiglio teorico perchè non conosco il php... magari ti è utile lo stesso! ;)

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

10-05-2004 19:15
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
ripe
- up in the mountains -

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

Post actions:

Edit | Report | IP: Logged

addFive($orignum);

Forse la modifica giusta è questa... :?

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

10-05-2004 19:15
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
holylaw
.grande:maestro.

User info:
Registered: Feb 2003
Posts: 3142 (0.38 al dì)
Location: milano
Corso: Magistrale Informatica
Anno: bella domanda
Time Online: 88 Days, 5:30:09: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Re: [PHP] problema da newbie

la & per il passaggio per referenza delle variabili bisogna metterlo nel prototipo della funzione, non quando chiami la funzioni....

PHP:
 
<?php
function addFive( &$num )
     {
     
$num += 5;
     }
$orignum 10;
addFive($orignum);
print( 
$orignum );
?>

__________________
La mia epoca ed io non siamo fatti l'uno per l'altro:questo è chiaro. Ma è da vedere chi di noi due vincerà il processo di fronte al tribunale dei posteri.
AV MJØDEN VART DU VIS OG KLOK, SÅ DREKKA MER!!!!
Le persone sagge parlano perché hanno qualcosa da dire.
Le persone sciocche perché hanno da dire qualcosa.

10-05-2004 19:42
Click Here to See the Profile for holylaw Click Here to See the Blog of holylaw Click here to Send holylaw a Private Message Find more posts by holylaw Add holylaw to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
korn
SET FIRE!

User info:
Registered: Jun 2002
Posts: 5793 (0.67 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: 1°! ....fuori corso :(
Time Online: 37 Days, 5:56:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

code:
<?php function addFive( $num ) { return $num += 5; } $orignum = 10; $orignum = addFive($orignum); print( $orignum ); ?>

__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.

10-05-2004 20:02
Click Here to See the Profile for korn Click Here to See the Blog of korn Click here to Send korn a Private Message Visit korn's homepage! Find more posts by korn Add korn to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
DeepBlue
tired guy

User info:
Registered: Sep 2003
Posts: 4258 (0.52 al dì)
Location: CSN
Corso: Info tlc
Anno:
Time Online: 52 Days, 8:40:31 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by korn
code:
<?php function addFive( $num ) { return $num += 5; } $orignum = 10; $orignum = addFive($orignum); print( $orignum ); ?>

:approved:
Ci vuole anche il return, se no la funzione se lo mangia
Le funzioni sono bastarde :ihihih:

__________________
~ get Debian! ~ get FreeBSD! ~ get OpenBSD! ~

10-05-2004 20:05
Click Here to See the Profile for DeepBlue Click Here to See the Blog of DeepBlue Click here to Send DeepBlue a Private Message Find more posts by DeepBlue Add DeepBlue to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
holylaw
.grande:maestro.

User info:
Registered: Feb 2003
Posts: 3142 (0.38 al dì)
Location: milano
Corso: Magistrale Informatica
Anno: bella domanda
Time Online: 88 Days, 5:30:09: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

boh io ho provato sia come ha detto Dodo, sia come ho detto io e vanno tutte e 2....

__________________
La mia epoca ed io non siamo fatti l'uno per l'altro:questo è chiaro. Ma è da vedere chi di noi due vincerà il processo di fronte al tribunale dei posteri.
AV MJØDEN VART DU VIS OG KLOK, SÅ DREKKA MER!!!!
Le persone sagge parlano perché hanno qualcosa da dire.
Le persone sciocche perché hanno da dire qualcosa.

10-05-2004 20:06
Click Here to See the Profile for holylaw Click Here to See the Blog of holylaw Click here to Send holylaw a Private Message Find more posts by holylaw Add holylaw 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.78 al dì)
Location:
Corso: Eh?
Anno: Io cosa?
Time Online: 21 Days, 21:22:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Se dovete chiamarlo per indirizzo, scrivete a korn@dsy.it
Se dovete chiamarlo per valore, chiamatelo Maestro.

:D

(ok è vecchia)

__________________
Attenzio', concentrazio', ritmo e VITALITÀ

11-05-2004 00:27
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
JaM
######

User info:
Registered: Jun 2002
Posts: 3604 (0.42 al dì)
Location: everywhere, anywhere, elsewhere...
Corso: ComDig
Anno: dott.??
Time Online: 62 Days, 16:55:46 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Alpha sei un nerdaccio :asd:

cmq korn rulez! ;)

11-05-2004 08:37
Click Here to See the Profile for JaM Click Here to See the Blog of JaM Click here to Send JaM a Private Message Visit JaM's homepage! Find more posts by JaM Add JaM to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
korn
SET FIRE!

User info:
Registered: Jun 2002
Posts: 5793 (0.67 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: 1°! ....fuori corso :(
Time Online: 37 Days, 5:56:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

:rotfl:

__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.

11-05-2004 08:38
Click Here to See the Profile for korn Click Here to See the Blog of korn Click here to Send korn a Private Message Visit korn's homepage! Find more posts by korn Add korn to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Dodo
lunatico

User info:
Registered: Jul 2002
Posts: 2340 (0.27 al dì)
Location: in una fibra ottica
Corso: Com Dig
Anno: 3+1 :P
Time Online: 42 Days, 7:55:56 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

grazie a tutti, grazie korn :D

__________________
E' meglio essere ottimisti ed avere torto piuttosto che pessimisti ed avere ragione.

Albert Einstein

11-05-2004 10:40
Click Here to See the Profile for Dodo Click Here to See the Blog of Dodo Click here to Send Dodo a Private Message Find more posts by Dodo Add Dodo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Angra
.arcimaestro.

User info:
Registered: Jan 2004
Posts: 390 (0.05 al dì)
Location: Varese
Corso: Comunicazione Digitale
Anno: Basta basta!Finito!Stop!
Time Online: 49 Days, 19:30:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Una domanda... in quale corso di Com.Dig studieremo PhP?

Grazie

11-05-2004 10:44
Click Here to See the Profile for Angra Click here to Send Angra a Private Message Find more posts by Angra Add Angra 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.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Nessuno? :asd:

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

11-05-2004 11:02
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
korn
SET FIRE!

User info:
Registered: Jun 2002
Posts: 5793 (0.67 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: 1°! ....fuori corso :(
Time Online: 37 Days, 5:56:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Angra
Una domanda... in quale corso di Com.Dig studieremo PhP?

Grazie


Nessuno.

Potresti provare con TecWeb, ma non è un corso di PHP, ti parla delle tecnologie web in generale e mi pare che la nuova edizione sia orientata maggiormente verso XML e compagnia bella.

Però se hai fatto Java (o conosci il C) non avrai problemi a impararlo da solo, come impostazione è simile.

__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.

11-05-2004 11:05
Click Here to See the Profile for korn Click Here to See the Blog of korn Click here to Send korn a Private Message Visit korn's homepage! Find more posts by korn Add korn to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Angra
.arcimaestro.

User info:
Registered: Jan 2004
Posts: 390 (0.05 al dì)
Location: Varese
Corso: Comunicazione Digitale
Anno: Basta basta!Finito!Stop!
Time Online: 49 Days, 19:30:01: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Non ci sono neanche corsi Fse?

11-05-2004 11:28
Click Here to See the Profile for Angra Click here to Send Angra a Private Message Find more posts by Angra Add Angra to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 13:13.    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.152 seconds (78.38% PHP - 21.62% MySQL) con 22 query.