Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-14-2006, 09:36 PM   PM User | #1
Clandestine
New to the CF scene

 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Clandestine is an unknown quantity at this point
Operator Syntax Question

<?
defined('OK') or die();

/* Carga la configuracion para acceso */
/* Load default login configuration */

return array(
// Nombre del campo usuario / User field name
'login:usuario' => array('sdata','user'),

// Nombre del campo de contraseña / Password field name
'login:contrasinal' => array('sdata','pass'),

// Si la contraseña se recibe ya encriptada o si debemos encriptarla antes
// de realizar la comprobación de login
// If the password it's encripted or if pfn must crypted after check user
// true = it's encripted | false = pfn must crypt
'login:encriptada' => true,

// Metodo para obtener los datos / Method to obtain data
// post | get | session | server
'login:metodo' => 'session'
);
?>

This code is in a file (login.inc.php) included in another file (index.php). "index.php" contains the following code:

<?
$_SESSION['sdata'][] = array(
"user" => "test",
"pass" => md5("test")
);
?>

Can someone tell me what purpose the colon serves between "login" and "usuario"? Or could you just explain what is happening here? What is "login:usuario"? Any way you can answer the question would be helpful.

It is valid as far as syntax goes, because it is used often in the code of PHPfileNavigator (http://pfn.sourceforge.net), but I haven't seen it before now.

Thanks for any help!
Clandestine is offline   Reply With Quote
Old 02-14-2006, 10:08 PM   PM User | #2
Jak-S
Regular Coder

 
Join Date: Mar 2005
Location: Brighton, UK
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
Jak-S is an unknown quantity at this point
The colon dosent mean anything, its just a character in the key for that array element. Basically, if you had code like this:

PHP Code:
$test = array('login:name'=>'jack'); 
That would create a variable called $test, that is any array with one element. Each element has a key (for identifying it in the array), and a value. To access the value of the "login:name" element of the $test array you would do something like this:

PHP Code:
print $test['login:name']; 
Jack
Jak-S is offline   Reply With Quote
Old 02-15-2006, 08:33 PM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,448
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
label:content or key:value
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:22 PM.


Advertisement
Log in to turn off these ads.