Top Menu

Category Archives Php

function admin_downloadForms($filename=null) {        //echo $filename=base64_decode($filename);            $filename = WWW_ROOT . "uploads/uploadform/".$filename;                if (file_exists($filename)) {                header("Pragma: public");                header("Expires: 0");                header("Cache-Control: must-revalidate, post-check=0, pre-check=0");                header("Cache-Control: private", false);                header("Content-Type: application/force-download");                header("Content-Type: application/pdf");                header("Content-Description: File Transfer");      …

code: save file jUtil.jsfunction chkCharacter(obj,maxlimit,objMessage) {    var objMessage,field,num;    objMessage=document.getElementById(objMessage);    field=obj;    num=(maxlimit-field.value.length);    if(num<=0) {        num=0;        objMessage.style.color='red';    } else {        objMessage.style.color='green';    }    objMessage.innerHTML=num+" Character Remaining.";    if (field.value.length > maxlimit)         field.value = field.value.substring(0, maxlimit);}function isnotemail(email) {        var regEx = /^[w.+-]{1,}@([da-zA-Z-]{1,}.){1,}[da-zA-Z-]{2,6}$/;        if(!regEx.test(email))           {            return true;          }          return false;}////////////////////////////////////////////////////////////////////var…

Here with the help of APPs you can track the ip. These details include Geographic location information (includes country, region/state, city, latitude, longitude and telephone area code.), <?php  $ip=$_SERVER["REMOTE_ADDR"]; $handle = fopen("http://api.ipinfodb.com/v3/ip-city/?key=5b32848aa72361c4efdef63111d6e3d9247e076891f5248eec0a5be1208993e6&ip=".$ip, 'r');$tt=fgets($handle, 4096);echo '<br>';list($statusCode, $statusMessage, $ipAddress,$countryCode,$countryName,$regionName,$cityName,$zipCode,$latitude,$longitude,$timeZone) = split(';', $tt);echo "Ip-Address->".$ipAddress;echo '<br>';echo "Country Name->".$countryName;echo '<br>';echo "Country Code->".str_ireplace('-', '', $countryCode);echo '<br>';echo "City Name->".str_ireplace('-', '', $cityName);fclose($handle);?> click here to demo

Make php counter Using PHP and a plain text file this has never been easier. The example below uses a flat-text database so no MySQL database is needed.  First, lets make a new php page and also a count.txt file with just 0 digit in it. Upload the count.txt file on your web server. Depending on server configuration you may…

php Util Classes Php connection util Classes Codecode: save file UtilClass.php<?phpclass UtilClass {    public $utilMySqlServerIP;    public $utilDB ;    public $utilUser;    public $utilPass;    public $utilLink,$utilIsMYSQLLinked,$utilIsDBConnected;    public static $utilTitle,$utilDescription,$utilKeywords,$utilAuthor;    public $utilAns;        public function __construct() {        $this->utilMySqlServerIP = "localhost";        $this->utilUser = "root";//"root";        $this->utilPass = "";//"";        $this->utilDB = "photo-gallery";        $this->utilAns=false;    }    /////////////////// Start SEO Functions ///////////////////////////////////////////////    public static…

Creating Paging using PHP and MySQL with classes Paging means showing your query result in multiple pages instead of just put them all in one long page.MySQL helps to generate paging by using LIMIT clause which will take two arguments. First argument as OFFSET and second argument how many records should be returned from the database.Below is a simple example…

I've been able to export any data from MySQL to a csv file.Export mysql data to excel in php Code here :<?php$topRow="<table border='1'>";$bottomRow="</table>";$columns="<tr><th>Name</th><th>Age</th><th>Phone/Mobile Number</th>";$columns.="</tr>";$data="";$i==1;////////////////////////////// you can also connect database. you fetch data and pass paramete on td tag fields. /////////////////////while($i<10){$nName="<tr><td>".str_replace('"', '""',"Jafar Khan")."</td>";$age="<td>".str_replace('"', '""',"24")."</td>";$phoneMobileNumber="<td>".str_replace('"', '""',"9451293997")."</td>";$line=$nName.$age.$phoneMobileNumber; $data.=$line;$i++ ;}$data = str_replace("r", "", ($topRow.$columns.$data.$bottomRow)); function exportToExcelUtil($filename,$data) {        header("Content-type: application/octet-stream");         header("Content-Disposition: attachment; filename=$filename");    …

PHP script to delete thousands of jpgs I seen this query on guru.com  but I can not do the  bit this project. But  I done this task.  Client Requirement Hi, my webcam is uploading .jpg files to my shared webhost and I need you to create and install a php script that will delete all .jpg files in the public_html/cams/…

How to create xml file with php code how to create xml file with php codeHere you learn create xml file with the help of php <?php$xml = new SimpleXMLElement("<?xml version='1.0' encoding='iso-8859-1'?><content/>");$track = $xml->addChild('section');$track->addAttribute('name','settings');$item=$xml->addChild('item', 'true');$item->addAttribute('name','textSelectable');$item=$xml->addChild('item', 'gold');$item->addAttribute('name','copyright');$item=$xml->addChild('item', 'Silver');$item->addAttribute('name','companyName');$track = $xml->addChild('section');?>

How to get your blogs matter in your site. Suppose you have a blog and you post the data into this blog regularly. Now recently you  have created a new site and want to all the blog’s data show in your website in separate page or anyother location. So in this condition you need my code.My code will show any blog’s…

Close