Skip to main content

Get Remote IP Address in PHP

 function getRemoteIPAddress() { $ip = $_SERVER['REMOTE_ADDR'];return $ip; }

Comments

Popular posts from this blog

Base64 Encode and Decode String in PHP

function base64url_encode($plainText) { $base64 = base64_encode($plainText); $base64url = strtr($base64, '+/=', '-_,'); return $base64url;  } function base64url_decode($plainText) { $base64url = strtr($plainText, '-_,', '+/='); $base64 = base64_decode($base64url); return $base64; }

GMAP3 – A jQuery Google Maps Plugin For The Developers

GMAP3  is one of the finest Google Maps jQuery Plugin which uses Google Map API version 3 to create maps with the advanced features available in it.  Google themselves has simplified the efforts in adding the maps in any website, but still applying some advance features are tricky sometimes. Unlike the other Google Maps plugin, GMAP3 aims to allows many manipulation of the google map API version 3. Let me take a look on the integration part. As I said, integration Google Maps with GMAP3 is simple and all you need is adding few things to get start with it Step 1:  Add the Google Maps script before closing  </head> <script type = "text/javascript" src = "http://maps.google.com/maps/api/js?sensor=false" ></script> Step 2:  Download the GMAP3 jQuery Plugin and upload it to your server <script type = "text/javascript" src = "gmap3.min.js" ></script> Now in order to embed the Google Maps, do the followi...

Send Mail using mail function in PHP

$to = "admin@user.vn"; $subject = "User.vn"; $body = "Body of your message here you can use HTML too. e.g. <br> <b> Bold </b>"; $headers = "From: Peter"; $headers .= "Reply-To:  info@yoursite.com "; $headers .= "Return-Path: mailto:info@yoursite.com"; $headers .= "X-Mailer:PHP5"; $headers .= 'MIME-Version: 1.0"; $headers .= 'Content-type: text/html; charset=iso-8859-1"; mail($to,$subject,$body,$headers);