Want to add text in images using PHP? This small script demonstrate how to add a custom text to an image loaded onto your page.
Read MoreThis is a simple PHP tutorials and script for getting remote visitors with their IP Address. With this tracking your visitor is very easy and simple with PHP. PHP has a set of global variables. Among them, we use $_SERVER variable to get an IP address of a remote computer. REMOTE_ADDR is the constant that is used to get the IP Address of a remote computer.
Note that this script may not return IP Address if the client/user firewall is on or when client is using some proxy software.
1 2 3 4 | < ?php $ipaddress=$_SERVER["REMOTE_ADDR"]; echo "Your IP ADDRESS: ". $ipaddress; ?> |
Another way of retrieving IP Address is using function getenv().
1 2 3 4 5 | < ?php $userip = $_SERVER["HTTP_X_FORWARDED_FOR"]; $proxy = $_SERVER["REMOTE_ADDR"]; $host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]); ?> |
OUTPUT
Server IP ADDRESS: [exec]echo $_SERVER["HTTP_X_FORWARDED_FOR"];[/exec] User IP ADDRESS: [exec]echo $_SERVER["REMOTE_ADDR"];[/exec] User HOST ADDRESS: [exec]echo @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]);[/exec]
$userip is the IP address of the user thats been passed on by the server. $proxy is the IP address of the server itself and $host is the host address of the user. If your PHP version is less than 4.3 then use $HTTP_SERVER_VARS in place of $_SERVER
Download : PHP Script Get IP Address of Visitor
Earlier post explained on {{post id="how-to-send-e-mail-using-php" text="how to send a plain email using PHP"}}. This time, we are discussing about sending page contents to email. This technique is based on output buffering. Basically, it would first create read a html file and store in buffer using ob_start(). Next step is to include desire HTML page using include function and then store the contents of that HTML page using ob_get_contents(). Finally use mail() function to send email.
Read MoreThis articles demonstrate and explains how to create a secure PHP login script that will allow safe authentication. Here, cookies are not used because of preventive measure against cross-side scripting. The back-end used is MySQL. So, you should have knowledge of MySQL and database as well.
Read MoreThis article explains about sending a simple plain mail using PHP mail function.
Read More