Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > Wrong parameter count for imap_open()
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 5th November 02:22
awilliam
External User
 
Posts: 1
Default Wrong parameter count for imap_open()



I'm running PHP 5.2.4 and getting the error:

*Warning*: Wrong parameter count for imap_open() in
*/var/www/sites/intra-test/contract/login.php* on line *9

*My code is:

$mbox =
imap_open("\"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX\",
\"".$_POST["username"]."\", \"".$_POST["password"]."\""); // line 9

but when I echo it out, it looks fine:

echo "\"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX\",
\"".$_POST["username"]."\", \"".$_POST["password"]."\"";

prints:

"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX", "awilliam",
"xxxxxxx"


any ideas?
*
*
  Reply With Quote


 


2 5th November 02:22
parasane
External User
 
Posts: 1
Default Wrong parameter count for imap_open()



[snip!]

You just forgot to encapsulate your parameters properly. You
escape the strings, but don't close the parameter, so PHP reads that
all as one parameter passed to imap_open().

Change it to one of the following:

$mbox = imap_open("\"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX\"","\"".$_POST["username"]."\"","\"".$_POST["password"]."\"");
// line 9

---- OR ----

$mbox = imap_open('"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX"','"'.$_POST['username'].'"','".$_POST['password'].'"');

--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.
  Reply With Quote
3 5th November 02:23
lists
External User
 
Posts: 1
Default Wrong parameter count for imap_open()


From the documentation, it looks to me like you are makings things much more complicated then they
need to be.

imap_open('{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX',
$_POST["username"],
$_POST["password"]);

From what the documentation shows, you do not need to have quotes around the username/password fields. Enjoy.

--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare
  Reply With Quote
4 5th November 02:33
ceo
External User
 
Posts: 1
Default Wrong parameter count for imap_open()


This creates a single string which LOOKS like what you should have
typed in the first place.


You need to END the quote for the Mailbox before you put in a comma to
separate the mailbox arg from the username arg.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
  Reply With Quote


 


Reply


Thread Tools
Display Modes




666