djbuddhi
-
Posts
153 -
Joined
-
Last visited
Never
Posts posted by djbuddhi
-
-
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
-
ur question not clear .if u tell the requirement correctly .i might help
-
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
-
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 .....
-
i am aslo interested in uploading with a progress bar ;D
-
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
-
<META HTTP-EQUIV="Refresh" CONTENT="10; URL=index.php">
-
i know the javascript syntax bro .my question is the place where the code insert .it was not work out for me... ??? ???
-
i know those things but the problem is to after ajax request message how to disable it .if you can show me the code ..great help
thx
-
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... ??? ???
-
hey what this line up to 'var prodid = document.getElementById('upc'+idnum).value;'
not works
-
hey thanks . i know this ,i want to know how u validate the second option ,the email this ..
are u calling the same page or any other page like this
-
can u show me the example .it causes some errors in my program ??? ???
-
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 ?
-
but it allows fast access bro and the coding has comes with a good style ,and not the php DB connectivity
-
is anyone have a video tutorial or any examples of how to use 'CodeIgniter' in php .pls let me know ?
-
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
-
thanks a lot pal .ur the man ...
-
example :
clothes | shipping items | goods |
like that only clue is that before submitting the form 2 check whether user enters the '|' mark .thats it how to check string by string in a java script ??? ???
-
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 ??? ???
-
i have a good method and it works
<?php
$num = cal_days_in_month(CAL_GREGORIAN, 2, 2008) ;
echo "There were $num days in May 2008";
?>
-
thanks 4 the support buddy ;D
have a good day
TC
-
hey cooldude832
can u post the code ,i am not familiar with the mKtime this thing :
-
thanks pal
How To restric Multiple Access ?
in PHP Coding Help
Posted
can i have a sample code of what u have saying ...