Blog Archives

How To Make Weather API for Websites


1. Make a folders called “api”, “cache”, “weather” 2. Now Make a file called “weather.php” inside folder “api”. 3. write the below code “weather.php” weather.php date_default_timezone_set(‘Asia/Dubai’); $date = date(‘Y-m-d’) ; $file_name_timestamp = strtotime($date); $filename = $_SERVER[‘DOCUMENT_ROOT’].’/api/cache/weather/’.$file_name_timestamp.’.php’; $weather_data=”; if (!file_exists($filename)) {

Tagged with: , ,
Posted in Mixz Tricks, PHP

PHP for loop that goes to certain number and again starts from zero


Here is the code that actually worked in my case : $start_time = some_dynamic_value; $end_time = some_dynamic_value; $i= $start_time; $flag = false; if($start_time > $end_time) $flag = true; while ($i <= $end_time || $flag) { echo $i; if($i == 24)

Tagged with: ,
Posted in PHP

Create a file using PHP


The fopen function needs two important pieces of information to operate correctly. First, we must supply it with the name of the file that we want it to open. Secondly, we must tell the function what we plan on doing with that

Tagged with:
Posted in Mixz Tricks, PHP

Change Date Format in PHP


date_default_timezone_set(‘Asia/Calcutta’); $date = ‘2006-01-24’; echo date(‘d-M-Y’, strtotime($date)); // outputs 24-Jan-2006 echo date(‘dMY’, strtotime($date)); // outputs 24Jan2006

Posted in Mixz Tricks, PHP

Steps to Configure PHP NuSphere Debugger


1. start wampserver and check your php version by clicking on wamp tray icon and going to php > version 2. open C:Program FilesnuspherephpeddebuggerserverWindowsx86 and copy the file php_dbg.dll-5.2.x [considering php version to be 5.2 , if you have any

Tagged with: , ,
Posted in PHP, Special

How To Make A Site Password Protected


Step 1:Go to any site which generates md5 hash code[example I use http://shop.alterlinks.com/htpasswd/htpasswd.php Step 2: Write down the username you want to put & generate the hash code Step 3: Login to the root directory of your file server Step

Tagged with: , ,
Posted in PHP
Follow me on Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 443 other followers