Posts

Showing posts with the label PHP

How to get the File Size and File Type of File / Folder in PhP With Example Source Code

Image
Guys, By using the following code we can find out the File size and type of files/ folders in a directory . The help is give as comments and if have any more doubt then please comment Example Code <?php   $myDirectory = opendir("rootFolder");   // get each entry   while($entryName = readdir($myDirectory)){        $dirArray[] = "rootFolder/".$entryName;   }   // close directory   closedir($myDirectory);   //     count elements in array    $indexCount     = count($dirArray);    Print ("$indexCount files<br>\n");   // sort 'em   sort($dirArray);   // print 'em    print("<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks>\n");    print("<TR><TH>Filename</TH><th>Filetype</th><th>Filesize</th></TR>...

How to Create Live Search In Html Using Ajax Ad PhP - Google Live Search / Instant Search Code And Example

Image
Hi, Here Is the code and example for how to create a live search or instant search for your website.It consist of 3 parts 1.A JavaScript including Ajax 2.A Input box to enter the keywords by user 3.A Php Code to do the searching           Now , the JavaScript code is given below <script type="text/javascript"> function showResult(str) { if (str.length==0) { document.getElementById("livesearch").innerHTML=""; document.getElementById("livesearch").style.border="0px"; 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("livesearch").innerHTML=xmlhttp.responseTe...

Download Calender JavaScript or source code of calender java script-ajax

Image
Guys,                        I had searched a lot for finding the calender script for my project and now i had the perfect one .Yow can download it from the Link Below.There are more script in that site.Copy the code and jst paste it where u want the calender  Download Here Source  Code Example:

Pagination In Website Using Arrays / Php / Javascript Example Code

Hi, Pagination in a database based website is very much important in order to include all the entries in the web page.the following give a way to include pagination in your web page through Arrays $result = mysql_query(“select * from tablename where conditions (optional)”); if(mysql_num_rows($result)>0) {$i=0 ; while($row=mysql_fetch_array(result)) { $array[$i][0]=$row["fieldname1"]; //fieldname reprsents the arrtibute name in the table $array[$i][1]=$row["fieldname2"]; $array[$i][2]=$row["fieldname3"]; $array[$i][3]=$row["fieldname4"]; $array[$i][4]=$row["fieldname5"]; //place as much information to be displayed in the array here ‘a’ $i++; } } $total_pages = mysql_num_rows($result); echo “Total “.$total_pages.” results found”; $targetpage = “your current page?parametes that you are sending from previous page”; /* Place code to connect to your DB here. */ //include(‘dbconnect.php’); // include your code t...

Installing MySQL PHP In Ubuntu / Linux

Image
Guys .. Just Take The Terminal  and Type :- TYPE:- sudo apt-get install mysql-server If you are using Php you need to download this as well :  sudo apt-get install php5-mysql