tag:blogger.com,1999:blog-48485408035733262682024-03-28T05:23:01.906+05:30Tinywall InfomediaTechnology BlogMohankumar Swaminathanhttp://www.blogger.com/profile/07354152091283408947noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-4848540803573326268.post-1398769705818310982014-12-31T16:06:00.001+05:302014-12-31T16:12:31.343+05:30Creating Custom DQL MySQL Functions in Symfony2 with Doctrine<div dir="ltr" style="text-align: left;" trbidi="on">
<br>
Hi, this post is all about how to create and register doctrine custom DQL function with symfony. By default symfony with doctrine not allows some special functions like Cos, Sin, Acos, Atan, Date_diff, Concat etc.,<br>
<br>
But Doctrine allow us to write three different types of custom DQL functions<b> </b>such as datetime, numeric, string functions. so, this post guide you to take advantage over doctrine custom DQL functions with symfony.<br>
<br>
Ok, by simple three steps am gonna guide you to write your own DQL functions. <br>
<br>
<br>
</div><a href="https://www.tinywall.info/2014/12/creating-custom-mysql-dql-functions-in-symfony-doctrine.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Anonymousnoreply@blogger.com7tag:blogger.com,1999:blog-4848540803573326268.post-41900875779539179012014-11-27T10:08:00.000+05:302014-11-27T10:08:58.950+05:30Different ways of symfony2 database operations and executing queries using doctrine DQL<div dir="ltr" style="text-align: left;" trbidi="on">
<br>
<div class="MsoNormal" style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.4799995422363px; margin-bottom: 0.0001pt; text-align: justify;">
<span style="text-align: left;"><span style="font-family: 'Times New Roman', serif;">Symfony is an enterprise level PHP MVC framework. In symfony database operations are done using Object Relationship Mapping (ORM) which means we use Classes and Objects rather than direct SQL queries. </span></span><span style="font-family: 'Times New Roman', serif;"> </span></div>
<div class="MsoNormal" style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.4799995422363px; margin-bottom: 0.0001pt; text-align: justify;">
<span style="font-family: 'Times New Roman', serif;"><br></span></div>
<div class="MsoNormal" style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.4799995422363px; margin-bottom: 0.0001pt; text-align: justify;">
<span style="font-family: 'Times New Roman', serif;"> The easiest way to understand how Doctrine works in symfony2 is to see it in action using example. In this tutorial, you'll configure your database, create a <b>Product</b> object, persist it to the database and fetch it back out. </span></div>
<br>
</div><a href="https://www.tinywall.info/2014/11/different-symfony2-database-operations-execute-query-doctrine-dql.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Anonymousnoreply@blogger.com78tag:blogger.com,1999:blog-4848540803573326268.post-15022134752576039812014-11-26T13:51:00.008+05:302014-11-26T13:54:37.981+05:30Getting started with Symfony2 Database Operations Doctrine Example<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<br></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: left;">
<span style="font-family: Times New Roman, serif;"><br></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="text-align: left;"><span style="font-family: Times New Roman, serif;"> Symfony is an enterprise level PHP MVC framework. In symfony database operations are done using Object Relationship Mapping (ORM) which means we use Classes and Objects rather than direct SQL queries. </span></span><span style="font-family: Times New Roman, serif;"> </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="font-family: Times New Roman, serif;"><br></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="font-family: Times New Roman, serif;"> The easiest way to understand how Doctrine works in symfony2 is to see it in action using example. In this tutorial, you'll configure your database, create a <b>Product</b> object, persist it to the database and fetch it back out. </span><br>
<br class="Apple-interchange-newline">
</div></div><a href="https://www.tinywall.info/2014/11/symfony2-database-operations-doctrine-example.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-4848540803573326268.post-47923358961028799722014-05-28T19:06:00.000+05:302014-06-01T19:33:25.511+05:30Tutorial on install, setup and getting started in Symfony 2 PHP MVC framework with Hello World example on Windows<div dir="ltr" style="text-align: left;" trbidi="on">
PHP is one of the widely used web development language, and Symfony is an Enterprise level PHP MVC framework. Here I am explaining the steps for getting started with Symfony in Windows with a 'Hello World' example in Symfony.<br>
<br>
<br>
</div><a href="https://www.tinywall.info/2014/05/install-setup-getting-started-tutorial-php-symfony-hello-world-example-windows.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com8Chennai, Tamil Nadu, India13.0524139 80.25082459999998712.5573929 79.605377599999983 13.547434899999999 80.896271599999992tag:blogger.com,1999:blog-4848540803573326268.post-226581336179880862014-04-10T15:59:00.001+05:302014-05-25T10:27:28.789+05:30How to see, edit and tamper all http, https requests, responses made from an android mobile or tablet device?<div dir="ltr" style="text-align: left;" trbidi="on">
In previous posts we saw an <a href="http://goo.gl/u1L1cg">introduction to web proxy debugging</a> and <a href="http://goo.gl/Zm1ueO">decrypting secure SSL requests</a>.<br>
<br>
Yet still, have you ever wondered how your mobile/tablet communicates with websites? , How information is being sent & received in my Facebook, Gmail app that you installed in your smartphone?<br>
<br>
Well, I did, and here is what I found. We can view, capture and play with data sent from any smartphone over the network.<br>
<br>
</div><a href="https://www.tinywall.info/2014/04/how-to-see-edit-tamper-http-https-request-response-from-any-android-mobile-tablet-device.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com233tag:blogger.com,1999:blog-4848540803573326268.post-24103770804160299542014-04-08T12:36:00.000+05:302014-05-25T10:30:34.965+05:30How to see, edit and tamper HTTPS encrypted SSL data sent from any browser or system? <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM1xyXPBeeZK9l68Utw6FZNSUwz9Lc1O26CY99f8T0sTavVY-RRtKVBHuEcFNi-UEJFuhHi2ZlUtTf5P94qybBsHgEY43hGW5U1bbeZOboAA-uu1dWYpnvwqww13rU1GQ30qrGrcjdQQ/s1600/SSL+data.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM1xyXPBeeZK9l68Utw6FZNSUwz9Lc1O26CY99f8T0sTavVY-RRtKVBHuEcFNi-UEJFuhHi2ZlUtTf5P94qybBsHgEY43hGW5U1bbeZOboAA-uu1dWYpnvwqww13rU1GQ30qrGrcjdQQ/s1600/SSL+data.png"></a></div>
In the <a href="http://goo.gl/u1L1cg">last post</a>, we saw how to view & edit HTTP traffic using Charles.<br>
<br>
Now that we’re cool enough to crack open any requests from our PC, not all websites are that dumb to just work on HTTP. Most sites we encounter, may follow a <i>secure connection</i> – <b>HTTPS </b>or <b>SSL</b> certified.<br>
It’s still easier to dismantle, read & edit HTTPS too!<br>
<br>
</div><a href="https://www.tinywall.info/2014/04/how-to-see-edit-tamper-https-ssl-encrypted-request-data-from-any-browser-or-system.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com10tag:blogger.com,1999:blog-4848540803573326268.post-19822891466674970772014-04-07T13:32:00.001+05:302014-05-25T10:34:51.235+05:30How to edit requests and responses, hack, test and tamper with data to websites from browser using Charles web debugging proxy?<div dir="ltr" style="text-align: left;" trbidi="on">
Though browsers are very comfortable, ever wondered what’s going on underneath it?<br>
What is it sending and receiving when we visit a webpage? <br>
Can I change it manually? What happens if I try to comment 100 times the same thing?<br>
Wanna hack that Facebook game, or play around with request, response or headers?<br>
<br>
</div><a href="https://www.tinywall.info/2014/04/how-to-edit-request-response-hack-tamper-website-any-browser-from-PC-with-Charles.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com34tag:blogger.com,1999:blog-4848540803573326268.post-73025332539640820942014-04-05T18:16:00.001+05:302014-05-25T10:02:54.833+05:30What is new in Java 7? New useful features<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQPyo9vK4JsZFXUURAzvYElslAryNiAlKJj1qVmkrVAGofMPVoGrI4UxDEe32-Q07nvWF60AKkFYCPyr1C8kZtUPE2FIGh43vOaWLNLFd8m61bgJ2Hlk6oHckaqE_dBwa4Dyfif35Dvw/s1600/java.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQPyo9vK4JsZFXUURAzvYElslAryNiAlKJj1qVmkrVAGofMPVoGrI4UxDEe32-Q07nvWF60AKkFYCPyr1C8kZtUPE2FIGh43vOaWLNLFd8m61bgJ2Hlk6oHckaqE_dBwa4Dyfif35Dvw/s1600/java.png" height="200" width="200"></a><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java 7</a> is everywhere now and your boss maybe thinking to migrate too. So if you are still coding old way, it's useful to sneak peek the features.<br>
<br>
Java has been constantly growing so much bigger that I cannot fathom all that is added to it.<br>
Let me sum up the ones I found useful in my daily use. Consider this an introduction to Java 7 and we’ll be rolling out more detailed posts on each topic eventually.<br>
<br>
</div><a href="https://www.tinywall.info/2014/04/what-is-new-in-java-7-useful-features.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com6tag:blogger.com,1999:blog-4848540803573326268.post-31772276545731981412013-10-12T16:48:00.000+05:302014-05-25T13:25:57.564+05:30Google app engine php tutorial in windows. Getting started hello worldexample. GAE development and deployment<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="clear: both;">
</div>
<br>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHRVbylGvmqHi0ItpMWa-BED3F-2eX1jkAKhV3E4CzQvv3hBvNxJVtQsOCoKIH6zy-tFj5ekVLv-JKRQHX0-XALTxBXwVbXLCJ4E4-Csct2sOBikF7LypDHzA5W6HaipX00e9gtkdfVw/s1600/google-app-engine-php..jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHRVbylGvmqHi0ItpMWa-BED3F-2eX1jkAKhV3E4CzQvv3hBvNxJVtQsOCoKIH6zy-tFj5ekVLv-JKRQHX0-XALTxBXwVbXLCJ4E4-Csct2sOBikF7LypDHzA5W6HaipX00e9gtkdfVw/s1600/google-app-engine-php..jpg" height="219" width="640"></a></div>
<br>
<a href="https://cloud.google.com/products/app-engine" target="_blank" title="https://cloud.google.com/products/app-engine">Google App Engine</a> (GAE) is a platform as a service (PaaS) cloud computing platform for developing and hosting web applications. Recently Google has made Google App Engine PHP runtime support fully available to the general public, meaning you can run your PHP applications in the Google Cloud Infrastructure with various <a href="https://cloud.google.com/pricing/" target="_blank" title="https://cloud.google.com/pricing/">pricing plans</a>.<br>
</div><a href="https://www.tinywall.info/2013/10/google-app-engine-php-windows-getting-started-hello-world-example-gae-development-deploy.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com19tag:blogger.com,1999:blog-4848540803573326268.post-66402032952372964342013-01-31T18:54:00.000+05:302014-05-25T10:03:53.474+05:30Create automatic mysql database backup using cronjob, gzip and shell script in linux<div dir="ltr" style="text-align: left;" trbidi="on">
MySQL which is the most popular and widely used opensource database. Many web applications are developed using the MySQL database. It's always a best practice to backup the your CMS or any custom developed web application database daily.<br>
<br>
The three easy steps to configure the automatic backup in Linux is as follows,<br>
<br>
</div><a href="https://www.tinywall.info/2013/01/create-automatic-mysql-database-backup-using-cronjob-gzip-and-shell-script-in-linux.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com3tag:blogger.com,1999:blog-4848540803573326268.post-29523773790363551772012-07-03T16:03:00.000+05:302014-05-25T10:08:32.663+05:30Multilanguage support & Internationalization (i18n) in Java WebApplication<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzYoHGWpKU2Uq1pr3qYKyE2KnKiMn2OSqKql2lywKfp-eO5EpTnQmmf5yf40b20cX8M2I9JXvuSNkrCQ2wMEXRW1TkvIDbhucVzXMTJ19pjc3cKf2eqJMZE-2YHVe8PBz3PasW1dZ5-g/s1600/tt.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzYoHGWpKU2Uq1pr3qYKyE2KnKiMn2OSqKql2lywKfp-eO5EpTnQmmf5yf40b20cX8M2I9JXvuSNkrCQ2wMEXRW1TkvIDbhucVzXMTJ19pjc3cKf2eqJMZE-2YHVe8PBz3PasW1dZ5-g/s1600/tt.png" height="400" width="235"></a>1. Create a Simple dynamic web project in eclipse and name it as "Test".<br>
<br>
2. create a package "com.example.test and place the property file inside the package<br>
<br>
</div><a href="https://www.tinywall.info/2012/07/internationalization-i18n-java.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com18tag:blogger.com,1999:blog-4848540803573326268.post-69056536502428424272012-06-08T15:54:00.000+05:302014-05-25T10:37:16.303+05:30Export, Install and Run the Android Application in Mobile from EclipseProject using the APK file<div dir="ltr" style="text-align: left;" trbidi="on">
In this post, I'm gonna tell u how to Deploy android app from Eclipse<br />
<br />
1. Go to File->Export, then window will arise as shown below<br />
<span id="goog_479797483"></span><span id="goog_479797484"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Te_SnY8ey1Wo_JD6lSja614vQfTElURSTzqkxBHRaWGF2mvR6JeoSb6B1jIscRRjs6sV1hOTa18vtfLANljhC_k5a1p9sntTTx5DN-2FcAitSVUn40CXVRk_YDieLXWQseOo4FLfTg/s1600/i1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_Te_SnY8ey1Wo_JD6lSja614vQfTElURSTzqkxBHRaWGF2mvR6JeoSb6B1jIscRRjs6sV1hOTa18vtfLANljhC_k5a1p9sntTTx5DN-2FcAitSVUn40CXVRk_YDieLXWQseOo4FLfTg/s1600/i1.png" height="640" width="578" /></a></div>
<br />
2. Choose Android Application then Click Next, then Select your Project from your local computer as shown below<br />
<div style="text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPgIQgjYxLJUQa6fX2TPl_Je84j5-RAf4rJV6O-8ClNuFAv0-COR5U7DU1y9ZzfOUX43ti_uejTTkYQZwW_WNinitdSpt4s3O_3Yn8AWYcCvJ4t8dDk_wYPqYqSJ_whWx4lpLRtf9pAA/s1600/i2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPgIQgjYxLJUQa6fX2TPl_Je84j5-RAf4rJV6O-8ClNuFAv0-COR5U7DU1y9ZzfOUX43ti_uejTTkYQZwW_WNinitdSpt4s3O_3Yn8AWYcCvJ4t8dDk_wYPqYqSJ_whWx4lpLRtf9pAA/s1600/i2.png" height="640" width="605" /></a></div>
<br />
3. Then you need to Enter the Path to Keystore, choose Existing Keystore, and mostly the Keystore location will be as<br />
C:/users/admin_account_name/.android/debug.keystore and the password should be as "android" and then click next.<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivZIhXtgNvboDxQdAXESxS9ePtiFRogNoqfEdKqiV06nnhP8UIETJKVuCrJelLXEC4WFvupFHXFsfNamWf5Pi44sxfUdFV8GDFYVg48G7JFvrZ3SSR0ctMR8ydr3Oi2XkUX6HZE2zI-w/s1600/i3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivZIhXtgNvboDxQdAXESxS9ePtiFRogNoqfEdKqiV06nnhP8UIETJKVuCrJelLXEC4WFvupFHXFsfNamWf5Pi44sxfUdFV8GDFYVg48G7JFvrZ3SSR0ctMR8ydr3Oi2XkUX6HZE2zI-w/s1600/i3.png" height="400" width="383" /></a></div>
</div>
<br />
4. After selecting the Keystore and Password as "android", Click Next, Then the window will arise as shown<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz2lWLtcmUtwgvuirsIway6C_b2bFfCE9PnekQBAN80WSGORjSr_tvduCZr4FlpZ66dSqk7aQtcpRPMjcC3fIKu5ETH2x0zpoF4Fz-yC0TIJQ9OiMvsIAcD9uPTEAjpYUukXPj39bmPw/s1600/i61.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz2lWLtcmUtwgvuirsIway6C_b2bFfCE9PnekQBAN80WSGORjSr_tvduCZr4FlpZ66dSqk7aQtcpRPMjcC3fIKu5ETH2x0zpoF4Fz-yC0TIJQ9OiMvsIAcD9uPTEAjpYUukXPj39bmPw/s1600/i61.png" height="521" width="640" /></a></div>
</div>
<br />
5. Then you need to give location for the storing the apk file of the project.<br />
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRh8QZT84zIVAXOpY-oufHyZ46WpYDHi4WuCHzIaRZp4MnsYkrcgPOoyafzpN-19E2iLsOACr61dwwnYH-1KItpZlbl_tyyabLqwfXqDRHFE_3XztRIjubrejImVG4rNORXmrY_CL3A/s1600/i7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRh8QZT84zIVAXOpY-oufHyZ46WpYDHi4WuCHzIaRZp4MnsYkrcgPOoyafzpN-19E2iLsOACr61dwwnYH-1KItpZlbl_tyyabLqwfXqDRHFE_3XztRIjubrejImVG4rNORXmrY_CL3A/s1600/i7.png" height="640" width="610" /></a></div>
</div>
<br />
6. Click Finish, your project apk file is ready, just install it in the android mobile. It will work.<br />
<br />
Thank you</div>
<div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com86tag:blogger.com,1999:blog-4848540803573326268.post-69472725787713806462012-05-01T15:35:00.000+05:302014-05-25T10:06:33.057+05:30Fancy search box form design using CSS, HTML, CSS3<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-1dn9TqvfcAd_Nddm3p4rtE8u3Hh6xgtZn5xY0fJJFu3b-wHb-Tht03LbTr_0Xj29y5CwQxIYS8RE8MawF8enquAPG9Go9D97syQfy9eQUuWZ4B8TwUZxoTEKp3aKAPslLqaiMDiyNQ/s1600/fancy-search-box-form-html-css-css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-1dn9TqvfcAd_Nddm3p4rtE8u3Hh6xgtZn5xY0fJJFu3b-wHb-Tht03LbTr_0Xj29y5CwQxIYS8RE8MawF8enquAPG9Go9D97syQfy9eQUuWZ4B8TwUZxoTEKp3aKAPslLqaiMDiyNQ/s1600/fancy-search-box-form-html-css-css3.jpg" height="220" width="640"></a></div>
<br>
When you are implementing a search box form for your web application, you may wonder how fancy those are in some websites. It's just a simple CSS does the trick and CSS3 adds a little more beauty to the search form.<br>
<br>
</div><a href="https://www.tinywall.info/2012/05/fancy-search-box-form-using-css-html-css3.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Ashok Rajhttp://www.blogger.com/profile/11707170763680227555noreply@blogger.com3tag:blogger.com,1999:blog-4848540803573326268.post-73148946451877153282012-02-22T18:09:00.000+05:302014-05-25T10:06:41.288+05:30Change browser url without page reloading with ajax request using JavaScript, HTML5 history API, jQuery, PHP like Facebook, Github navigation menu<div dir="ltr" style="text-align: left;" trbidi="on">
When you are working with ajax, the problem is that after you have loaded some content using ajax, you can't change the URL of the browser according to the content. Because of this, <b>reloading the page causes the new ajax content to disappear</b> and it shows the previous page. Although you can resolve this problem with having some hash tag in the URL, but <b>having hash tag in the url for navigation won't be SEO friendly</b>.<br>
<br>
</div><a href="https://www.tinywall.info/2012/02/change-browser-url-without-page-reload-refresh-with-ajax-request-using-javascript-html5-history-api-php-jquery-like-facebook-github-navigation-menu.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com29tag:blogger.com,1999:blog-4848540803573326268.post-61109024208309368402011-10-31T12:33:00.000+05:302014-05-25T10:06:49.729+05:30Create Free SMS app using PHP, JSON API, cURL and txtWeb<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiiSUwcX2MIg8pXsQeZK37A5N02PL99m_GUYl-YDFHl1vPR-3EJXu3826Ozh2iQElM5zS4qMThX6GxFUFK88iArDk0igj6UPaSUpJX55IZkmamsZ0SecZH3qcE8762XqGmuttPrslJtNcY/s1600/txtweb-sms-api-app-flow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiiSUwcX2MIg8pXsQeZK37A5N02PL99m_GUYl-YDFHl1vPR-3EJXu3826Ozh2iQElM5zS4qMThX6GxFUFK88iArDk0igj6UPaSUpJX55IZkmamsZ0SecZH3qcE8762XqGmuttPrslJtNcY/s1600/txtweb-sms-api-app-flow.png"></a></div>
The current period is SMS era. Where in just 140 character made <a href="http://tinywall.info/2011/10/19/facebook-twitter-like-json-feeds-with-php-javascript-ajax-jquery-mysql/" title="Facebook, Twitter like JSON feeds with PHP, JavaScript, Ajax, jQuery, MySQL">twitter</a> dominate the social media. We are used to have everything right now as "Short and Sweet".<br>
<br>
</div><a href="https://www.tinywall.info/2011/10/creating-a-free-sms-app-with-phpjsoncurl-and-txtweb.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com6tag:blogger.com,1999:blog-4848540803573326268.post-3791934694079306312011-10-27T12:21:00.000+05:302014-05-25T10:07:05.178+05:30Android Getting Started Hello World Example<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSO6y2UUEpbWcErtXRr825qDmhVFm19Wf1ItDud4TKtybXEqQsm65M_7P_dPvInFz-xsCUAbTLtZbJ-U-UCT0bC5l19_Clq-iwd4vM1VrViXFY4s2FXCuJ0Fs4Z8gzyBIopkSaTX5K7aN7/s1600/getting-started-with-android-application-development.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSO6y2UUEpbWcErtXRr825qDmhVFm19Wf1ItDud4TKtybXEqQsm65M_7P_dPvInFz-xsCUAbTLtZbJ-U-UCT0bC5l19_Clq-iwd4vM1VrViXFY4s2FXCuJ0Fs4Z8gzyBIopkSaTX5K7aN7/s1600/getting-started-with-android-application-development.png"></a></div>
<br>
I hope this post will help everyone those who want to start with Android applications.<br>
<br>
To develop Android applications you should have a <b>Android SDK </b>to run the dveloped application through the Virtual Emulator and <b>Eclipse </b>to develop the application.<br>
<br>
</div><a href="https://www.tinywall.info/2011/10/getting-started-with-android-mobile-application-developmen.html#more">Read more »</a><div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com0tag:blogger.com,1999:blog-4848540803573326268.post-7228159009834621192011-10-20T12:02:00.000+05:302014-04-11T14:56:45.930+05:30Facebook, Twitter like JSON feeds with PHP, JavaScript, Ajax, jQuery,MySQL<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuGqN0xhEkKevhabQ2MFLfJSjK9FQMJkpV-M31yprUFLKpfhvcDw2zYFpXZmqJlYDcMBmpGloArWvb8pPGOhz5UFsv8d2p3-36epHcxJKvUvawArbL4rNo9VbzMolTFvR1G_d4qOAalQvv/s1600/facebook-twitter-like-json-feef-flow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuGqN0xhEkKevhabQ2MFLfJSjK9FQMJkpV-M31yprUFLKpfhvcDw2zYFpXZmqJlYDcMBmpGloArWvb8pPGOhz5UFsv8d2p3-36epHcxJKvUvawArbL4rNo9VbzMolTFvR1G_d4qOAalQvv/s1600/facebook-twitter-like-json-feef-flow.png" /></a></div>
<br />
When you go to Facebook or Twitter, The first thing you notice is that the page is loaded and within seconds the status feeds will be displayed. That is because the page is loaded first and after that it sends an ajax request to another page and gets back the feeds in the JSON format and display it using JavaScript & jQuery.<br />
<br />
We will demonstrate this with a simple posts from mysql table using PHP and JavaScript...<br />
<br />
<b>1 )</b> Create a mysql database and table 'posts' with the following schema.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9F1clbYX2i0k91kjC0s-uH9bhGo0JWa2YkhhZNFzCckQRXJbhQHTCFZWfnsWWe_64leFD8KFEXS4MlMl1fqCnwBvxRtN6LSX9sI-sv-werZveBhMyOX6EGI42vVSUIrZjzzc3y3YRi9Du/s1600/facebook-twitter-like-json-feef-db.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9F1clbYX2i0k91kjC0s-uH9bhGo0JWa2YkhhZNFzCckQRXJbhQHTCFZWfnsWWe_64leFD8KFEXS4MlMl1fqCnwBvxRtN6LSX9sI-sv-werZveBhMyOX6EGI42vVSUIrZjzzc3y3YRi9Du/s1600/facebook-twitter-like-json-feef-db.png" /></a></div>
<br />
<br />
<pre><code>
CREATE TABLE IF NOT EXISTS `posts` (
`post_id` int(5) NOT NULL AUTO_INCREMENT,
`user_id` int(5) NOT NULL,
`user_name` varchar(50) NOT NULL,
`post` varchar(500) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`post_id`)
</code></pre>
<br />
And insert some rows in the table 'posts'<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF5uH6NnQ1zNA6K49VRzx-K3b0SEVDFG3zjOh5jzywYKDlwhUZcnsaLA0ri2glP-tFsnvVYG2Tn9JmQ5r1-q4YfSCRo_mQn_PpZACUnd31BUeN9lA-NJqYK3BnkhJ0GRlW1Exqz0PeZgrv/s1600/facebook-twitter-like-json-feef-data.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF5uH6NnQ1zNA6K49VRzx-K3b0SEVDFG3zjOh5jzywYKDlwhUZcnsaLA0ri2glP-tFsnvVYG2Tn9JmQ5r1-q4YfSCRo_mQn_PpZACUnd31BUeN9lA-NJqYK3BnkhJ0GRlW1Exqz0PeZgrv/s1600/facebook-twitter-like-json-feef-data.png" /></a></div>
<br />
<b>2 )</b> create a php page 'json-posts.php' that fetches data from database and display it in the JSON format.<br />
<br />
<span style="text-decoration: underline;">json-posts.php</span><br />
<pre><code>
<?php
//database connection
$dbHost='localhost';
$dbUserName='root';
$dbPassWord='';
$dbName = 'twinfo_demos';
$dbLinkConnection = mysql_connect($dbHost,$dbUserName,$dbPassWord) or die("Couldn't make connection.");
$dbSelected = mysql_select_db($dbName, $dbLinkConnection) or die("Couldn't select database");
//select posts from database
$query="select * from posts order by post_id desc";
$result=mysql_query($query) or die("couldn't select data from table");
//create json format text from posts
$json=array();
while($row=mysql_fetch_array($result)){
$from=array('id'=>$row['user_id'],'name'=>$row['user_name']);
$post=array('post_id'=>$row['post_id'],'from'=>$from,'post'=>$row['post'],'time'=>$row['time']);
array_push($json,$post);
}
//display it to the user
header('Content-type: application/json');
echo "{"posts":".json_encode($json)."}";
?>
</code></pre>
<br />
The above code will fetch the data from database and gives it in the following JSON format...<br />
<pre><code>
{
"posts":[
{
"post_id":"3",
"from":{
"id":"103",
"name":"AshokRaj"
},
"post":"Third Post. Third Post. Third Post.",
"time":"2011-10-18 08:37:53"
},
{
"post_id":"2",
"from":{
"id":"102",
"name":"MohanKumar"
},
"post":"Second Post. Second Post. Second Post.",
"time":"2011-10-18 08:37:23"
},
{
"post_id":"1",
"from":{
"id":"101",
"name":"ArunDavid"
},
"post":"First Post. First Post. First Post.",
"time":"2011-10-18 08:37:23"
}
]
</code></pre>
<br />
<b>3 )</b> create anothe page 'posts.php' to fetch the posts in JSON format and display it to the user. In that page add the following code to send the ajax request for json data using jquery and display the posts for the user.<br />
<pre><code>
<html>
<head>
<script language="javascript" src="jquery-1.4.4.min.js"></script>
<script>
$(document).ready(function(){
$.getJSON('json-posts.php', function(json) {//to send a ajax request for json data
var output="";
for(var i=0;i<json.posts.length;i++){//for each posts in the json response
output+="<div>";
output+="<b>"+json.posts[i].from.name+"</b><br/>";
output+=json.posts[i].post+"<br/>";
output+="<small>posted on "+json.posts[i].time+"</small>";
output+="</div>";
}
$('#posts').html(output);
});
});
</script>
</head>
<body>
<div id="posts"></div>
</body>
</code></pre>
<br />
This will display the json posts in user readable format and also useful for giving API to others through JSON. Make use of my <b><a href="http://tinywall.info/2011/10/09/facebook-like-friendly-time-with-gmt-and-utc-in-web-application-with-php-javascript/" target="_blank" title="GMT UTC to friendly time line">previous post</a></b> to display the time in friendly readable format.<br />
<br />
<b><a href="http://demo.tinywall.info/json/posts.php" target="_blank" title="Live Demo">Live Demo</a></b> | <b><a href="https://github.com/tinywall/demo.tinywall.info/archive/json-feeds.zip" target="_blank" title="Download Code">Download Code</a></b></div>
<div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com1tag:blogger.com,1999:blog-4848540803573326268.post-41046401217858892792011-10-10T11:46:00.000+05:302014-04-11T14:57:01.259+05:30Facebook like friendly time with GMT and UTC using PHP & Javascript<div dir="ltr" style="text-align: left;" trbidi="on">
Usually when we want to insert timestamps in a database. We will either put the column default as 'Current Timestamp' or insert the value 'date("Y-m-d H:i:s")' into that column. But both the methods will result in inserting only the server time in the database and visitors from all over the world will see the same server time in the website.<br />
<br />
So it is good practice to insert only the GMT time in the database and while displaying, convert it into the user's local time zone and display to them.<br />
<br />
<b>1 )</b> To get the GMT time stamp of current time in PHP, use the following,<br />
<pre><code>
$GMT_Timestamp=gmdate("Y-m-d H:i:s", time());
//Insert '$GMT_Timestamp' in the timestamp column of the database
</code></pre>
<br />
Insert the above value in the timestamp column of table in database. This will give same GMT time value irrespective of server location or client location.<br />
<br />
<b>2 )</b> When you fetch the data from database, display it in the UTC format to the client like the following code,<br />
<pre><code>
//Fetch '$GMT_Timestamp' from the database table
$UTC_Time=date('Y-m-dTH:i:s+0000',strtotime($GMT_Timestamp));
//Display '$UTC_Time' to client and use javascript to make it to local time and friendly text
echo "<span class='unformattedtime'>".$UTC_Time."</span>";
</code></pre>
<br />
<b>3 )</b> Add the following javascript code in the head part of the webpage to convert the UTC formatted text into local time and display it in friendly text format.<br />
<pre><code>
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script language="javascript">
function getValidDate(ivDate){
var arrDateTime = ivDate.split("T");
var strTimeCode = arrDateTime[1].substring(0,arrDateTime[1].indexOf("+"));
var valid_date = new Date();
var arrDateCode = arrDateTime[0].split("-");
valid_date.setYear(arrDateCode[0]);
valid_date.setMonth(arrDateCode[1]-1);
valid_date.setDate(arrDateCode[2]);
var arrTimeCode = strTimeCode.split(":");
valid_date.setHours(arrTimeCode[0]);
valid_date.setMinutes(arrTimeCode[1]);
valid_date.setSeconds(arrTimeCode[2]);
return valid_date;
}
var month=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
function toFormattedDate(gmdate){
var date=getValidDate(gmdate);
var offset=parseInt(date.getTimezoneOffset());
var sec_diff = (((new Date()).getTime()+(offset*60*1000)-date.getTime())/1000);
var day_diff = Math.floor(sec_diff / 86400);
if(sec_diff<60){
return "Just Now";
}else if(sec_diff<120){
return "1 minute ago";
}else if(sec_diff<3600){
return ""+Math.floor( sec_diff / 60 ) + " minutes ago";
}else if(sec_diff<7200){
return "1 hour ago";
}else if(sec_diff<86400){
return Math.floor( sec_diff / 3600 ) + " hours ago";
}else if(day_diff==1){
return "yesterday";
}else if(day_diff<7){
return day_diff + " days ago";
}else if(day_diff<31){
return Math.ceil( day_diff / 7 ) + " weeks ago";
}else{
return month[date.getMonth()]+" "+date.getDate()+", "+date.getFullYear();
}
return date;
}
$(document).ready(function(){
$('.unformattedtime').each(function(index) {
$(this).attr('alt',$(this).html());
$(this).attr('title',$(this).html());
$(this).html(toFormattedDate($(this).html()));
});
});
</script>
</code></pre>
<br />
The above code will replace all the UTC format text given inside a span with class 'unformattedtime' to the friendly text format as given below.<br />
<pre><code>
<span class='unformattedtime'>2011-10-08T08:43:48+0000</span>
</code></pre>
<br />
will be converted to friendly time format like<br />
<pre><code>
<span class='unformattedtime'>21 minutes ago</span>
</code></pre>
<br />
This method will be regardless of the server and the client location. The displayed time to the user will be calculated for their local time zone and be displayed. So visitors from all over the world will see the time according to their timezone.<br />
<br />
<span style="font-size: 20px;"><a href="http://demo.tinywall.info/facebook-like-gmt-time-to-local-time-in-php-javascript.php" target="_blank">Live Demo</a> | <a href="https://github.com/tinywall/demo.tinywall.info/archive/gmt-time-to-local-time.zip" target="_blank">Download Code</a></span></div>
<div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com1tag:blogger.com,1999:blog-4848540803573326268.post-58051728899708329052011-10-08T11:23:00.000+05:302014-04-11T14:51:46.789+05:30Both sement based and query string(GETmethod) variables in url ofcodeigniter site<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTMwTHxbMiC_7j7qxgact981LxAjsNZbDS-DztqDDxxomawXEmtQq4_pe3o57ozkob3UJox-0DI-DjkgCSGSNJf33IGau702-fAOChr0oPjfNtldXgtsWhL7g2Sr6snfSQKaQlZ9Be_3i5/s1600/codeigniter-segment-and-query-string-url1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTMwTHxbMiC_7j7qxgact981LxAjsNZbDS-DztqDDxxomawXEmtQq4_pe3o57ozkob3UJox-0DI-DjkgCSGSNJf33IGau702-fAOChr0oPjfNtldXgtsWhL7g2Sr6snfSQKaQlZ9Be_3i5/s1600/codeigniter-segment-and-query-string-url1.png" /></a></div>
<br />
By default codeigniter doesn't support query string or get method variables, we can use only segment based url. To enable both segment base and query string (GET method) variables, you need to follow the upcoming steps...<br />
<br />
<b>1 )</b> In yout codeigniter config file change the uri_protocol as specified bellow,<br />
<br />
<span style="text-decoration: underline;">application/config/config.php</span><br />
<pre><code>
$config['uri_protocol'] = 'AUTO';
</code></pre>
<br />
to<br />
<pre><code>
$config['uri_protocol'] = 'PATH_INFO';
// OR
$config['uri_protocol'] = 'ORIG_PATH_INFO';
</code></pre>
<br />
Some servers does not support 'PATH_INFO' as 'uri_protocol'. Then use 'ORIG_PATH_INFO'.<br />
<br />
<b>2 )</b> In your controller where you want to use query string variable, add the following line in the <span style="text-decoration: underline;">controller's constructor</span>,<br />
<pre><code>
parse_str($_SERVER['QUERY_STRING'],$_GET);
</code></pre>
<br />
<b>3 )</b> Now, you are able to use the query string variables in your methods of the controller like given below,<br />
<br />
<span style="text-decoration: underline;">application/controllers/search.php</span><br />
<pre><code>
class Search extends CI_Controller{
function __construct(){
parent::__construct();
parse_str($_SERVER['QUERY_STRING'],$_GET);
}
function result(){
echo "Search result for Name:".$_GET['name']." and Age:".$_GET['age'];
}
}
</code></pre>
<br />
If your url is,<br />
<br />
<b>http://localhost/tinywall/search/result/?name=David&age=22</b><br />
<br />
The above code prints,<br />
<br />
<b>Search result for Name:David and Age:22</b></div>
<div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com0tag:blogger.com,1999:blog-4848540803573326268.post-41473666896779848872011-10-07T11:21:00.000+05:302014-04-07T11:58:49.031+05:30Remove index.php from url of codeigniter site using htaccess<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2bzXBJ23cjZr88nzieEDEMNVBxoaJQl96KGFthxeofiw8OwXbf3So9y-hk6xEfJb765BD9tzzL93ZZUXtkSrcrkl_ckTfYeRqRHRTh51tubDmmHW2VtEfs2ZYErUQKQMxpXn5h5rQE6Z9/s1600/codeigniter-remove-index.php-htaccess2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2bzXBJ23cjZr88nzieEDEMNVBxoaJQl96KGFthxeofiw8OwXbf3So9y-hk6xEfJb765BD9tzzL93ZZUXtkSrcrkl_ckTfYeRqRHRTh51tubDmmHW2VtEfs2ZYErUQKQMxpXn5h5rQE6Z9/s1600/codeigniter-remove-index.php-htaccess2.png" /></a></div>
<br />
<br />
Usually when we run a CodeIgniter website, the url will have index.php after the hostname. To remove this we need to use mode_rewrite, htaccess.<br />
<br />
First just check your php info of your server whether you have loded mod_rewrite module. To check this create 'php-info.php' file and put the following contents and run it.<br />
<br />
<span style="text-decoration: underline;">php-info.php</span><br />
<pre><code>
<?php
echo phpinfo();
?>
</code></pre>
<br />
In your output, check whether in loaded modules 'mod_rewrite' is enabled or not.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9XTUlr6-Ee5nB22eIClGw0XmCswCpil_cBJ5lnsYvnfjVA4UmxdXHZHfv9U8JF7YALkGg_1iwlKkYuJ2dokiHr03d9HacUJ3RducqPSr3nJur9mJrxA26Djr6Ed56hzVGChi2IBFEpd99/s1600/php-info-mod_rewrite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9XTUlr6-Ee5nB22eIClGw0XmCswCpil_cBJ5lnsYvnfjVA4UmxdXHZHfv9U8JF7YALkGg_1iwlKkYuJ2dokiHr03d9HacUJ3RducqPSr3nJur9mJrxA26Djr6Ed56hzVGChi2IBFEpd99/s1600/php-info-mod_rewrite.png" /></a></div>
<br />
<br />
<br />
If its enabled as given above, You are ready to use '.htaccess'. Otherwise you need to load the module in your server.<br />
<br />
To remove 'index.php' from the url, create a '.htaccess' file ( no file name, just '.htaccess') in the root directory of your website where 'index.php' file of the codeigniter resides. And write the followin contents...<br />
<br />
<strong><span style="text-decoration: underline;">.htaccess</span></strong><br />
<pre><code>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /example.com/index.php/$1
</code></pre>
<br />
The above code is to rewrite the url 'http://localhost/example.com/<something>' to 'http://localhost/example.com/index.php/<something>' except for folders and files.<br />
<br />
If your website url is in the root of the server like 'http://example.com/index.php/<something>'. To use this like 'http://example.com/<something>' , The htaccess code in the Line 4 should be like 'RewriteRule ^(.*)$ /index.php/$1'.</div>
<div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com0tag:blogger.com,1999:blog-4848540803573326268.post-26440495334595935642011-10-07T11:11:00.000+05:302014-04-11T14:58:01.586+05:30Find Real IP address and location details of visitor<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu_uP-dfl-p6LvX0pWE7Smg0-b9TLe4LP5NPoTqsXxJLuZ8wCx4xF0xiWlmiG0sx0gpcaVHEcR5TKUDsybL2zN4BjAXaluGYZLPO1HF1PUdaf7TLPwWXfSuAEExMm46WvvcoXmDQLAOfbN/s1600/Ip2Location-IPinfoDB.com-JSON-API-Google-Chart-API1.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Find Real IP address and location details of visitor" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu_uP-dfl-p6LvX0pWE7Smg0-b9TLe4LP5NPoTqsXxJLuZ8wCx4xF0xiWlmiG0sx0gpcaVHEcR5TKUDsybL2zN4BjAXaluGYZLPO1HF1PUdaf7TLPwWXfSuAEExMm46WvvcoXmDQLAOfbN/s1600/Ip2Location-IPinfoDB.com-JSON-API-Google-Chart-API1.jpeg" title="Find Real IP address and location details of visitor" /></a></div>
<br />
<br />
Finding real IP address of a user is becoming highly important now-a-days, that too if the visitor is behind any firewall it's getting as a tough task for the webmasters to trace the real ip address of the visitor. Mostly all the webmasters make use of <a href="http://www.google.com/analytics/" target="_blank" title="Google Analytics | Official Website">Google Analytics</a> to trace their visitors, where in the IP address is masked. So, here i come with a solution with the help of the following<br />
<br />
<b>Language</b> : PHP with CURL<br />
<b>IP API</b> : IPinfoDB.com JSON API<br />
<b>Map API</b> : Google Chart API<br />
<br />
<br />
<b>About IPInfoDB.com</b><br />
<br />
IPInfoDB offer a wide range of <b>free</b> services based on our IP address geolocation database :<br />
<ul><br />
<li>Web based IP geolocation lookup</li>
<br />
<li>IP geolocation API (XML, JSON and CSV format)</li>
<br />
<li>IP database updated monthly!</li>
</ul>
<br />
To find the IP address of the user you will need to make use of the IPInfoDB.com API in this tutorial, so register yourself for a <a href="http://ipinfodb.com/register.php" target="_blank" title="Register FREE at IPInfoDB.com">FREE</a>account.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiMYZhS9QuMoc4nYQark4-tJzmiKVWxLdo2rV-x7q5aA9PdLxs3iHoS-V8fc-YhRDqewDwmVGrC0QcVgttUFn_0U0IQIkc6G0pcGkTLf_JJ01TZoMKnGOeEhreXpHj5RF4eU3uWXP4tCCK/s1600/IPInfoDB_API.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Register at IPInfoDB.com to get the API Key" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiMYZhS9QuMoc4nYQark4-tJzmiKVWxLdo2rV-x7q5aA9PdLxs3iHoS-V8fc-YhRDqewDwmVGrC0QcVgttUFn_0U0IQIkc6G0pcGkTLf_JJ01TZoMKnGOeEhreXpHj5RF4eU3uWXP4tCCK/s1600/IPInfoDB_API.jpeg" title="Register at IPInfoDB.com to get the API Key" /></a></div>
<br />
<br />
<b>About Google Chart</b><br />
<br />
Google Chart Tools provide a perfect way to visualize data on your website. We will be using <a href="http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html" target="_blank" title="Visualization: Geochart - Google Chart Tools - Google Code">Visualization: Geochart</a>.<br />
<br />
<b>realip_details.php</b><br />
<br />
<pre><code>
<?php
/**
* GetIpDetails
* Author : S.MohanKumar
* IP API from ipinfodb.com & Google Chart API
**/
$realIp='';
function GetIpDetails($realIp){
//check if you have curl loaded
if(!function_exists("curl_init")) die("cURL extension is not installed");
// create a new cURL resource
$ch = curl_init();
//ipinfodb.com API Key
$ipinfodbApiKey='YOUR_FREE_API_KEY_FROM_IPINFODB.com';
// set URL and other appropriate options
$url="http://api.ipinfodb.com/v3/ip-city/?key=".$ipinfodbApiKey."&format=json&ip=".$realIp;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, false);
// grab URL and pass it to the browser
$ipDetails_json=curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
return $ipDetails_json;
$obj = json_decode($ipDetails_json);
}
function getRealIpAddress()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
//check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
//to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
getRealIpAddress(); // display the real IP address
echo "<br/>";
$openIp=getRealIpAddress($realIp);
$ipDetails_json =GetIpDetails($openIp);
$obj = json_decode($ipDetails_json);
?>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geochart']});
google.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = new google.visualization.DataTable();
data.addRows(1);
data.addColumn('string', 'Country');
data.addColumn('string', 'Title');
data.setValue(0, 0, '<?php print $obj->{'countryName'}; ?>');
data.setValue(0, 1, 'IP : <?php print $obj->{'ipAddress'}." ".$obj->{'cityName'}.",".$obj->{'regionName'}.",".$obj->{'countryName'}; ?>');
var options = {};
var container = document.getElementById('map_canvas');
var geochart = new google.visualization.GeoChart(container);
geochart.draw(data, options);
};
</script>
<div id='map_canvas' style="width:600px"></div>
<fieldset>
<legend><b>Ip Details </b></legend>
<?php
echo "<b>IPaddress :</b> ".$obj->{'ipAddress'}."<br/>"; // IpAddress
echo "<b>Country name :</b> ".$obj->{'countryName'}."<br/>"; // countryName
echo "<b>State name :</b> ".$obj->{'regionName'}."<br/>"; // regionName
echo "<b>City name :</b> ".$obj->{'cityName'}."<br/>"; // cityName
echo "<b>Latitude :</b> ".$obj->{'latitude'}."<br/>"; // latitude
echo "<b>Longitude :</b> ".$obj->{'longitude'}."<br/>"; // longitude
echo "<b>Time zone :</b> ".$obj->{'timeZone'}."<br/>"; // timeZone
?>
</fieldset>
</code></pre>
<br />
<br />
<a href="http://tinywall.info/downloads/realip_details.zip" target="_blank" title="Download the Code">DOWNLOAD</a></div>
<div class="blogger-post-footer">This story was originally published at Tinywall.info</div>Arun Davidhttp://www.blogger.com/profile/14935633279539348055noreply@blogger.com2