Programming

PHP script for sample contact page for website

Contact page for website <?php include(‘config.inc.php’); class ContactUs { var $arrErrors = array(); var $strSuccess = ”; public $strSelect=null; public $objResult=null; var $objConfig = null; var $objDbConn=null; var $intRandSiteLimit = 35; var $arrRandSites = array(); var $strName = ”; var $strPhone = null; var $strEmail = ”; var $strContent = ”; var $strReferrer = null; …

PHP script for sample contact page for websiteRead More »

How to create user login, forgot password and logout page using php script

To create a login page in php Note: Create a table tbl_login with uname and pwd //config.inc.php <?php class Config { public $dbHostname = ‘localhost’; public $dbUsername = ‘root’; public $dbPassword = ‘xxx’; public $dbName = ‘dbname’; } ?> //index.php <?php session_start(); include(“config.inc.php”); class Login { public $strUsername = null; private $strPassword = null; public $arrErrors …

How to create user login, forgot password and logout page using php scriptRead More »

How to output or print the array results in php

To print an array result using var_dump() <?php $a = array(1, 2, array(“a”, “b”, “c”)); var_dump($a); ?> Note: var_dump() is used to dumb the information about the variable output array 0 => int 1 1 => int 2 2 => array 0 => string ‘a’ (length=1) 1 => string ‘b’ (length=1) 2 => string ‘c’ (length=1) To print an array result …

How to output or print the array results in phpRead More »

Php script or program to find square root of a given number

Simple program to find square root of a given number <?php $num=9; $root=0; $odd=1; while($num>0) { $num-=$odd; $root++; $odd+=2; } echo $root; ?> output  3 Program to find square root of a given number using sqrt functions, classes and objects <?php class square { public $num=null; public $objRes=null; function processRequest() { $this->square=$_REQUEST[‘num’]; } function run() …

Php script or program to find square root of a given numberRead More »

How to install, setup and configure Wamp server

WAMP WAMP is an acronym, where W stands for Windows, A stands for Apache, M stands for MYSQL,  P stands for PHP, which refers to set of open source application combined with microsoft windows, which are commonly used for web server environment. Step 1:Installation First have to download the latest version of WAMP server from http://www.wampserver.com/en/download.php . You …

How to install, setup and configure Wamp serverRead More »