I have IFrame which is pointing to the Moodle site, I have to pass it my username and password so that when If iframe loads, I automatically get logged on Moodle. So I have something like this:
& lt; Div id = "iframe" style = "width: 787px; height: 700px;" & Gt; & Lt; Iframe id = "iframeCon" src = "http://www.somesite.net/moodle/login/index.php" width = "100%" height = "100%" framebroom = "0" & gt; & Lt; / Iframe & gt;
How to send my username and password using the POST method for my URL?
You must use the form target
to post an iframe .
& lt; Form id = "moodleform" target = "iframe" method = "post" action = "http://www.example.com/login/index.php" & gt; & Lt; Input type = "hidden" name = "user name" value = "guest" /> & Lt; Input type = "hidden" name = "password" value = "guest" /> & Lt; Input type = "hidden" name = "test cookie" value = "1" /> & Lt; / Form & gt; & Lt; Iframe name = "iframe" & gt; & Lt; / Iframe & gt; & Lt; Script type = "text / javascript" & gt; . Document.getElementById ('moodleform') presented (); & Lt; / Script & gt;
Comments
Post a Comment