[PHP] Hello $variable, whats your name?
I would like to know if there is a way to determine the name of a variable. Example: I have the variable $firstname, with a value of Jon I want to be able to echo name_of_variable : value_of_variable; So the user would see firstname : Jon I want to be able to do this without knowing what variables will be passed to the PHP script in advance. Any help is appreciated in advance. Jon === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Hello $variable, whats your name?
If it's in some kind of collections, you could iterate through the collection. ($HTTP_POST, $HTTP_GET, any associative array, etc.) Cal http://www.calevans.com -Original Message- From: JCampbell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 6:06 PM To: Main PHP List Subject: [PHP] Hello $variable, whats your name? I would like to know if there is a way to determine the name of a variable. Example: I have the variable $firstname, with a value of Jon I want to be able to echo name_of_variable : value_of_variable; So the user would see firstname : Jon I want to be able to do this without knowing what variables will be passed to the PHP script in advance. Any help is appreciated in advance. Jon === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Hello $variable, whats your name?
$HTTP_POST_VARS Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -Original Message- From: JCampbell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 4:06 PM To: Main PHP List Subject: [PHP] Hello $variable, whats your name? I would like to know if there is a way to determine the name of a variable. Example: I have the variable $firstname, with a value of Jon I want to be able to echo name_of_variable : value_of_variable; So the user would see firstname : Jon I want to be able to do this without knowing what variables will be passed to the PHP script in advance. Any help is appreciated in advance. Jon === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Hello $variable, whats your name?
You can cycle through the $HTTP_POST_VARS or $HTTP_GET_VARS arrays depending on whether you use 'post' or 'get' for the methos in you form while(list($key,$val)=each($HTTP_POST_VARS)) { print "$key:$valbr\n"; } - Original Message - From: JCampbell [EMAIL PROTECTED] To: Main PHP List [EMAIL PROTECTED] Sent: Tuesday, December 12, 2000 4:05 PM Subject: [PHP] Hello $variable, whats your name? I would like to know if there is a way to determine the name of a variable. Example: I have the variable $firstname, with a value of Jon I want to be able to echo name_of_variable : value_of_variable; So the user would see firstname : Jon I want to be able to do this without knowing what variables will be passed to the PHP script in advance. Any help is appreciated in advance. Jon === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Hello $variable, whats your name?
theres even $GLOBALS() ""Data Driven Design"" [EMAIL PROTECTED] wrote in message 001301c0b347$d96ca5c0$[EMAIL PROTECTED]">news:001301c0b347$d96ca5c0$[EMAIL PROTECTED]... You can cycle through the $HTTP_POST_VARS or $HTTP_GET_VARS arrays depending on whether you use 'post' or 'get' for the methos in you form while(list($key,$val)=each($HTTP_POST_VARS)) { print "$key:$valbr\n"; } - Original Message - From: JCampbell [EMAIL PROTECTED] To: Main PHP List [EMAIL PROTECTED] Sent: Tuesday, December 12, 2000 4:05 PM Subject: [PHP] Hello $variable, whats your name? I would like to know if there is a way to determine the name of a variable. Example: I have the variable $firstname, with a value of Jon I want to be able to echo name_of_variable : value_of_variable; So the user would see firstname : Jon I want to be able to do this without knowing what variables will be passed to the PHP script in advance. Any help is appreciated in advance. Jon === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]