Re: ldap add Invalid DN syntax
| From: | Ashley Sheridan | Date: | Fri, 30 Apr 2010 13:53:08 +0000 |
| Subject: | Re: ldap add Invalid DN syntax | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-304774@lists.php.net to get a copy of this message | ||
On Fri, 2010-04-30 at 14:34 +0300, Manolis Vlachakis wrote:
> Hallo there everyone
> although i have built my code correctly according to the examples i found on
> the net..
> i get Invalid DN syntax error when i try to insert some attributes with ldap
> add..
>
> i get and read a csv file where i get the data correctly as i can see on the
> echos that follow:
>
> *$data=split("[;\r]",$data);*
> *
> *
> * **$info["cn"]= $data[$c];*
> * **echo "|onoma-->";*
> * **echo $info["cn"] ;//*
> * ** ** $c++;*
> * **$info["sn"]= $data[$c];*
> * **echo "|epwnimo-->";*
> * **echo $info["sn"] ;*
> * *
> * **$info["objectclass"][0] = "top";*
> * ** ** $info["objectclass"][1] = "organizationalPerson";*
> * *
> * ** *
> * ** $r = ldap_add($ldapconn,
>
> "cn=".$info['cn'].",cn=*****,ou=@@@,ou=****.,ou=****,dc=.....dc=....",
> $info);*
>
> funny thing is that when i put them absolute like *$info["sn"]= "bla
> bla";* it works fine...
> any ideas?
Are you using the correct split() delimiter? What happens if you just
output that array with print_r() or var_dump()? I see the delimiter as:
[;
]
Because the \r is recognised as a carriage return because your string is
in double quotes.
Thanks,
Ash
http://www.ashleysheridan.co.uk