Jump to content

djbuddhi

Members
  • Posts

    153
  • Joined

  • Last visited

    Never

Posts posted by djbuddhi

  1. i have a login module .it was woring very well .i want to restrict the user logins when accesing the site with the same userid .that means restrict the access with the same username with the same time.

     

     

    how to block the such user..i tried so many was but not success

     

    any clue

  2. If u need or any outsourcing work in php/mysql or PHP/AS 400 contact me ..

     

    I have  5 Years of experience in programming web applications such as pawn shop program,HR System ,attendances system , AS400 Reporting via web ,salary processing system,phone budding and auction  ...etc 

     

    contact buddhikaperera@hotmail.com

  3. it is obvious that it will never work .u made a mistake .u gave assign a form target .remove the form target page ,make the submit button as as normal button and call the ajax.php file then it will work fine .....

     

     

  4. index.php

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

    "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <head>

    <title>Untitled Document</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <script type="text/javascript">

    var http = false;

     

    if(navigator.appName == "Microsoft Internet Explorer") {

      http = new ActiveXObject("Microsoft.XMLHTTP");

    } else {

      http = new XMLHttpRequest();

    }

     

    function validate(user) {

      http.abort();

      http.open("GET", "bud.php?name=" + user, true);

      var result=http.responseText;

      http.onreadystatechange=function() {

        if(http.readyState == 4) {

          document.getElementById('buddhika_div_id').innerHTML = http.responseText;

        }

    ///document.getElementById('vv').disabled = false;

      }

      http.send(null);

    }

    // if(result=="Username Exists ..!"){

      //document.getElementById('vv').disabled = true;}

    // else{ document.getElementById('vv').disabled = false;}

     

    </script>

     

    </head>

     

    <body>

    <form>

      <input type="text" onkeyup="validate(this.value)" />

      <div id="buddhika_div_id"></div>

        <p> </p>

        <p>

          <input type="submit" name="Submit" value="Submit" id="vv">

        </p>

     

    </form>

     

    </body>

    </html>

     

     

    here is bud.php

     

    <?php

     

    $link = mysql_connect("127.0.0.1", "root", "") or die("Could not connect");

     

            $db = mysql_select_db("login", $link) or die("Could not select database");

     

     

           

     

     

    function validate($name) {

      if($name == '') {

        return '';

      }

     

      $query = "SELECT count(*) AS C  FROM login WHERE username = '$name'";

      $result = mysql_query($query) or die("alert('Database error: ".mysql_error()."');");

      $counta=mysql_result($result,0,'C'); ///$row = mysql_fetch_row($result);

     

      if ($counta >0){

      return "<span id=\"warn\">Username Exists ..! </span>\n";

     

      }

     

    }

     

    echo validate(trim($_REQUEST['name']));

    ?>

     

    check the comment place .it was not working .disable the submit button

  5. hey thanks .now i clear that .by the way i am just asking if the user exists in the system it will prompt the error of 'exists user' but if there is any possibility to disable the submit button in case of displaying the error message... ??? ???

  6. I have a question .i used ajax with php .i  have form .first field is username ,second field  is email address .now i want to check username exits and to check  email is valid by textbox key up or key enter event .

     

    how to do it in ajax. i am little stuck on this on key up or key enter event ,but in form submit event i am able to do that.

     

    have u got any idea of how you doing it ? :)

  7. I am using PDML for reporting where i can print my html report as pdf documents.i have a problem of aligning the numeric values to right

     

    can u tell me the method that i can align to right or any specific class that i can used 4 HTML to PDF

     

    Thanks

     

  8. hey guys need help for this

     

    example ; this will be entered in a text area 

     

    item1 | item2 | item3 | item4 | ...etc

     

     

    i want to check after item1 if the user enter | ,if not message will be alert on keypup or keyenter option

     

     

    how to validate this  ??? ???

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.