Re: remote call - no return

From: Date: Wed, 21 May 2003 21:15:25 +0000
Subject: Re: remote call - no return
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148449@lists.php.net to get a copy of this message
> On Thursday 22 May 2003 04:53, Thomas Hochstetter wrote: > > Yes. Well, here is the scipt that is called to return the id ... maybe > it > > does not return: > > > > [snip] > > $file = "v.txt"; > > $data = $QUERY_STRING; > > > > function writevars($data,$file) > > { > > $fp = fopen ($file,"w"); // opens file for reading + writing > > if ($fp) //if the file exists (should always) > > { > > fputs($fp, $data); > > } > > fclose($fp); > > } > > > > writevars($data,$file); > > $id = md5(rand(2,12)); > > ==> return $id; > > [snip] > > I don't think 'return' does anything meaningful outside of a function. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz Well, i thought so too. I saw that in the manual though. So how should the function return stuff then, that will also be catable by the intervace script? like that? [snip] function writevars($data,$file) { $fp = fopen ($file,"w"); if ($fp) { fputs($fp, $data); $id = md5(rand(2,12)); } return $id; fclose($fp); } writevars($data,$file); [snip] -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!

« previous php.general (#148449) next »