Amoraboti - Program
Rashed - Uz - Zaman (Rasel)
  Home About Me Brainstorming Facebook Fan Page Contact    
  Author
I'm Rz Rasel
From Bangladesh

  Archives
April 2010
May 2010
January 2011
February 2011
January 2012
February 2012
March 2012

  Current
Current Posts

  Previous Posts
d
e
2
B
Php:- Check For Valid Email Address
How To Insert Unicode Values To MySQL Using Java
Multiple Checkbox Select/Deselect JavaScript And j...
Dynamically Add/Remove rows in HTML table using Ja...
Dynamically add button, textbox, input, radio elem...
Changing Form Input (Textbox) Style on Focus using...

  My Link
Islam And We
My Diary (Bangla)
My Diary (English)
My Lyrics (Bangla)
My Lyrics (English)
My Poem (Bangla)
My Poem (English)
My Story (Bangla)
My Story (English)
General Knowledge
Fun And Jokes
Lyrics (Bangla)
Lyrics (English)
Lyrics (Hindi)
Quotations
 
 
  Ajax Post Method  
  Monday, January 31, 2011  
 

<html>

<head>

<script type="text/javascript">

function showHint(str)

{

if (str.length==0)

{

document.getElementById("txtHint").innerHTML="";

return;

}

if (window.XMLHttpRequest)

{// code for IE7+, Firefox, Chrome, Opera, Safari

xmlhttp=new XMLHttpRequest();

}

else

{// code for IE6, IE5

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

}

xmlhttp.onreadystatechange=function()

{

if (xmlhttp.readyState==4 && xmlhttp.status==200)

{

document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

}

}

xmlhttp.open("POST","gethint.php?q="+str,true);

xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");

xmlhttp.send( "ab=" + str + "&str=" + str );

}

</script>

</head>

<body>

<h3>Start typing a name in the input field below:</h3>

<form action="">

First name:

<input name="text" type="text" id="txt1" onKeyUp="showHint(this.value)" />

</form>

<p>Suggestions: <span id="txtHint"></span></p>

</body>

</html>


<?php

// Fill up array with names

$a[]="Anna";

$a[]="Brittany";

$a[]="Cinderella";

$a[]="Diana";

$a[]="Eva";

$a[]="Fiona";

$a[]="Gunda";

$a[]="Hege";

$a[]="Inga";

$a[]="Johanna";

$a[]="Kitty";

$a[]="Linda";

$a[]="Nina";

$a[]="Ophelia";

$a[]="Petunia";

$a[]="Amanda";

$a[]="Raquel";

$a[]="Cindy";

$a[]="Doris";

$a[]="Eve";

$a[]="Evita";

$a[]="Sunniva";

$a[]="Tove";

$a[]="Unni";

$a[]="Violet";

$a[]="Liza";

$a[]="Elizabeth";

$a[]="Ellen";

$a[]="Wenche";

$a[]="Vicky";


//get the q parameter from URL

$q=$_POST["str"];


//lookup all hints from array if length of q>0

if (strlen($q) > 0)

{

$hint="";

for($i=0; $i<count($a); $i++)

{

if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))

{

if ($hint=="")

{

$hint=$a[$i];

}

else

{

$hint=$hint." , ".$a[$i];

}

}

}

}


// Set output to "no suggestion" if no hint were found

// or to the correct values

if ($hint == "")

{

$response="no suggestion";

}

else

{

$response=$hint;

}


//output the response

echo $response;

?>

 
  posted by Rz Rasel At 2:41 AM, ,  
     
  Ajax getting xmlhttprequest to loop continuously  
  Sunday, January 30, 2011  
 
//-------------------- live.php
// First detect browser-type, as some browsers are picky.
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Safari'))
{
// Safari required at least 1024 bytes before displaying
echo str_pad('',1024);
$browser = "safari";
}

// Begin our loop that only aborts if the client disconnects
while(!connection_aborted())
{
$i+=3;
// Safari requires a padding of 8 characters
echo ($browser = "safari" ? str_pad($i, 8) : $i);
// Output current data with flush()
flush();
// Sleep for 3 seconds
sleep(3);
}
?>

//-------------------- nStream.js
// set connection as a global variable
var connection = null

function nStream(url)
{
setInterval(nParse, 1000);
if (!/*@cc_on!@*/false)
{
connection = new XMLHttpRequest();
}
else
{
connection = new ActiveXObject("Microsoft.XMLHTTP");
}
connection.open("GET", url, true);
connection.onreadystatechange = function()
{
if (connection.readyState == 4)
{
alert('connection closed.');
}
}
connection.send(null);
}

oldResponse = null;
function nParse()
{
var Response = connection.responseText;
if (Response != oldResponse)
{
document.getElementById('change').innerHTML = Response;
}
oldResponse = Response;
}

//---------------------------------------------------------

 
  posted by Rz Rasel At 1:38 AM, ,  
     
 
  Problem In Font
Download then zip file unzip and install in your system. Or normal font file just install in your system font folder. Rz Rasel
Bangla Font
Bangla Font

  Find Me In Facebook
 
 

   aaaa
 

   aaaa
 
 
Copyright © 2010 - Amoraboti - Program. ® All right reaserved. Design and developed by:- Rz Rasl