I am building an iPhone App using PhoneGap. I am using ChildBrowser plugin.
If I have a form in the App with username/pass, is there anyway I can post those information to an URL like http://www.mydomain.com/login.php and open it in ChildBrowser?
Please let me know.
Thanks.
You can certainly pass GET parameters to
childBrowser.showWebPage().You could intercept the submit of your form in your app and gather up the field names and values passed (assuming this is a login form, so say username and password) and pass them as parameters to the URL opened in ChildBrowser.
childBrowser.showWebPage('https://www.mydomain.com/login.php?username='+username+'&password='+password)This is a rather unsophisticated version for demonstration purposes. It wouldn’t take much to make it better.
The catch is of course that it is being sent via GET. If your login form is expecting POST and you can’t change that, you could have a problem.
Edit:
If POST is your only option, perhaps you would be better off using AJAX to post to the form instead of using child browser.