If you want to emulate the form submission you need to add the correct
content type. For form submissions this is x-www-form-urlencoded. It
is also useful to send the content length of your post data. And you
don't need the first & in your params, you will just need them between
the parameters if you are sending more than one:
var user = "Andrew";
var req = new XMLHttpRequest();
req.open("POST", options.getValue("URL") + "/index.php", false);
var params = "user=" + user;
req.setRequestHeader("Content-type", "application/x-www-form-
urlencoded");
req.setRequestHeader("Content-length", params.length);
req.send(params);
Best regards,
Benjamin
On Sep 2, 4:04 pm, bobovieri <[EMAIL PROTECTED]> wrote:
> Help me!
>
> var user="Andrew";
> var req = new XMLHttpRequest();
> req.open("POST", options.getValue("URL")+"/index.php", false);
> req.send("&user="+user);
>
> In index.php:
> echo($_POST['user']);
>
> don't work! HELP ME, I need use POST method because I must pass
> several parameters
>
> thanks in advance,
> bobo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---