If you want to add a counter to a web page or a website then use the below simple PHP Counter Script using MySql. It is very easy to implement it and it counts whenever a page is being refreshed and the script won’t reduce page speed, unlike page counter scripts. PHP Visitor Counter Script […]
PHP
How to Create Ical File to Work on Outlook, Google Calendar and Mac Icalendar
To Create Ical files we need to follow some standards set by ietf.org. Below are the working copies of the sample ical files created and these are tested on Outlook calendar, Google Calendar, Mac Icalendar, and Thunder Bird Calendar with Lightning plugin. How to Create Ical File Ical Events Files for Create Event, Update Event, […]
How to Get Source Code of a Web Page
If you are looking for How to Get Source Code of a Web Page or link then just follow below steps. How To Find A Web Page’s Source Code it easy? Source Code of a Web Page By using below PHP function you can easily get the source code of a web page, Source code […]
How to use Google map Address in PHP
Let’s Start, First we Getting latitude and longitude from Address in Google Maps Using PHP. The script is given below. Google map Address in PHP In Above code, we just pass the latitude and longitude point (,). See $Lat for latitude and $Lon for longitude . In script code iset the zoom level to 5 […]
10 Mistakes Which PHP MySQL Developers Make
1. Using MyISAM rather than InnoDB MySQL has a number of database engines, but you’re most likely to encounter MyISAM and InnoDB. MyISAM is used by default. However, unless you’re creating a very simple or experimental database, it’s almost certainly the wrong choice! MyISAM doesn’t support foreign key constraints or transactions, which are essential for […]
How to Get Current Page URL Using PHP
If you would like to know from which page the request has come from using post Method then there is a simple PHP script can solve your issue. Get Current Page URL Using PHP Check below script to Get Current page using PHP function getCurrentURLPage() { $s = empty($_SERVER[“HTTPS”]) ? ”: ($_SERVER[“HTTPS”] == “on”) ? […]
PHP Magic Constants __LINE__ __FILE__ __DIR__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__
Below are the list of PHP predefined Magic Constants PHP Magic Constants Name Description __LINE__ The current line number of the file. __FILE__ The full path and filename of the file with symlinks resolved. If used inside an include, the name of the included file is returned. __DIR__ The directory of the file. If used […]
How to Check the Last Day in Month
Check the Last Day in Month $startDate = “20150624”;$endDate = “20150722”;$startDate = strtotime($startDate);$endDate = strtotime($endDate);$dayLength = 60 * 60 * 24;$checkDateRange = ($endDate – $startDate) / $dayLength;$datesStartMonth = date(‘t’, $startDate);if ($checkDateRange > $datesStartMonth) {echo $error = “Date range should be with in one month”;}
PHP Server Common Codes To Get Values
$_SERVER[“DOCUMENT_ROOT”] === /home/user/www$_SERVER[“SERVER_ADDR”] === 143.34.112.23$_SERVER[‘HTTP_HOST’] === example.com (or with WWW)$_SERVER[“REQUEST_URI”] === /folder1/folder2/yourfile.php?var=blabla#123__FILE__ === /home/user/www/folder1/folder2/yourfile.php —>//p.s. ON WINDOWS SERVERS, instead of / is basename(__FILE__) === yourfile.php__DIR__ === /home/user/www/folder1/folder2 [same: dirname(__FILE__)]$_SERVER[“QUERY_STRING”] === var=blabla#123$_SERVER[“REQUEST_URI”] === /folder1/folder2/yourfile.php?var=blabla#123 parse_url($_SERVER[“REQUEST_URI”], PHP_URL_PATH) === /folder1/folder2/yourfile.php $_SERVER[“PHP_SELF”] === /folder1/folder2/yourfile.php//if “parentfile.php” includes this “yourfile.php”(and inside it are the codes written), and “parentfile.php?a=123” is opened, then$_SERVER[“PHP_SELF”] […]