Problem using list()

Hi all,
I’m trying to assign values from an array to variables using list and I’m getting some error messages like:

Notice: Undefined offset: 7 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

Notice: Undefined offset: 5 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

Notice: Undefined offset: 4 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

Notice: Undefined offset: 3 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

Notice: Undefined offset: 2 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

Notice: Undefined offset: 1 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

Notice: Undefined offset: 0 in /Applications/MAMP/htdocs/workspace/confpro/register.php on line 17

…and Here is my script on line 17.

list($title,$fname,$lname,$email,$phone,$pass,,$terms,) = $fields;

In there I’m trying to skip some values (namely: at index 6 and 8) and pick only one I want. I decided to print_r($fields) and this is what it gave me:

Array ( [title] => mr [first_name] => joel [last_name] => pass [email] => jo@nkosi.com [phone] => 07967856760 [password] => pass [password1] => pass [terms] => Yes [submit] => submit ) 

I search the PHP manual on php.net for the list() function, and I found this note:

list() only works on numerical arrays and assumes the numerical indices start at 0.

Perhaps that is your issue?

yes that was it… i’ll change my approach altogether. Many thanks, pal