Category Archives: PHP

PHP Code to Generate Page Source of a webpage as Document file

In this article, i am going to explain how to create a document file, which having source code of webpage using php. Using file_get_contents() and html_entities() php functions, source  code of a webpage will be saved. By using header() function, document file will be create with source code of a webpage as contents. [code type=php]… Read More »

Category: PHP

How To: Install WordPress in Our System

WordPress is a Content Management System (CMS), which is used to setup a blog or website without any coding knowledge More over wordpress is a open source, we can modify wordpress’s php functionality. WordPress setup files are available in www.wordpress.org . By using wordpress plugins, we can make any kind of functionalists (like quiz, member login,… Read More »

Category: PHP

PHP Code to Get Alexa Rank

Every website have an unique alexa rank. To see the alexa rank of our site, we have to go to the www.alexa.com or install alexa plugin or place alexa widget in our website. By using php code also we can get alexa rank for our website. Here i have used php code to get alexa… Read More »

Category: PHP

PHP Code to Get Facebook Like, Share and Comment Count

Facebook like, comment and share count can be get through facebook buttons, which are provided by facebook. Here i am going to explain how to get the facebook like, share, comment and comment_box count using php script. Facebook Share Count By using this URL http://graph.facebook.com/, we can get facebook like and share count. But this… Read More »

Category: PHP

5 PHP Functions to Fetch Data from Database

Mostly used php functions for fetching data from database are given. I have listed 5 php functions to fetching data. mysql_fetch_assoc() mysql_fetch_object() mysql_fetch_array() mysql_fetch_row() mysql_result() Database Single field only available in this database and field’s name is “name”. 1] mysql_fetch_assoc() mysql_fetch_assoc() fetch the data from database through associative array. [code type=php] <html> <?php $query=mysql_query(“select *… Read More »

Category: PHP

PHP Code to Get Second Largest Number

To get second largest number from database is easy with mysql query. We can also get second largest number using php code. By using mysql_num_rows() and mysql_result() function this can be obtained. Database Structure   [code type=php] <html> <body> <?php $query=mysql_connect(‘localhost’,’root’,”); mysql_select_db(“freeze”,$query); $query1=mysql_query(“select name from tb”); $query2=mysql_num_rows($query1); $value=$query2-2; echo mysql_result($query1,$value); ?> </body> </html> [/code] PHP… Read More »

Category: PHP

PHP Code to Display Other website in Our webpage

We can display some others website and webpages in our website. By using php code, we can get source code of a webpage. The source code, which we had got that have to be used to display the website. URL will be get through POST method and using PHP function file_get_contents() will get URL’s source code and display… Read More »

Category: PHP

User Registration Using PHP MySQL

user registration using php mysql is an important concept for newbie programmer, user details like username, password, gender of the user and email address will be asked. After user provided their details, in this index.php itself database updation will be takes place and notification about registration will be shown alert box. Demo [code type=html] CREATE TABLE `freeze`.`tb` (… Read More »