Get IP address in CodeIgniter

by Bhumi //Nov 20,2012 // No comment

Get IP address in CodeIgniter
Share This:Share on Facebook3Share on LinkedIn4Tweet about this on Twitter0Share on Google+2Share on Reddit0Buffer this pageDigg thisEmail this to someoneFlattr the authorShare on StumbleUpon0Share on TumblrPin on Pinterest0

CodeIgniter is great framework by its simplicity because structure of the CodeIgniter framework is clear and flexible.

Let’s understand the function used to get user’s ip in CodeIgniter.

CodeIgniter offers a way to retrieve the user’s IP address with using a in-built function in CodeIgniter.

If the IP address isn’t valid, function will return 0.0.0.0.

Next,is about To validate an IP address and you should use have a function for that also which will return TRUE or FALSE.

The above function validates the IP automatically.

To retrieve a user agent

To determine the user agent of the user, you can use the below code in CodeIgniter. It will return the user agent of the user’s web browser; if not available, it will
return FALSE.

Is this information useful? What other tips would you like to read about in the future?

Thanks for reading and feel free to share your thoughts, don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

RELATED POST

How to fetch and display feed in WordPress?

Share This:02113010Feeds are very useful features to read contents.So, Today i am going to explain about how to use feed in wordpress and which functions READ MORE

Method Chaining in PHP

Share This:2400000 Method Chaining is the new feature of object-oriented approach introduced in PHP5.Today I am going to explain how to use method chaining in READ MORE

To create zoho leads using PHP

Share This:0400000 Today i am going to explain about how to create zoho leads from php. Zoho provide online lead management system.Zoho leads take details READ MORE

Webservice in WordPress

Share This:2600000 Here i am going to explain new article about how to call webservice in wordpress. Webservices are useful to retrieve your contents ftom READ MORE

Clean HTML content in PHP

Share This:2400000 After a long long time i get time to write article and i am curious to write but didn’t get time. So, Today READ MORE

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">