Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Authorization Page Help

    I need to know if there is anything on the web that can "inject" a username and password into the html coding it self.

    ie. The content is @ http://123.456.78.9/test.nsv

    I want to put a log in box on the site that would inject the user submitted user name and password into the HTML.

    Example: User name is: JohnPublic Password is: qwerty123

    when the submit button is clicked it will make the turn the html code from:

    http://123.456.78.9/test.nsv

    to

    http://JohnPublic:qwerty123@123.456.78.9/test.nsv

    ______________________________________________________________

    Other info:

    I am using the VLC embeded player Mozilla plugin to post video content to the web.

    So basically the Embedded player needs the user name and password to authorize the viewing of the content.

    This is the coding I am using at the moment and this line:

    target="http://usernameassword@xxx.xx.xxx.x:8000/xxx1.nsv"

    is where I need the user submitted info to be injected into.

    <html>
    <head><title>Embedded</title></head>

    <body>

    <h1>Demo Embedded Video</h1>
    <center>
    <embed type="application/x-vlc-plugin"
    name="video1"
    autoplay="yes" loop="yes" width="800" height="600"
    target="http://usernameassword@xxx.xx.xxx.x:8000/xxx1.nsv" />
    <br />
    <a href="javascript:;" onclick='document.video1.play()'>Play</a>
    <a href="javascript:;" onclick='document.video1.pause()'>Pause</a>
    <a href="javascript:;" onclick='document.video1.stop()'>Stop</a>
    <a href="javascript:;" onclick='document.video1.fullscreen()'>Fullscreen</a>

    </center>



    </body>
    </html>



    Thank you all for your help!! I hope to find some great ideas.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,310
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    Here you are:-

    Code:
    User Name <input type = "text" name = "uname" id = "uname"> <br>
    Password <input type = "text" name = "passwd" id = "passwd"><br>
    
    <input type = "button" name = "but1" id = "but1" value= "Call Up URL" onclick = "injectIt()">
    
    <script type = "text/javascript">
    
    function injectIt() {
    var un = document.getElementById("uname").value;
    var pwd = document.getElementById("passwd").value;
    var newURL = "http://" + un  + ":" + pwd + "@123.456.78.9/test.nsv";
    alert (newURL) ;  // delete after testing
    window.location = newURL;
    }
    
    </script>
    If the newURL does not exist then you will need to use AJAX to notify the user of the error, otherwise the user will simply receive a 404 error.


    Quizmaster: What "R" is Hilary Clinton's middle name?
    Contestant: Er, um . .. is it Rottweiler?
    Last edited by Philip M; 01-21-2009 at 09:48 AM.

  • #3
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    Here you are:-

    Code:
    User Name <input type = "text" name = "uname" id = "uname"> <br>
    Password <input type = "text" name = "passwd" id = "passwd"><br>
    
    <input type = "button" name = "but1" id = "but1" value= "Call Up URL" onclick = "injectIt()">
    
    <script type = "text/javascript">
    
    function injectIt() {
    var un = document.getElementById("uname").value;
    var pwd = document.getElementById("passwd").value;
    var newURL = "http://" + un  + ":" + pwd + "@123.456.78.9/test.nsv";
    alert (newURL) ;  // delete after testing
    window.location = newURL;
    }
    
    </script>
    If the newURL does not exist then you will need to use AJAX to notify the user of the error, otherwise the user will simply receive a 404 error.


    Quizmaster: What "R" is Hilary Clinton's middle name?
    Contestant: Er, um . .. is it Rottweiler?
    Okay maybe I am doing something wrong but I put the codes in like you said on an "auth" page and when I put in a username and password it puts them in properly and even goes to the page that it's supposed to. But the embedded video never plays. It seems like the video is not getting the auth.

    The site that hosts the video is getting the login details but the embedded video just says it's "loading" meaning that it has no user name and pass to read from... here is the new coding...

    This is the auth.html page that I made using the coding you posted.

    <html>
    <head><title>XME Auth Test</title>


    </head>

    <body>
    <center>
    <h1>Please Login Server 1</h1>

    <script type = "text/javascript">

    function injectIt() {
    var un = document.getElementById("uname").value;
    var pwd = document.getElementById("passwd").value;
    var newURL = "http://" + un + ":" + pwd + "@123.45.678.9:8000/test.nsv";
    alert (newURL) ; // delete after testing
    window.location = 'http://testing.com/video.html' ;
    }

    </script>

    </center>
    <center>
    User Name <input type = "text" name = "uname" id = "uname"> <br>
    Password <input type = "text" name = "passwd" id = "passwd"><br>

    <input type = "button" name = "but1" id = "but1" value= "Call Up URL" onclick = "injectIt()">


    </body>
    </html>



    am I doing something wrong? I get a dialog box telling me the user name and password were applied and it goes to the "target" page just nothing once it gets there...

    any ideas are greatly appreciated!!

    Thank you for helping me... I can feel like I am really close to getting this to work I just need a few tweaks with all of your help!!

  • #4
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I still need some help Anyone?!?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •