Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

How To find out Visitors IP ADDRESS using PHP

How To find out Visitors IP ADDRESS using PHP

I f you a PHP programmer then you will find it very easy to track your visitors IP Address, if someone spaming on your site you can also block him. PHP is alway easy and powerful than other scripting language lets check the whole code .Codding:

<!DOCTYPE html>
<html lang=”en”>
<head>
<title>IP Address</title>
<meta charset=”utf-8″ />
</head>
<body>
<?php
$ip=$_SERVER[‘REMOTE_ADDR’];
echo “<br/>Your IP Address is “.$ip;
// suppose IP 127.0.0.1 for localhost and it redirects to prevent spam
if($ip==’127.0.0.1′)
{
echo “You are blocked for Spaming”;
header(“refresh:5; http://www.openplus.in”);
}
?>
</body>
</html> 

 

PHP Constant tutorial with practicle example

PHP Constant tutorial with practicle example

Constant: Constant refers to fixed value that does not change the value
during the execution of program. Constant are defined using PHP’s
define () function which accept two arguments. The $ prefixed is not
required for constant.A simple Example :

<?php
//define constant
define(‘PI’,3.14);
$r=5;
//use constant
$area=PI*$r*$r;
echo “Area of circle=”.$area;
?>

 

Result – 78.5

Practical example:
This script is used for data base connection.

<?php
define(‘MYSQL_HOST’,’localhost’);
define(‘MYSQL_USER’,’root’);
define(‘MYSQL_PASS’,”);
?>

Install XAMPP on 32/64 bit Linux Distro

Install XAMPP on 32/64 bit Linux Distro

Today Linux has become number one choice in Open Source world whether it is Desktop experience, programming, server or Web Development Linux has no match. Its Secure , fast and comes in many flavor.
In this tutorial we will focus how to install Xampp on linux 64 bit OS. Earlier day the Linux version of XAMPP called as LAMPP. But it comes as XAMPP with more improvements.
For Installing and running XAMPP on 64 bit linux distro install wine through package manager , it will install 32 bit packages so you can run  32 bit application also. Please note that  XAMPP is till now a 32 bit application. After installing Wine Download XAMPP  latest version from
After downloding Xampp copy it to home folder, and rename it to xampp.tar.gz
Note : Some distro allows root login such as PCLinuxOS, OpenSUSE so if your distro allows root login then logged as root. Some distro doesn’t allow root login like Ubuntu, Kubuntu … don’t worry login as default.
Go to a Linux shell and login as the system administrator root
su tar xvfz xampp.tar.gz -C /opt
or if fail try
sudo tar xvfz xampp.tar.gz -C /opt
it will ask password , use your root password and hit enter.
To start XAMPP simply call this command:
sudo /opt/lampp/lampp start
or
su  /opt/lampp/lampp start
You should now see something like this on your screen:
Starting XAMPP 1.7.7…
LAMPP: Starting Apache…
LAMPP: Starting MySQL…
LAMPP started.
Ready. Apache and MySQL are running.
Just type in the following URL at your favourite web browser:
http://localhost
Now you should see the start page of XAMPP containing some links to check the status of the installed software and some small programming examples.
xampp 64 bit linux
Xampp on Kubuntu 12.04 64 bit
Now watch complete video tutorial Install laravel,lumen on xampp only on Linux  Some Usedful commands to remeber while playing with xampp.
startStarts XAMPP.
stopStops XAMPP.
restartStops and starts XAMPP.

This tutorial tested on Ubuntu, Linux Mint ,OpenSUSE and Fedora