Page 1 of 1

Parse error while using imap_open

Posted: Mon Dec 04, 2006 6:39 am
by impulse()
I'm created a small webmail system that allows me to login to a mailbox and retrieve e-mail messages. The following line is giving me a parse error of:
PHP Parse error: syntax error, unexpected ':', expecting '}' in /var/www/html/php/test/email.php on line 15
while indicates a problem with this line:

Code: Select all

$mbox = imap_open("{$server:110/pop3}INBOX", "$username", "$password");
Could somebody point out an error with that please?

The login details are submitted to PHP through a form.

Stephen,

Posted: Mon Dec 04, 2006 7:04 am
by volka
{ and } may have a special meaning in double-quoted strings, see http://de2.php.net/language.types.strin ... ng.complex
and you have triggered that special meaning by using a variable directly after the opening {, i.e. {$var