String Variable Handling

[color=blue][size=8pt][font=arial]
Hi!
I’m new to this forum, so I apologize for any mistakes I make in this post. I am currently developing a php script for adding users to an already-existing system. Unfortunately, though, one of the parameters the script attempts to use returns an error when the script is parsed:

Parse error: syntax error, unexpected ‘’ (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in …/register.php on line 8

Here are the contents of line 8 (the error-returning parameter):

[php]$replacement == “$ft[‘users’][’” . $username . “’] = array(‘DIR’ => './System/Users/” . $username . “’,‘password’ => '” . $passcode . “’,‘group’ => ‘guests’ ); \r\n //find me to add users \r\n”;[/php]

I spent hours searching up php variable concentation, types, and operators to see if I could identify the issue. As you can see, it was in vain - I was unable to figure out what illegal action I had done to cause the parser to fire off.

NOTE: I do NOT want anyone to tell/give me new code - simply telling me what I did wrong will suffice. I don’t want anyone doing the work for me. :)[/font][/size][/color]

First I would read http://php.net/manual/en/language.types.array.php on arrays and browse php.net on strings.

[php]$replacement == “$ft[‘users’][’” . $username . “’] = array(
‘DIR’ => './System/Users/” . $username . “’,
‘password’ => '” . $passcode . "’,
‘group’ => ‘guests’
);

\r\n //find me to add users \r\n";[/php]

Look at you code like this for one. Striders links should help for the rest.

Sponsor our Newsletter | Privacy Policy | Terms of Service