Re: [PHP] Problem with functions and arrays...

2010-11-22 Thread Jason Pruim
On Nov 21, 2010, at 4:57 PM, Tamara Temple wrote: On Nov 20, 2010, at 5:31 PM, Jason Pruim wrote: ?PHP function ddbYear($name, $message, $_POST, $option){ Maybe it's just me, but using the name of a global as a function parameter just seems like a bad idea. Yes, you can do it. Should

Re: [PHP] Problem with functions and arrays...

2010-11-21 Thread Tamara Temple
On Nov 20, 2010, at 5:31 PM, Jason Pruim wrote: ?PHP function ddbYear($name, $message, $_POST, $option){ Maybe it's just me, but using the name of a global as a function parameter just seems like a bad idea. Yes, you can do it. Should you? I think not. Especially, as, you are passing

[PHP] Problem with functions and arrays...

2010-11-20 Thread Jason Pruim
Hey Everyone! So I came across a problem that I don't know how to fix... I have searched and thought and just not having anything click as to where I am messing up... I have a few functions as follows: ?PHP function ddbYear($name, $message, $_POST, $option){ //Make sure to post form

RE: [PHP] problem calling functions

2007-10-20 Thread Zoltán Németh
2007. 10. 19, péntek keltezéssel 11.33-kor Jay Blanchard ezt írta: [snip] ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1' or $function ==

Re: [PHP] problem calling functions

2007-10-20 Thread Robin Vickery
On 19/10/2007, afan pasalic [EMAIL PROTECTED] wrote: Robin Vickery wrote: On 19/10/2007, afan pasalic [EMAIL PROTECTED] wrote: hi I have a problem with calling functions: ?php function solution1($var1){ // some code } function solution2($var2){ // some

Re: [PHP] problem calling functions

2007-10-19 Thread Stut
Jay Blanchard wrote: I don't think you can put a function name in a variable and call it like $function($var). Yes you can - it's basically the same as variable variables. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
yup! it works perfect. obviously, it's MY fault. :-) thanks stut -afan Stut wrote: afan pasalic wrote: actually, what example you are talking about? I got jay's example only? http://dev.stut.net/php/varfunc.php -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] problem calling functions

2007-10-19 Thread Stut
afan pasalic wrote: actually, what example you are talking about? I got jay's example only? http://dev.stut.net/php/varfunc.php -Stut -- http://stut.net/ Stut wrote: afan pasalic wrote: why then the code doesn't work? the error I'm getting is: Fatal error: Call to undefined function

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
why then the code doesn't work? the error I'm getting is: Fatal error: Call to undefined function solution1() in ... even the function itself is just above the line that calls function? -afan Stut wrote: Jay Blanchard wrote: I don't think you can put a function name in a variable and call it

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
Jay Blanchard wrote: [snip] [snip] ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1' or $function == 'solution2' or $function == 'solution3') {

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
Robin Vickery wrote: On 19/10/2007, afan pasalic [EMAIL PROTECTED] wrote: hi I have a problem with calling functions: ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code

RE: [PHP] problem calling functions

2007-10-19 Thread Jay Blanchard
[snip] [snip] ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1' or $function == 'solution2' or $function == 'solution3') { $my_solution = $function($var); #

Re: [PHP] problem calling functions

2007-10-19 Thread Robin Vickery
On 19/10/2007, afan pasalic [EMAIL PROTECTED] wrote: hi I have a problem with calling functions: ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
Stut wrote: afan pasalic wrote: why then the code doesn't work? the error I'm getting is: Fatal error: Call to undefined function solution1() in ... even the function itself is just above the line that calls function? I can only guess that you're not showing us the code you're actually

RE: [PHP] problem calling functions

2007-10-19 Thread Jay Blanchard
[snip] ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1' or $function == 'solution2' or $function == 'solution3') { $my_solution = $function($var); # this

Re: [PHP] problem calling functions

2007-10-19 Thread Zoltán Németh
2007. 10. 19, péntek keltezéssel 11.15-kor afan pasalic ezt írta: hi I have a problem with calling functions: ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code

[PHP] problem calling functions

2007-10-19 Thread afan pasalic
hi I have a problem with calling functions: ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1' or $function == 'solution2' or $function == 'solution3

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
Jay Blanchard wrote: [snip] ?php function solution1($var1){ // some code } function solution2($var2){ // some code } function solution3($var3){ // some code } if ($function == 'solution1' or $function == 'solution2' or $function == 'solution3') {

Re: [PHP] problem calling functions

2007-10-19 Thread Stut
afan pasalic wrote: why then the code doesn't work? the error I'm getting is: Fatal error: Call to undefined function solution1() in ... even the function itself is just above the line that calls function? I can only guess that you're not showing us the code you're actually running. See the

Re: [PHP] problem calling functions

2007-10-19 Thread afan pasalic
actually, what example you are talking about? I got jay's example only? Stut wrote: afan pasalic wrote: why then the code doesn't work? the error I'm getting is: Fatal error: Call to undefined function solution1() in ... even the function itself is just above the line that calls function?

[PHP] Problem with functions

2002-12-20 Thread Beauford.2002
Hi, I keep getting errors in my script that says 'x' function is undefined or 'y' function is undefined. I defined it as 'function test ($a, $b)' and call it using 'test($a, $b)' From my knowledge this is correct, but it just simply doesn't work. Anyone have any ideas on this? TIA -- PHP

Re: [PHP] Problem with functions

2002-12-20 Thread Rick Emery
Please show a bit more of the actual code - Original Message - From: Beauford.2002 [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Friday, December 20, 2002 9:55 AM Subject: [PHP] Problem with functions Hi, I keep getting errors in my script that says 'x' function

RE: [PHP] Problem with functions

2002-12-20 Thread Jon Haworth
Hi, I keep getting errors in my script that says 'x' function is undefined or 'y' function is undefined. I defined it as 'function test ($a, $b)' and call it using 'test($a, $b)' You need to post code :-) Try this: ?php function test ($a, $b) { echo I am the test functionbr /;

Re: [PHP] Problem with functions

2002-12-20 Thread Beauford.2002
($date, $name, $email, $comment) { code ...; } duplicatemessage() { code ...; } ? - Original Message - From: Jon Haworth [EMAIL PROTECTED] To: 'Beauford.2002' [EMAIL PROTECTED]; PHP General [EMAIL PROTECTED] Sent: Friday, December 20, 2002 11:05 AM Subject: RE: [PHP] Problem

Re: [PHP] Problem with functions

2002-12-20 Thread Jason Wong
On Saturday 21 December 2002 03:27, Beauford.2002 wrote: Jon, You may have answered my question, but I'm still confused. I see from your example that the actual function comes before the function is called in the script, and when I changed mine to that format it worked. Now the confusion. I

RE: [PHP] Problem with functions

2002-12-05 Thread Carlos Alberto Pinto Hurtado
: [EMAIL PROTECTED] Asunto: [PHP] Problem with functions Hi, I have de following code for example ?php $username = victor; function test() { echo $username; } ? If I call the funcion test(), echo print nothing what's is going on ? []´s [EMAIL PROTECTED

[PHP] Problem with functions

2002-12-04 Thread Victor Halla
Hi, I have de following code for example ?php $username = victor; function test() { echo $username; } ? If I call the funcion test(), echo print nothing what's is going on ? []´s [EMAIL PROTECTED] __ Victor Halla

Re: [PHP] Problem with functions

2002-12-04 Thread Tom Rogers
Hi, Thursday, December 5, 2002, 9:15:53 AM, you wrote: VH Hi, VH I have de following code for example VH ?php VH $username = victor; VH function test() { VH echo $username; VH } ? VH If I call the funcion test(), echo print nothing what's is going on ? VH []´s VH [EMAIL

Re: [PHP] Problem with functions

2002-12-04 Thread Victor Halla
Thanks !!! Victor Tom Rogers [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Thursday, December 5, 2002, 9:15:53 AM, you wrote: VH Hi, VH I have de following code for example VH ?php VH $username = victor; VH function test() { VH echo