[PHP] Re: $_POST to function?

2006-02-24 Thread Jason Gerfen

Tanoor Dieng wrote:


Hi,
are there some variables in your post array(aka are you  sure that
$_POST is not empty)?
Normally this should works.

Tanoor.

2006/2/24, Jason Gerfen [EMAIL PROTECTED]:
 


I am not sure why this is not working.  Aren't $_POST vars
superglobals?  I am trying to pass the $_POST array as an argument to a
function and nothing is being returned.  Any help is appreciated.

return global_template( 3, $_POST, count( $_POST ), $message );

function global_template( $cmd, $args, $num, $message ) {
 echo pre; print_r( $args ); echo /pre;
}

--
Jason Gerfen

When asked what love is:
Love is the Jager talking.
~Craig Baldo

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


   

Yep, I just double checked the $_POST vars prior to calling the 
function, ex:


echo pre; print_r( $_POST ); echo /pre; // This prints 
everything contained in $_POST without problem

return global_template( 3, $_POST, count( $_POST ), $message, NULL );

function global_template( $cmd, $args, $num, $message, $errors ) {
 echo pre; print_r( $args ); echo /pre; // This will not 
display anything in the $args-$_POST array? WTH?

}

--
Jason Gerfen

When asked what love is:
Love is the Jager talking.
~Craig Baldo

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: $_POST to function?

2006-02-24 Thread Vidyut Luther
Since $_POST is a superglobal, it should not lose scope inside a
function() call. I could be wrong though.

Also, curious if $args is empty.. what is $num and $message. ?
Also.. you're calling a function in your return statement ?


On 2/24/06, Jason Gerfen [EMAIL PROTECTED] wrote:
 Tanoor Dieng wrote:

 Hi,
 are there some variables in your post array(aka are you  sure that
 $_POST is not empty)?
 Normally this should works.
 
 Tanoor.
 
 2006/2/24, Jason Gerfen [EMAIL PROTECTED]:
 
 
 I am not sure why this is not working.  Aren't $_POST vars
 superglobals?  I am trying to pass the $_POST array as an argument to a
 function and nothing is being returned.  Any help is appreciated.
 
 return global_template( 3, $_POST, count( $_POST ), $message );
 
 function global_template( $cmd, $args, $num, $message ) {
   echo pre; print_r( $args ); echo /pre;
  }
 
 --
 Jason Gerfen
 
 When asked what love is:
  Love is the Jager talking.
 ~Craig Baldo
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 Yep, I just double checked the $_POST vars prior to calling the
 function, ex:

 echo pre; print_r( $_POST ); echo /pre; // This prints
 everything contained in $_POST without problem
 return global_template( 3, $_POST, count( $_POST ), $message, NULL );

 function global_template( $cmd, $args, $num, $message, $errors ) {
   echo pre; print_r( $args ); echo /pre; // This will not
 display anything in the $args-$_POST array? WTH?
 }

 --
 Jason Gerfen

 When asked what love is:
  Love is the Jager talking.
 ~Craig Baldo

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: $_POST to function?

2006-02-24 Thread Jason Gerfen

Vidyut Luther wrote:


Since $_POST is a superglobal, it should not lose scope inside a
function() call. I could be wrong though.

Also, curious if $args is empty.. what is $num and $message. ?
Also.. you're calling a function in your return statement ?


On 2/24/06, Jason Gerfen [EMAIL PROTECTED] wrote:
 


Tanoor Dieng wrote:

   


Hi,
are there some variables in your post array(aka are you  sure that
$_POST is not empty)?
Normally this should works.

Tanoor.

2006/2/24, Jason Gerfen [EMAIL PROTECTED]:


 


I am not sure why this is not working.  Aren't $_POST vars
superglobals?  I am trying to pass the $_POST array as an argument to a
function and nothing is being returned.  Any help is appreciated.

return global_template( 3, $_POST, count( $_POST ), $message );

function global_template( $cmd, $args, $num, $message ) {
echo pre; print_r( $args ); echo /pre;
}

--
Jason Gerfen

When asked what love is:
Love is the Jager talking.
~Craig Baldo

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   


Yep, I just double checked the $_POST vars prior to calling the
function, ex:

echo pre; print_r( $_POST ); echo /pre; // This prints
everything contained in $_POST without problem
return global_template( 3, $_POST, count( $_POST ), $message, NULL );

function global_template( $cmd, $args, $num, $message, $errors ) {
 echo pre; print_r( $args ); echo /pre; // This will not
display anything in the $args-$_POST array? WTH?
}

--
Jason Gerfen

When asked what love is:
Love is the Jager talking.
~Craig Baldo

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


   



 

Sure, by calling return function_name( args ) it just sends vars based 
on conditional statements to a template type setup.  The $num and 
$message vars are used by the template function to determine what and 
how to display the page contents is all.


That is what I thought, $_POST is a superglobal, but it is loosing 
scope.  Could it be that I am trying to pass $_POST from one function to 
another function be causing the problem you think?  I have never ran 
into this before.


--
Jason Gerfen

When asked what love is:
Love is the Jager talking.
~Craig Baldo

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: $_POST to function?

2006-02-24 Thread Christopher Taylor
I am not as familiar with php as I am c++ but I wonder if you need to 
pass by reference?  Does this make sense in the context of php?


One other thing I would try is setting $temp = $_Post and then passing 
$temp.


Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: $_POST to function?

2006-02-24 Thread Jason Gerfen

Christopher Taylor wrote:

I am not as familiar with php as I am c++ but I wonder if you need to 
pass by reference?  Does this make sense in the context of php?


One other thing I would try is setting $temp = $_Post and then passing 
$temp.


Chris


Yeah, I actually tried that as well.

--
Jason Gerfen

When asked what love is:
Love is the Jager talking.
~Craig Baldo

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: $_POST to function?

2006-02-24 Thread Vidyut Luther
just for fun, I tried to do what you're doing.

http://www.phpcult.com/jason.phps

http://www.phpcult.com/jason.php to run it..

it seems to be working.. the problem is in your code.. but not PHP properly..

On 2/24/06, Jason Gerfen [EMAIL PROTECTED] wrote:
 Christopher Taylor wrote:

  I am not as familiar with php as I am c++ but I wonder if you need to
  pass by reference?  Does this make sense in the context of php?
 
  One other thing I would try is setting $temp = $_Post and then passing
  $temp.
 
  Chris
 
 Yeah, I actually tried that as well.

 --
 Jason Gerfen

 When asked what love is:
  Love is the Jager talking.
 ~Craig Baldo

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php