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 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2011
    Location
    united kingdom
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Problems logging in with missing file.

    Hi guys, I'm a complete newbie when it comes to java so if anyone can help it would be much appreciated. The problem I'm having is that I have this code:

    <script language = "javascript">
    function validate(text1,text2,text3,text4) {
    if (text1==text2 && text3==text4)
    load('jake.php');
    else
    {
    alert('Login incorrect..');
    }
    }

    function load(url) {
    location.href=url;
    }
    </script>

    And I don't have the jake.php file, meaning I don't know what's in that file. I'm having trouble getting the login page of my site to link with the database. And I'm pretty sure it is this file. Does anyone have any idea what that file might be?

    Thanks

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Posts
    165
    Thanks
    1
    Thanked 39 Times in 39 Posts
    First of all, this script is totally out dated in the way it is written. Secondly, do you not have access to your own server? Where are you calling this from? You didn't post your html. Do you even have a form that has those text field names in it?

    It's 2 o'clock in the morning for me so I know I'm tired and maybe misuderstanding, but I don't see how you are using this code as a log in form without having access to the rest of the pages on your server.

    If you do have full server access them just rename the php file to whatever file you need to call in order to validate a login.

    It would be really helpful if you could post a link to your page or the full code.

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,302
    Thanks
    203
    Thanked 2,561 Times in 2,539 Posts
    Quote Originally Posted by squish View Post
    Hi guys, I'm a complete newbie when it comes to java so if anyone can help it would be much appreciated.
    This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Rather like Austria and Australia!

    JavaScript automatically prevents scripts on one server from accessing properties of documents on a different server. This restriction prevents scripts from, for example, fetching private information such as directory structures or user session history

    Simply stated, the SOP states that JavaScript code running on a web page may not interact with any resource not originating from the same web site.
    Last edited by Philip M; 06-25-2012 at 08:22 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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