Sunday, September 15, 2013

URL data extraction like facebook - Simple script in PHP

When you enter a url, then the main data like title, logo, etc. of the page to which the url takes you, are shown. This is called URL extraction. The best example you can see is facebook. Go to facebook homepage, enter the url in its status box. As soon as you type the url ,it shows you the extracted contents of the page corresponding to the url typed.
Let's write a simple script in PHP to show URL extraction. Mainly it will be css, javascript and html. We will use only file_get_contents(url) function of PHP.
Here the code goes...............

Joomla 3 installation issue on WAMP server version 2.4

A few days back, I installed WAMP 2.4 on Windows 8 (64 bit). Then I started installing Joomla 3 (latest version at that time) on this operating system. Now, the installation got stuck at the database creation. At first look, it looked like that there might be some incompatibility between Joomla 3 and Windows 8. But the actual problem was with WAMP 2.4 as I searched for the solutions.

In fact, the problem was with PHP version 5.4 which comes by default in WAMP 2.4.

So, at first look, the solution might be like this:
  • Download the 2.2 version of Wamp Server 32 bit or 64 bit depending upon your windows. 
  • Install it. Then install Joomla 3 , if will become a piece of cake for you now.
If you don't want to compromise on PHP version, then there is another solution available.
Just try this out.
  • Go to wamp\www\joomla folder\installation\sql\mysql and open joomla.sql file.
  • Find the term "ENGINE=InnoDB" and replace all with "ENGINE=MyIsam".
The reason that this trick works is that MyIsam is more supported and compatible with Joomla.

Hope you will like the post. Thanks for reading it.

Tuesday, September 10, 2013

URL Rewriting A Brief Introduction

Hello everyone,
these days you see many urls on different sites shown as some shortened random text. We may call them shortened urls which are made to function correctly by using URL Rewriting on the server on which the target website is hosted. This is just one example where URL rewriting is used. Many other usages are also there. Let's have a brief introduction of this technique below.

Sunday, September 8, 2013

TinyMCE issue with IE9

This is just a simple post about one of the problems I had while using tinyMCE editor in Internet Explorer.
The issue was actually in the versions above IE8 only, i.e. IE9 and IE10. May be there some compatibility issues between tinyMCE editor and Internet Explorer.
Suppose there is a form having a textarea with tinyMCE controls added to it and a submit button. The form uses post method. When you submit this form with a value in the textarea, then that value is not posted to the action of the form(in IE9, IE10; for other browsers, it works fine). That means, the value of the textarea with tinyMCE controls is not transferred through HTTP POST method in versions above IE8.
So, unless the issuse is fixed in tinyMCE editor or Internet Explorer, we can force the Internet Explorer to behave as its older version.
The simplest thing is to just include this line in your html document(where you are using textarea with tinyMCE controls) after the starting of the head tag.
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

That's it. Well, there are many solutions available for this issue but I think it is the simplest one.

Simple Pagination Script in PHP

Let's do a bit of coding in PHP with mysql as the DBMS. Here, I will present the simplest of code to make a page which shows a fixed number of records on a page with the next and previous links to access the next or previous records.I think you are confused what I am saying.

Let's take an example.
Suppose there is a database named "profile"(Let's say in MYSQL). It has a table named "tbl_comment" which has two fields cid and ctext. Now there is a php file named comment.php which will show the list of comments from the tbl_comment table. As the number of comments in the table increase, we need a system to show them systematically on the screen so that the end-user has not to scroll much to read the comments. There comes the pagination script handy.

Thursday, September 5, 2013

PHP Redirection - Anchor link problem in Internet explorer

Well, this was one of the latest issue encountered by me while redirecting to a php page in a php file using php header() function in Internet Explorer.
Problem Description:
header("Location: abc.php?a=b#area"); where area is an anchor link in the html generated by php file abc.php like this
<a name="area" id="area"></a>
The above header function should take to the page abc.php with the current view of the screen on "area" link.
It did so in all major browsers except in Internet Explorer.