Latest Post
Tampilkan postingan dengan label php. Tampilkan semua postingan
Tampilkan postingan dengan label php. Tampilkan semua postingan

PHP Text Messaging with TextMagic

Written By Unknown on Rabu, 29 Januari 2014 | 08.05

Once you have a TextMagic account and you've downloaded the API helper provided by TextMagic, all you need to do is create a bit of custom code to send your text message: The result of the send call is an array of information about the sending of your message. To check the send status later on, you just need to call the messageStatus method:

To read more about this article Click Here

For Demo Click Here

Login with Microsoft Live OAuth using PHP

Written By Unknown on Minggu, 19 Januari 2014 | 07.43

Few months back Microsoft has launched OAuth system for client websites, using this you can get the valid user details from Hotmail and Outlook database. Earlier I had published Facebook, Google and Twitter OAuth login systems, now this post explains you how to implement Microsoft Live OAuth connect using PHP. Sure this helps your web project to avoid registration email activation.

To read more about this article Click Here

For Demo Click Here

To download files Click Here

List all files of a directory in php

Written By Unknown on Rabu, 15 Januari 2014 | 08.41

Listing all files of a directory in php is quite easy with php DirectoryIterator class. This class provides a simple interface for viewing the contents of filesystem directories.

Here is a simple php function to list all files of a directory. This is a recursive function so that it will list files of all of its subdirectories too.


function list_directory_contents($dir){

$dh = new DirectoryIterator($dir);
foreach ($dh as $item) {
if (!$item->isDot()) {
if ($item->isDir()) {
list_directory_contents("$dir/$item");
} else {
echo $dir . "/" . $item->getFilename();
echo "<br>";
}
}
}
}

# Call function

list_directory_contents("abc");

The output will be something like


abc/abc1.txt
abc/abc2.txt
abc/abc3.txt
abc/xyz/xyz1.txt
abc/xyz/xyz2.txt

Best and smarter debugging of PHP scripts

Today nobody really questions benefits of using source level debuggers for any language including PHP – debugger is simply a tool, necessity in everyday programmers work. However, it is interesting to note that code validating tools are much less known and it is those tools that are very valuable addition to debuggers in code development.

To read more about this article Click Here

For Demo Click Here

Parsing web pages using PHP

Written By Unknown on Minggu, 12 Januari 2014 | 07.51

When it comes to parsing web pages in PHP, you need to look no further than Simple HTML DOM Parser. This DOM parser is an easy to implement library for parsing / scraping web pages. Let’s see you how we can use this library for our scraping needs.


I am going to show you the power of HTML parser with the help of an real world example. I usually follow the PlanetSuzy website for latest candid photos of celebrities and trust me I am crazy about Megan Fox. So, I decided to fetch all the photos of the actress from PS website as I hate browsing through the forum interface.

To read more about this article Click Here

For Demo Click Here

To download files Click Here

Check Expired Sessions using PHP, jQuery and Ajax

Written By Unknown on Rabu, 08 Januari 2014 | 08.04

My readers are asking that how do we display message to users that their sessions got expired. So I thought this tutorial will really useful to lots of web developer who working on session based websites.

I have used javascript timing event –  setInterval() – executes a function, over and over again, at specified time intervals. The setInterval() method will wait a specified number of milliseconds, and then execute a specified function, and it will continue to execute the function, once at every given time-interval.

To read more about this article Click Here

For Demo Click Here

To download files Click Here

Mashable Style Drop Down Menu using PHP, Mysql and jQuery

Written By Unknown on Minggu, 29 Desember 2013 | 07.48

Everyone knows that Mashable is the world’s largest independent website dedicated to news, information, technology and resources for the connected generation. Now I am going to explain you about how to create mashable style dynamic drop down menu using Php, Mysql & jQuery Ajax.

To read more about this article Click Here

For Demo Click Here

To download files Click Here

Magnoliyan Video Chat using PHP, jQuery and Html5

Written By Unknown on Rabu, 25 Desember 2013 | 07.45

Magnoliyan Video Chat (mgVideoChat) is full featured video communication system with integrated text chat available directly within your web browser. You can consider it as online web based Skype, but without the requirement to install any additional software, plugin nor flash.

There is unlimited number of use cases: online live video chat support, private rooms, community chat rooms…

To read more about this article Click Here

For Demo Click Here

PHP Password validations using regexp

Written By Unknown on Minggu, 22 Desember 2013 | 08.47

Passwords are very important security matters. How can the web developer be sure, that some security guidelines were implemented when passwords are set? Here is a password validation function, that might be useful:

public function isValidPasswordMsg($pwd)
{
    $error = "";
    if( strlen($pwd) < 6 ) {
        $error .= "Password too short! <br />";
    }

    if( !preg_match("#[0-9]+#", $pwd) ) {
        $error .= "Password must include at least one number! <br />";
    }

    if( !preg_match("#[a-z]+#", $pwd) ) {
        $error .= "Password must include at least one letter! <br />";
    }

    if( !preg_match("#[A-Z]+#", $pwd) ) {
        $error .= "Password must include at least one CAPS! <br />";
    }

    if( !preg_match("#\W+#", $pwd) ) {
        $error .= "Password must include at least one symbol! <br />";
    }

    if(empty($error))
        return TRUE;
    return $error;
}


The above function uses the php regular expressions function which is very useful in this situations.

Steps to create Dynamic Favicon in PHP

Written By Unknown on Rabu, 18 Desember 2013 | 08.48

Dynamic Favicon showing unread email counts directly in your browser tab icon. If your browser window has lots and lots of tabs open at anytime, this might be really a wonderful feature that lets user know of any unread item. Here is a small and powerful script in PHP that lets you create your own Dynamic favicon. We will use PHP GD library to manipulate the favicon image and add text into it. Below is the simple script that reads a favicon image add add some text character on it.

To read more about this article Click Here

For Demo Click Here

Useful PHP Functions and Codes for PHP Developers

Written By Unknown on Minggu, 15 Desember 2013 | 07.40

Hi guys, Today I am going to share some important PHP functions/Codes which I had been used in my web projects. This will really useful & save your coding time also. You can integrate anytime in your web projects / applications. All the below codes are more secure & worked well in most server platforms.

To read more about this article Click Here

For Demo Click Here

Cache Dynamic Pages to speed up load time using PHP

Written By Unknown on Rabu, 11 Desember 2013 | 08.14

If your website has hundreds of pages with many visitors everyday, you might want to implement some sort of caching mechanism for your website to speed up page loading time. Each client-server request consist of multiple database queries, server response and the processing time increasing overall page loading time. The most common solution is to make copies of dynamic pages called cache files and store them in a separate directory, which can later be served as static pages instead of re-generating dynamic pages again and again.

To read more about this article Click Here

To download files Click Here

 

Tips to Securing your PHP Application

Written By Unknown on Rabu, 04 Desember 2013 | 08.27

Now a days PHP Language is very popular among developers to develop large applications like facebook etc. So here I am going to tell how to secure your PHP applications in a simple steps.

File handling functions like fopenfile_get_contents, and include accept URLs as file parameters (for example:fopen('http://www.example.com/', 'r')). Even though this enables developers to access remote resources like HTTP URLs, it poses as a huge security risk if the filename is taken from user input without proper sanitization, and opens the door for remote code execution on the server. To disable this and limit file functions to local system, use the following setting in php.ini:
 
To read more about this article Click Here

Fetch / embed videos from url using PHP and Jquery

Written By Unknown on Minggu, 01 Desember 2013 | 07.53

Here I am going to share How to fetch videos from major sites like youtube, vimeo, dailymotion, yahoom google , mega videos, metacafe and many more. Now a days major websites like facebook also doing the same thing. U can also implement this code in your project (codeigniter, php projects).

To read more about this article Click Here

For Demo Click Here

To download files Click Here

Convert currency using google finance calculator in php

Written By Unknown on Rabu, 27 November 2013 | 09.24

Earlier we used to Convert currency using Google api. But as Google has closed its iGoogle service from 1st Nov 2013, this api will no longer work. But we have an alternative to convert currency using google finance calculator.

Here is a little code snippet that can be used to convert currency from one format to another.
It takes three parameters The amount to be converted, convert from and convert to


<?php
function convertCurrency($amount, $from, $to){
$url = "https://www.google.com/finance/converter?a=$amount&from=$from&to=$to";
$data = file_get_contents($url);
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
$converted = preg_replace("/[^0-9.]/", "", $converted[1]);
return round($converted, 3);
}

# Call function
echo convertCurrency(1, "USD", "INR");
?>

The above php function returns something like 62.285

The Currency formats can be of following types



AED => United Arab Emirates Dirham (AED)
AFN => Afghan Afghani (AFN)
ALL => Albanian Lek (ALL)
AMD => Armenian Dram (AMD)
ANG => Netherlands Antillean Guilder (ANG)
AOA => Angolan Kwanza (AOA)
ARS => Argentine Peso (ARS)
AUD => Australian Dollar (A$)
AWG => Aruban Florin (AWG)
AZN => Azerbaijani Manat (AZN)
BAM => Bosnia-Herzegovina Convertible Mark (BAM)
BBD => Barbadian Dollar (BBD)
BDT => Bangladeshi Taka (BDT)
BGN => Bulgarian Lev (BGN)
BHD => Bahraini Dinar (BHD)
BIF => Burundian Franc (BIF)
BMD => Bermudan Dollar (BMD)
BND => Brunei Dollar (BND)
BOB => Bolivian Boliviano (BOB)
BRL => Brazilian Real (R$)
BSD => Bahamian Dollar (BSD)
BTN => Bhutanese Ngultrum (BTN)
BWP => Botswanan Pula (BWP)
BYR => Belarusian Ruble (BYR)
BZD => Belize Dollar (BZD)
CAD => Canadian Dollar (CA$)
CDF => Congolese Franc (CDF)
CHF => Swiss Franc (CHF)
CLF => Chilean Unit of Account (UF) (CLF)
CLP => Chilean Peso (CLP)
CNH => CNH (CNH)
CNY => Chinese Yuan (CN¥)
COP => Colombian Peso (COP)
CRC => Costa Rican Colón (CRC)
CUP => Cuban Peso (CUP)
CVE => Cape Verdean Escudo (CVE)
CZK => Czech Republic Koruna (CZK)
DEM => German Mark (DEM)
DJF => Djiboutian Franc (DJF)
DKK => Danish Krone (DKK)
DOP => Dominican Peso (DOP)
DZD => Algerian Dinar (DZD)
EGP => Egyptian Pound (EGP)
ERN => Eritrean Nakfa (ERN)
ETB => Ethiopian Birr (ETB)
EUR => Euro (€)
FIM => Finnish Markka (FIM)
FJD => Fijian Dollar (FJD)
FKP => Falkland Islands Pound (FKP)
FRF => French Franc (FRF)
GBP => British Pound Sterling (£)
GEL => Georgian Lari (GEL)
GHS => Ghanaian Cedi (GHS)
GIP => Gibraltar Pound (GIP)
GMD => Gambian Dalasi (GMD)
GNF => Guinean Franc (GNF)
GTQ => Guatemalan Quetzal (GTQ)
GYD => Guyanaese Dollar (GYD)
HKD => Hong Kong Dollar (HK$)
HNL => Honduran Lempira (HNL)
HRK => Croatian Kuna (HRK)
HTG => Haitian Gourde (HTG)
HUF => Hungarian Forint (HUF)
IDR => Indonesian Rupiah (IDR)
IEP => Irish Pound (IEP)
ILS => Israeli New Sheqel (₪)
INR => Indian Rupee (Rs.)
IQD => Iraqi Dinar (IQD)
IRR => Iranian Rial (IRR)
ISK => Icelandic Króna (ISK)
ITL => Italian Lira (ITL)
JMD => Jamaican Dollar (JMD)
JOD => Jordanian Dinar (JOD)
JPY => Japanese Yen (¥)
KES => Kenyan Shilling (KES)
KGS => Kyrgystani Som (KGS)
KHR => Cambodian Riel (KHR)
KMF => Comorian Franc (KMF)
KPW => North Korean Won (KPW)
KRW => South Korean Won (₩)
KWD => Kuwaiti Dinar (KWD)
KYD => Cayman Islands Dollar (KYD)
KZT => Kazakhstani Tenge (KZT)
LAK => Laotian Kip (LAK)
LBP => Lebanese Pound (LBP)
LKR => Sri Lankan Rupee (LKR)
LRD => Liberian Dollar (LRD)
LSL => Lesotho Loti (LSL)
LTL => Lithuanian Litas (LTL)
LVL => Latvian Lats (LVL)
LYD => Libyan Dinar (LYD)
MAD => Moroccan Dirham (MAD)
MDL => Moldovan Leu (MDL)
MGA => Malagasy Ariary (MGA)
MKD => Macedonian Denar (MKD)
MMK => Myanma Kyat (MMK)
MNT => Mongolian Tugrik (MNT)
MOP => Macanese Pataca (MOP)
MRO => Mauritanian Ouguiya (MRO)
MUR => Mauritian Rupee (MUR)
MVR => Maldivian Rufiyaa (MVR)
MWK => Malawian Kwacha (MWK)
MXN => Mexican Peso (MX$)
MYR => Malaysian Ringgit (MYR)
MZN => Mozambican Metical (MZN)
NAD => Namibian Dollar (NAD)
NGN => Nigerian Naira (NGN)
NIO => Nicaraguan Córdoba (NIO)
NOK => Norwegian Krone (NOK)
NPR => Nepalese Rupee (NPR)
NZD => New Zealand Dollar (NZ$)
OMR => Omani Rial (OMR)
PAB => Panamanian Balboa (PAB)
PEN => Peruvian Nuevo Sol (PEN)
PGK => Papua New Guinean Kina (PGK)
PHP => Philippine Peso (Php)
PKG => PKG (PKG)
PKR => Pakistani Rupee (PKR)
PLN => Polish Zloty (PLN)
PYG => Paraguayan Guarani (PYG)
QAR => Qatari Rial (QAR)
RON => Romanian Leu (RON)
RSD => Serbian Dinar (RSD)
RUB => Russian Ruble (RUB)
RWF => Rwandan Franc (RWF)
SAR => Saudi Riyal (SAR)
SBD => Solomon Islands Dollar (SBD)
SCR => Seychellois Rupee (SCR)
SDG => Sudanese Pound (SDG)
SEK => Swedish Krona (SEK)
SGD => Singapore Dollar (SGD)
SHP => Saint Helena Pound (SHP)
SLL => Sierra Leonean Leone (SLL)
SOS => Somali Shilling (SOS)
SRD => Surinamese Dollar (SRD)
STD => São Tomé and Príncipe Dobra (STD)
SVC => Salvadoran Colón (SVC)
SYP => Syrian Pound (SYP)
SZL => Swazi Lilangeni (SZL)
THB => Thai Baht (฿)
TJS => Tajikistani Somoni (TJS)
TMT => Turkmenistani Manat (TMT)
TND => Tunisian Dinar (TND)
TOP => Tongan Paʻanga (TOP)
TRY => Turkish Lira (TRY)
TTD => Trinidad and Tobago Dollar (TTD)
TWD => New Taiwan Dollar (NT$)
TZS => Tanzanian Shilling (TZS)
UAH => Ukrainian Hryvnia (UAH)
UGX => Ugandan Shilling (UGX)
USD => US Dollar ($)
UYU => Uruguayan Peso (UYU)
UZS => Uzbekistan Som (UZS)
VEF => Venezuelan Bolívar (VEF)
VND => Vietnamese Dong (₫)
VUV => Vanuatu Vatu (VUV)
WST => Samoan Tala (WST)
XAF => CFA Franc BEAC (FCFA)
XCD => East Caribbean Dollar (EC$)
XDR => Special Drawing Rights (XDR)
XOF => CFA Franc BCEAO (CFA)
XPF => CFP Franc (CFPF)
YER => Yemeni Rial (YER)
ZAR => South African Rand (ZAR)
ZMK => Zambian Kwacha (1968-2012) (ZMK)
ZMW => Zambian Kwacha (ZMW)
ZWL => Zimbabwean Dollar (2009) (ZWL)


Build a simple web service API in php

People are looking for a wide variety of data in web sites which means most of the web applications today are not a single stand alone application.  Web services come into picture when different applications need to link their data. For example your web site can publish its data to rest of the world via a web service and the other sites can act as the consumers of the data.

To read more about this article Click Here

For Demo Click Here

Validate IPv4 Address in PHP

Written By Unknown on Minggu, 24 November 2013 | 08.45

Today I am going to tell how to validate IPv4 / IP address using PHP. Simple function which will used to check client IP address is valid or not.

Steps to validate IPv4 Address in PHP
  • Split IP address into segments  by dot(.)  using explode function
  • Make sure that there are 4 segments (eg : 192.168.1.45)
  • Make sure that IP cannot start with 0
  • IP segments must be digits & cannot be longer than 3 digits or greater than 255
To read more about this article Click Here

For Demo Click Here

Facebook style Hashtag System using PHP, MYSQL and jQuery

Written By Unknown on Rabu, 20 November 2013 | 07.59

If you are not aware of Hashtag, then I will say you would not using any social networking sites in a very large extent.  Here I am going to explain you about the advantages of hashtag & how you can implement it in your web projects using php & mysql.

Hashtags are essentially a filter, allowing people to see the conversation associated with that word or phrase. Hashtags is alternative to tags..  Twitter is the first site to introduce the hashtag. But now a days sites like facebook, Instagram, Vine & Tumblr are using this feature in all platforms. If you use the hashtag effectively then you will get the contents across different sites together in a single page.

To read more about this article Click Here

For Demo Click Here 

To download files C

iPFaces - Steps to create mobile app in PHP

Written By Unknown on Minggu, 17 November 2013 | 09.14

Development of a complex iPFaces application is really simple because the simulation mode can be used. This mode is capable of transfering XML content to a HTML page, which can be displayed in a web browser. It is a helpful tool for developers who can see their iPFaces application in the browser window and they do not need a real iPhone device for main development.

Developers can build and deploy an application to the application server and the browser will show them the GUI which is almost the same as a screen in an iPhone application. There is a difference in the GPS elements. 

A GPS field is working in a browser only as text field that can be filled by user and GPS coordinates will be submitted. The GPS field is hidden on mobile devices, because the location of the device is detected without interaction with the user.

To read more about this article Click Here

For Demo Click Here

Get mimetype of an image in php

Written By Unknown on Jumat, 15 November 2013 | 23.35

Mime type is an standard identifier of a file which indicates the type of data a file contains. It has two parts divided with a slash(/) like image/png.

The built in function of php getimagesize() gives lots of information about an image. And this function is enough to get the mime type of an image. It also returns Width and Height of the image.

GD Library is also not required to use this function.
   
$image = getimagesize("imagename.jpg");
echo $image['mime'];

It returns an array with upto 7 elements.
  Array
(
[0] => 200
[1] => 125
[2] => 2
[3] => width="125" height="125"
[bits] => 8
[channels] => 3
[mime] => image/jpeg
)
Index 0 and 1 of the array contains the width and height of the array respectively.

This function can play a big role if you are creating an image upload script and want to limit the size of the image. Suppose if you don't want to upload an image greater than 400x250.

Just check width and height of the image using getimagesize() function and return respective messages to user to upload image smaller than the required size.
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger