Hi everyone, iam new to PHP. i want to use progress bar concept in my php code. let me tell you breifly. The user should feel what is happening and what is the progress on the process running. From my understanding with out progress bar the end user may not know whats happening on the application if the process runs for a long time.
i want to have progress bar scrolling when the application is running say for example when UPDATE button is clicked. So my questions are
1) Is there any best predefined class for including the progress bar. ofcourse we have but need to know how to implement it.
2)I think using ajax with php gives more stylish Progress bar. If you guys have any sample code how to include and use the progress bar its a great help to me.
Would appreciate your help. Thanks in advance.
Thanks,
Krishna.p
How to use Progress bar concept in php
Moderator: General Moderators
-
madan koshti
- Forum Commoner
- Posts: 50
- Joined: Fri Jun 06, 2008 4:25 am
Re: How to use Progress bar concept in php
reffer : http://www.tizag.com/ajaxTutorial/ajaxx ... equest.php and any image from http://webmaster-forums.code-head.com/s ... .php?t=885
<html>
<body>
<script language="javascript" type="text/javascript">
<!--
//Browser Support Code
function ajaxFunction(){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.myForm.time.value = ajaxRequest.responseText;
}else {
document.myForm.time.value = "<img src=''progressbarImagepath" >';
}
}
ajaxRequest.open("GET", "serverProgram.php", true);
ajaxRequest.send(null);
}
//-->
</script>
<form name='myForm'>
Name: <input type='text' onChange="ajaxFunction();" name='username' /> <br />
Time: <input type='text' name='time' />
</form>
</body>
</html>
<html>
<body>
<script language="javascript" type="text/javascript">
<!--
//Browser Support Code
function ajaxFunction(){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.myForm.time.value = ajaxRequest.responseText;
}else {
document.myForm.time.value = "<img src=''progressbarImagepath" >';
}
}
ajaxRequest.open("GET", "serverProgram.php", true);
ajaxRequest.send(null);
}
//-->
</script>
<form name='myForm'>
Name: <input type='text' onChange="ajaxFunction();" name='username' /> <br />
Time: <input type='text' name='time' />
</form>
</body>
</html>