calendar in php

In this tutorial i am showing to create calendar in php. you can copy-paste below the code and run it on your computer. —————— calendar.php —————– <!DOCTYPE html> <html> <head> <title>Calendar</title> <style> div#calendar{ margin:0pxauto; padding:0px; width: 602px; font-family:Helvetica, “Times New Roman”, Times, serif; } div#calendar div.box{ position:relative; top:0px; left:0px; width:100%; height:40px; background-color: #787878 ; }

File based page counter in php

In this tutorials i am create file based page counter in php. so you can try it. and learn something new. <!– Create an empty file myData.dat first –> <?php $cfile = “myData.dat”; $fh = fopen($cfile, “r+”); if (!$fh){ die(“<BR>Failed to open file <I>$cfile</I>.”); } $s = fgets($fh, 6); $count = (int) $s; $count =

Random Images in php

In this code you can show the random images in your website page. <html> <head> <title>Random Images</title> </head> <body bgcolor = “#000000” > <?php srand( microtime() * 1000000 ); $num = rand( 1, 4 ); switch( $num ) { case 1 : $image = “a.jpg”; //change image as your path $url=”a.php”; // change url path

Recursion in php

Recursion : What is recursion ? Recursion means factorial . A recursive function is one that calls an instance of the same function from withing itself. There are times when this type of recursion can overcome problems and handle scenarios that would otherwise be imposiible .   syntex : n! = n * ((n –

Create Cookie Based Page Counter in php

<?php if (!isset($_COOKIE[‘visits’])) $_COOKIE[‘visits’] = 0; $visits = $_COOKIE[‘visits’] + 1; setcookie(‘visits’,$visits,time()+3600*24*365); ?> <html> <head> <title> Visit Counter</title> </head> <body> <?php if ($visits > 1) { echo(“This is visit number $visits.”); } else { // First visit echo(‘Welcome to my Website! ‘); } ?> </body> </html>

Random Password Generate in PHP

In this tutorial i am create Random Password Generate in php so you can choose secure password create . <?php $string = “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*()_+{}<>?”; echo substr(str_shuffle($string), 0, 12); //you can add start to end length from the password //12 is minimum 12 letter password ?>