tag:blogger.com,1999:blog-11954856362931925112023-06-20T06:26:55.184-07:00Code CluesAnonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-1195485636293192511.post-15382570004315613622015-06-25T09:22:00.001-07:002015-06-25T09:22:10.842-07:00Angular JS Events<div dir="ltr" style="text-align: left;" trbidi="on">
Almost all of you have heard of the 'Event handling', to develop outstanding applications we will need to handle certain events within like a mouse click, key press, unload, etc. Angular JS provides the simplest way to add event listeners to our app. Let's get started experiencing an event handling in Angular JS.<br />
<br />
First, I'll start with embedding a click event to our angular is app.<br />
<br />
<code><br />
<div ng-controller="HelloController"><br />
<div ng-click="helloData.hClick()"><br />
<code>Click here</code></div><br />
</div><br />
<code><br />
/* script start*/<br />
<script><br />
angular.module("helloapp", [])<br />
.controller("HelloController", function($scope) {<br />
$scope.helloData = {};<br />
$scope.helloData.hClick = function() {<br />
alert("Hello World");<br />
}<br />
} );<br />
</script><br />
/* script end */<br />
</code><br />
<br />
On clicking the text "click here" hClick() function is called resulting the output. I guess there is not much difficulty to do so, all we need is an 'ng-click' provided by angular js. This is only simple demonstration, please suggest further improvements and feel free to raise questions.</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-6137552737515393022015-06-22T09:12:00.002-07:002015-06-22T09:12:51.160-07:00Filtering<div dir="ltr" style="text-align: left;" trbidi="on">
Filtering is a feature provided by Angular JS directives. I wish discuss about how filtering is implemented. Let's see how filters are implemented in <i>ng-repeat </i>directive.<br />
<br />
<code>
<div ng-repeat="item in helloData.items | filter: testFilter"></div>
</code>
<br />
<span style="font-family: monospace;"><!-- Script --></span><br />
<span style="font-family: monospace;"><script></span><br />
<span style="font-family: monospace;"> angular.module("helloapp", [])</span><br />
<span style="font-family: monospace;"> .controller("HelloController", function($scope) {</span><br />
<span style="font-family: monospace;"> $scope.helloData = {};</span><br />
<span style="font-family: monospace;"> $scope.helloData.items = [ {text : "uno"}, {text : "dos"}, {text : "tres"}, {text : "cuatro"} ];</span><br />
<span style="font-family: monospace;"><br /></span>
<span style="font-family: monospace;"> $scope.testFilter = function(item) {</span><br />
<span style="font-family: monospace;"> if(item.text == "dos") return false;</span><br />
<span style="font-family: monospace;"> return true;</span><br />
<span style="font-family: monospace;"> }</span><br />
<span style="font-family: monospace;"> }</span><br />
<span style="font-family: monospace;"> });</span><br />
<span style="font-family: monospace;"></span><br />
<span style="font-family: monospace;"></script></span><br />
<span style="font-family: monospace;"><!-- end --></span><br />
<br />
The filter with piped symbol in the markup denotes a filter is applied (| filter:) to the array items. Here 'testFilter' is the custom filter, defined as function. If the testFilter returns true item is printed else it will be discarded.<br />
<br />
Other than the custom filters, Angular JS provides formatting, array filters etc. Formatting filter can be named date, currency, number etc. Using array filters you could restrict the item count with <i>limitTo</i> filter, order records in asc/desc formats.<br />
<br />
Please let us know your feedback. Happy to help. Thank you.</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-45317359668184904442015-06-21T09:55:00.004-07:002015-06-21T10:04:14.784-07:00AngularJS Directives (Part II)<div dir="ltr" style="text-align: left;" trbidi="on">
Now its all about directives talk, this is the second part of my <a href="http://code-clues.blogspot.in/2014/07/angular-js-expression-and-directives.html" target="_blank">previous </a>post. Those who wish to know more about AngularJS Directive's can be benefited by reading this content. You must be familiar with conditional statements and loops. AJS also have these features as directives, listed as:<br />
<ul style="text-align: left;">
<li>ng-if</li>
<li>ng-switch</li>
<li>ng-repeat</li>
</ul>
<div>
<i><b>ng-if</b> </i>can be used to add/remove contents from DOM, for example:<br />
<br />
<span style="font-family: monospace;"><div ng-controller="HelloController" ></span><br />
<span style="font-family: monospace;"> <div ng-if="true">ng-if Show</div></span><br />
<span style="font-family: monospace;"> <div ng-if="false">ng-if Hide</div></span><br />
<span style="font-family: monospace;"></div></span><br />
<span style="font-family: monospace;"><br /></span>
<br />
<i><b>ng-switch</b></i> unlike the <i>ng-if</i> can be used to add/remove elements from HTML DOM, for example:<br />
<br />
<span style="font-family: monospace;"><div ng-controller="HelloController" ></span><br />
<span style="font-family: monospace;"> <div ng-switch on="2"></span><br />
<span style="font-family: monospace;"> <div ng-switch-when="1"</span><span style="font-family: monospace;">>Switch 1</div></span><br />
<span style="font-family: monospace;"> <div ng-switch-when="2"</span><span style="font-family: monospace;">>Switch 2</div></span><br />
<span style="font-family: monospace;"> <div ng-switch-when="3"</span><span style="font-family: monospace;">>Switch 3</div></span><br />
<span style="font-family: monospace;"> </div></span><br />
<span style="font-family: monospace;"></div></span><br />
<span style="font-family: monospace;"><br /></span>
<br />
In the example output will be displayed as 'Switch 2'.<br />
<br />
<i><b>ng-repeat</b></i> directive act as a loop to execute a certain snippet number of times assigned. It generates html by iterating over the conditions. Example:<br />
<span style="font-family: monospace;"><ol></span><br />
<span style="font-family: monospace;"> <li ng-repeat="5">Hello World</li></span><br />
<span style="font-family: monospace;"></ol></span><br />
<span style="font-family: monospace;"><br /></span>
The above snippet prints the 'Hello Word' 5 times creating the <li> tags.<br />
<br />
For more reference you can search about more directives <i>ng-include, ng-show, ng-hide</i>. For more complex examples please let me know. In the next article we will the covering AJS 'Filters'.<br />
Many thanks</div>
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-80127368927687374432014-07-23T23:48:00.002-07:002015-06-21T09:09:03.474-07:00Angular JS - Expression and directives<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Expressions are used in Angular JS for outputting html. Expression are written inside double curly braces. " {{ expression }}". Directives are used to extend HTML with new attributes, the directives are prefixed by "ng-".<br />
<br />
Example 1 - Using expressions:<br />
<br />
<pre class="brush: js"><div ng-app="" ng-init="quantity=3;cost=10;">
<span class="Apple-tab-span" style="white-space: pre;"> </span><p>Total: {{quantity*cost}}</p>
<span class="Apple-tab-span" style="white-space: pre;"> </span><p>5 + 5 is {{ 5+5 }}</p>
<span class="Apple-tab-span" style="white-space: pre;"> </span><p>'K' + 'ing' is {{'K'+'ing'}}</p>
</div>
<span style="font-family: Times New Roman;"><span style="white-space: normal;">
</span></span></pre>
<pre class="brush: js"></pre>
<pre class="brush: js"></pre>
AngularJS views blend information from the model into a HTML layout. You utilize AngularJS directives to define AnguluarJS how to blend the information into the HTML format. This content will cover the most regularly utilized AngularJS directives.<br />
<br />
<b>Interpolation Directive</b><br />
<br />
The interpolation directive standout among the most basic directives in AngujarJS. The interpolation directive embeds the output of an expression into the HTML layout. You check where to embed the expression making use of the {{ }} symbols.<br />
<br />
<code>
<div ng-controller="HelloController" ><br />
<span>{{helloData.msgfun()}}</span><br />
</div></code>
<br />
<code><br /></code>
<span style="font-family: monospace;"><script></span><br />
<span style="font-family: monospace;"> angular.module("myapp", [])</span><br />
<span style="font-family: monospace;"> .controller("HelloController", function($scope) {</span><br />
<span style="font-family: monospace;"> $scope.helloData = {};</span><br />
<span style="font-family: monospace;"> $scope.helloData.msgfun= function() { return "A text from a function"; };</span><br />
<span style="font-family: monospace;"> });</span><br />
<span style="font-family: monospace;"></script></span><br />
<span style="font-family: monospace;"><br /></span>
<br />
In the example <span style="font-family: monospace;">{{helloData.msgfun()}}</span> is the interpolation directive which calls the </div>
<span style="font-family: monospace;">helloData.msgfun()</span> function on the model object.<br />
<br />
There is one alternative for the interpolation called <b>ng-bind. </b>It uses 'ng-bind' attribute to the html were the data to be inserted. For example, considering the above case:<br />
<br />
<span style="font-family: monospace;"><div ng-controller="HelloController" ></span><br />
<span style="font-family: monospace;"> <span ng-bind="</span><span style="font-family: monospace;">helloData.msgfun()</span><span style="font-family: monospace;">"></span></span><br />
<span style="font-family: monospace;"></div></span><br />
<span style="font-family: monospace;"><br /></span>
Some may feels like using innerHTML in JavaScript.<br />
<br />
There are lots more directives available in Angular JS to get familiar with in my upcoming posts.<br />
<div>
<span style="font-family: monospace;"><br /></span></div>
Hope you are ok with the example. Your feedback is always accepted. Many thanks.</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-60385189076787140902014-07-23T00:23:00.001-07:002015-06-21T07:14:50.981-07:00Getting started with Angular JS<div dir="ltr" style="text-align: left;" trbidi="on">
Angular JS follows MVC pattern, it has got attention among developers due to its amazing templating system, and development practices used. MVC means model, view, controller. Views are specified using HTML and Angular JS own templating language.This framework is capable of accepting user actions, events and to find out which template to refresh. Javascript functions and objects constitute models and controllers of this framework.<br />
<br />
Angular JS has got one important feature called, "dependency injection (DI)". This inbuilt feature enables us to develop web apps from smaller, thoroughly tested services. Well lets get started with a simple hello world program just like we begin all programming languages. Sample code is as follows:<br />
<br />
<pre class="brush: js"><!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
</head>
<body ng-app="helloWorldApp">
<span class="Apple-tab-span" style="white-space: pre;"> </span><div ng-controller="HelloController" >
<span class="Apple-tab-span" style="white-space: pre;"> </span><h2>Hello {{myData.message}} !</h2>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<script>
angular.module("helloWorldApp", [])
.controller("HelloController", function($scope) {
$scope.myData = {};
$scope.myData.message = "World, AngularJS";
} );
</script>
</body>
</html> </pre>
<br />
I guess you have find the code simple, let have a break down of above code snippet.<br />
<pre class="brush: js"><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script></pre>
<br />
Above is the line of code to include Angular JS library, you can eiter use CDN or download it in your local system.<br />
<br />
If we want a HTML page to a Angular JS application we need to include "ng-app", so it can be recognized as AJS application.<br />
<b>ng-app="</b>helloWorldApp<b>"</b><br />
<br />
There is also a attribute called "ng-init" for initializing model befor html gets rendered, in the above method we have used controllers a better way to do so.<br />
<br />
<b>ng-controller="</b>HelloController<b>"</b>, used for assinging controller to be used for this app.<br />
<br />
<b>{{ myData.message }}</b> the double curly brackets expression is used for outputting model values.<br />
<br />
<b>angular.module("helloWorldApp", [])</b>: this is the way of defining module in Angular js.<br />
<br />
Hope you find this article useful, if any queries please ask. In the next article we will be discussing about various expressions and directives in Angular JS. </div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-5235979019665900702014-07-22T21:39:00.001-07:002015-06-21T07:15:02.562-07:00Angular JS - Introduction<div dir="ltr" style="text-align: left;" trbidi="on">
AngularJS is a client-side MVC framework written in JavaScript developed by Google. Angular JS is most suited in developing single page web applications. It is a general purpose framework that makes easier to develop RIA web applications.<br />
<br />
You can get Angular JS from, <a href="http://angularjs.org/" target="_blank">http://angularjs.org/</a><br />
<br />
Lets have a look at sample program in Angular JS,<br />
<br />
<pre class="brush: js"><!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-init="title = 'World'">>
<span class="Apple-tab-span" style="white-space: pre;"> </span><h2>Hello, {{ title }}!</h2>
</body>
</html>
</pre>
Hope you had good introduction to AJS, you can find more detailed explanation about the topic from next
article "Getting started with Angular JS". If any queries please comment.
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-91261861100936046082014-07-22T01:08:00.004-07:002015-06-21T10:06:12.457-07:00Create CSV file and download using Codeigniter<div dir="ltr" style="text-align: left;" trbidi="on">
The 'dbutil' class of codeigniter is used for creating csv file, so you need to load this class first,<br />
<br />
<pre class="php" name="code">$this->load->dbutil();</pre>
<br />
In this example we going to create a csv file from database table. Please check out the code snippet below.<br />
<br />
<pre class="prettyprint linenums lang-php">public function createCsvDownload()
{
$this->load->dbutil();
$query = $this->db->query("SELECT * FROM table_name");
$delimiter = ",";
$newline = "\r\n";
$data= $this->dbutil->csv_from_result($query, $delimiter, $newline);
header('Content-Description: File Transfer');
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename=csv_file.csv');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Transfer-encoding: binary');
echo $data;
flush();
exit;
}
</pre>
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-81957376295868663872014-02-28T22:32:00.000-08:002014-03-04T23:00:03.332-08:00QA Guideline For A Better Web Developer - Admin Section, Part - 2<div dir="ltr" style="text-align: left;" trbidi="on">
From the <a href="http://coders-bay.blogspot.in/2014/02/qa-guideline-for-better-web-developer.html" target="_blank">previous post </a>we discussed about quality measures to be taken on developing front end design. Now its time for admin side development, which is used to manage overall site functionalities and say cms sections. So this area plays a vital role. Here we are going to have a discussion about security & quality measures for administrator site development. So lets get started,<br />
<br />
<ol style="text-align: left;">
<li>Password field should be masked /encrypted.</li>
<li>Admin Email address, Once the site is live please ensure the email address is of the client, if not available put the email address of the AM.</li>
<li>Should be done with sessions.</li>
<li>Last entered record should be default first position in user side unless otherwise specified in the POD<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Navigation naming standards - Manage /module Name.</li>
<li>It would be user friendly if the navigation is categorized if too long.</li>
<li>Look and feel should be consistent.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Use text editor for long description.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Radio Button <span class="Apple-tab-span" style="white-space: pre;"> </span>-Default should always be selected.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>No Manage item should accept duplicate both in insert and update.</li>
<li>Drop-down data entry field (control) - The options should sort appropriately and the field is wide enough to display all of the options.</li>
<li>Ensure that valid labels are present for each field.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>All the field names should display outside the controls (text box, text area) on contact forms. Only if there is a space constraint, the label text should come inside text boxes/text areas.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Full colon should not be used after the field names. In case full colon is used for labels, there should not be a space before the colon, but there must be a space after the colon.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Also COLON should be aligned correctly.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Thank You page should always redirect to the form submitted page. If it is a complete static site without ‘PHP’ support, there should be a back button using JavaScript. </li>
<li>Password field should accept only if a minimum of 6 characters.</li>
<li>Validate the input with Data Type and Maximum Length.</li>
<li>Ensure all operations in a form such as Add, Edit, Delete, Update are performed well.</li>
<li>Ensure that the field accepts only numerical values and greater than zero where an input is designed for numerical values greater than zero. </li>
<li> Add the following meta tag to all landing pages that are created <meta name="robots" content="noindex, nofollow">.<span class="Apple-tab-span" style="white-space: pre;"> </span></li>
<li>Canonical Redirection, Index.php to domain.com/adminonline redirection.</li>
</ol>
<br /></div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-87539973558739321132014-02-20T22:24:00.001-08:002014-03-04T23:01:11.738-08:00QA Guideline For A Better Web Developer<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Have anyone ever thought of building a high quality website? Its SEO? Etc. In today's competitive market one thing we cannot compromise is "quality". For any business, success depends upon the quality of product like "One who sells the better the best". This is same in the case of websites also.<br />
<br />
There are several things to be considered in developing a high quality website. In this article we will be discussing about those points. Also this guide lines can be handy for quality analysts as well as for SEO professionals. Following this article you can build highly ranked website by search engines. Almost every web applications will have user and admin section. Quality measures for user and admin are as follows:<br />
Wish you the best to make out of this article.<br />
<div>
<br /></div>
<h3 style="text-align: left;">
User Section (Front end)</h3>
<div>
Front end is the most attractive part of the site, part which is handed to end user. This part is to be more simple that visitors can easily navigate to inner contents. My suggestions include SEO tips also. So how to build a better front end? So, lets get started, </div>
<div>
<br /></div>
<div>
<ol style="text-align: left;">
<li>Title – There should be meaningful title for all the pages.</li>
<li>Always use the Organization standard for Abbreviation, Eg: USA St. for Street, Rd. for Road etc.<br /><table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 57.9pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-table-layout-alt: fixed;">
<tbody>
<tr style="height: 17.5pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td colspan="5" style="border: solid black 1.0pt; height: 17.5pt; mso-border-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 363.5pt;" valign="top" width="485"><div class="MsoNormal">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Wrong Formats<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 14.3pt; mso-yfti-irow: 1; mso-yfti-lastrow: yes;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 14.3pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 72.1pt;" valign="top" width="96"><div align="center" class="MsoNormal" style="layout-grid-mode: char; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">U.S.A<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 14.3pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 72.1pt;" valign="top" width="96"><div align="center" class="MsoNormal" style="layout-grid-mode: char; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">U. S. A<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 14.3pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 72.1pt;" valign="top" width="96"><div align="center" class="MsoNormal" style="layout-grid-mode: char; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">U. S. A.<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 14.3pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 72.1pt;" valign="top" width="96"><div align="center" class="MsoNormal" style="layout-grid-mode: char; text-align: center;">
<st1:place w:st="on"><st1:country-region w:st="on"><span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">U.S.A.</span></st1:country-region></st1:place><span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;"><o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 14.3pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 75.1pt;" valign="top" width="100"><div align="center" class="MsoNormal" style="layout-grid-mode: char; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">U .S .A<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
</li>
<li>Spacing after each punctuation “ . , ; ! : ”. No space before punctuation!</li>
<li>Don’t put full stop after “?.” Or “!.”– “?” without full stop is correct.<br /><table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 51.45pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-table-layout-alt: fixed;">
<tbody>
<tr style="height: 11.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="background: #E0E0E0; border-right: none; border: solid black 1.0pt; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Sl.
No.<o:p></o:p></span></div>
</td>
<td style="background: #E0E0E0; border-right: none; border: solid black 1.0pt; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">punctuation<o:p></o:p></span></div>
</td>
<td style="background: #E0E0E0; border-right: none; border: solid black 1.0pt; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Correct<o:p></o:p></span></div>
</td>
<td style="background: #E0E0E0; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Wrong <o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 1;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">1<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">.<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Only
one. And<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Only
one . and<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 2;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">2<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">,<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Indent,
Left<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Indent
, Left<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 3;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">3<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">;<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Following;<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Following
; <o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 4;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">4<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">:<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Indent:
Left<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Indent
: Left<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 5;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">5<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">!<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Wow!<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Wow !<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 6;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">6<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Do not use ‘.’ after ‘?’<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Why?<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Why?.<o:p></o:p></span></div>
</td>
</tr>
<tr style="height: 11.0pt; mso-yfti-irow: 7; mso-yfti-lastrow: yes;">
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 44.2pt;" valign="top" width="59"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">7<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 137.2pt;" valign="top" width="183"><div align="center" class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in; text-align: center;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Do not use ‘.’ after ‘!’<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid black 1.0pt; border-left: solid black 1.0pt; border-right: none; border-top: none; height: 11.0pt; mso-border-bottom-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 81.8pt;" valign="top" width="109"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Wow!<o:p></o:p></span></div>
</td>
<td style="border-top: none; border: solid black 1.0pt; height: 11.0pt; mso-border-alt: solid black .5pt; mso-border-top-alt: solid black .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 84.8pt;" valign="top" width="113"><div class="ListParagraph" style="layout-grid-mode: char; margin-left: 0in;">
<span style="font-family: Verdana; font-size: 10.0pt; mso-bidi-font-size: 11.0pt;">Wow!.<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
</li>
<li>Don’t put full stop after phrases.</li>
<li>Do not use space before or after “ – ”, when it is used for connecting two words.</li>
<li>Font Format should be readable.</li>
<li>Do not use underscore for connecting words in file names. Use hyphen (-). Eg: “about-us.php”.</li>
<li>Most of the content should be in text, Minimize image captions for articles – use H1, H2 Tags.</li>
<li>There shouldn’t be any underlining for the white space before or after the selected area. <u>This is not correct </u> format.</li>
<li>All the labels having multiple words should be in Title Case. Eg: “Confirm Password” – “Confirm password” is not correct.</li>
<li>Links<br />a) Check whether the links pointing are relevant.<br />b) There shouldn't be any broken link.<br />c) Run Xenu and find the broken links and fix it.</li>
<li>Out Going Links.<br />a) Ensure all the external links from our website should have “no-follow”.<br />b) Check all the external linked websites are working fine and opens in new window.</li>
<li>Logo should direct to the domain. Example: http://www.website.com</li>
<li>Canonical Redirection.<br />a) Non www to www redirection.<br />b) Index.php to domain.com redirection.</li>
<li>Custom 404 page.<br />a) This page should have link to HTML sitemap.<br />b) If the error URL ends with /, it should not go to default 404 page.</li>
<li>Image Alt Tags.<br />a) Alt tags should be descriptive, not just keywords.<br />b) All images should have alt tags except bullet, icon images.<br />Designers will provide the tag and SEO people will fill in the tags.</li>
<li>Title Attributed for text links.<br />a) Be sure to use the primary keyword as title attribute for the corresponding HTML text links.</li>
<li>H1, H2 Tags.<br />a) Follow hierarchy while giving H1 tags.</li>
<li>Blog Set Up.<br />a) Check all the aspects of blog working like tags, recent posts etc.</li>
<li>Blog Links - Ensure the post title should be post URL.<br />a) All blogs need to have a HOME tab that links to the domain and a ‘BLOG tab’ that directs the user to the blog home.<br />b) The logo in a blog needs to be directed to the domain and not the ‘blog home’.</li>
<li>Ensure that there is no broken design.</li>
<li>Check for the Alignment of contents.</li>
<li>Footer Copyright Message - Ensure the following standard message.<br />a) “Copyright © 2014, Coder's Bay | Business Hotel Somerset UK”(If there is specified any place name )<br />b) Copyright © 2014 Glen Pinheiro. All Rights Reserved. </li>
<li>Contact Form - Ensure site wide form presence and functionality.</li>
<li>Form Field Validations.<br />a) Mandatory for Name, Phone, Email and Comments Field. No need of space before asterisk while applying mandatory sign.<br />b) Only Null field validations are required for phone number unless specified by the client otherwise.<br />c) Email address with more than one period should be accepted eg:test.t.e@gmail.com.<br />d) The form should not be submitted when the enter key is pressed while the cursor is in the comments text area.</li>
<li>Should be able to navigate through controls using keyboard keys.</li>
<li>Spelling - Should be checked for correctness.</li>
<li>Menu structure should be consistent.</li>
<li>Browser Compatibility<span class="Apple-tab-span" style="white-space: pre;"> </span>- Should check in IE 6, IE 7, IE 8, Fire Fox.<br /> - Optionally - Safari, Opera and Chrome on Client’s Request.<br /> - Should check in different platform (Windows, Linux).</li>
<li>Validate HTML and XHTML using W3Cs “<a href="http://validator.w3.org/" target="_blank">MarkUp Validator</a>”. Use the following URL <a href="http://validator.w3.org/">http://validator.w3.org/</a>.</li>
<li>Check anchors (hyperlinks) in a HTML/XHTML document using “<a href="http://validator.w3.org/checklink" target="_blank">The Link Checker</a>” - Useful to find broken links, etc. Download Xenu’s Link Sleuth.</li>
<li>Validate CSS style sheets or documents using “<a href="http://jigsaw.w3.org/css-validator/" target="_blank">CSS Validator</a>”. URL for CSS validator: <a href="http://jigsaw.w3.org/css-validator/">http://jigsaw.w3.org/css-validator/</a>.</li>
<li>Always use External CSS and JavaScript for performance, readability, maintainability and re-usability.</li>
<li>Use tables, only for Forms and use stylesheets for other types of positioning. Tables should be used only when it is absolutely necessary and when DIV cannot be used.</li>
<li>Ensure the presence of DOCTYPE definition in all the HTML files.<br />Eg: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></li>
<li>Provide Internationalization by means of using.<br />a) Unicode character set (UTF-8, UTF-16 etc.)<br />b) W3C date format – “yyyy-mm-dd”</li>
<li>(1984-05-04 can only mean May 4th, 1984).</li>
<li>Always Use a Background Color - Visitors are able to change their default color preferences. If you don't specify a background color, your text might be invisible.</li>
<li>Text equivalent for all non-text elements. Example, alt text for images. </li>
<li>Associate labels with their controls (forms).</li>
<li>All the field names should display outside the controls (text box, text area) on contact forms. Only if there is a space constraint, the label text should come inside text boxes/text areas.</li>
<li>Thank You page should always tempt the user to navigate through the site by providing links or options that lead to conversion friendly pages within the site.</li>
<li>Quality of information and images should not be affected even if JavaScript is turned off. If it happens, it affects usability of the website.</li>
<li>Do not “cut & paste” from Microsoft Word into a web document as word adds lot of unwanted styles, classes etc. along with the text copied from it.</li>
<li>Use meaningful text for hyper links, rather than “click here”. </li>
<li>Provide alternative content for video and audio contents, whenever possible.</li>
<li>Color pattern should be matching. Don’t insert much graphics. Graphics size should not affect the performance.</li>
<li>Check if the phone number (in text) is added on top of each page?</li>
<li>Check if the GA code is properly added in all pages. Ensure that the GA code is not commented for any reason. </li>
<li>Please block Admin online folder in robot.txt.</li>
<li>Check if the conversion code is added to Thanks pages?</li>
</ol>
<div>
Hope you have found this article useful, thank you. </div>
<div>
In the <a href="http://coders-bay.blogspot.in/2014/02/qa-guideline-for-better-web-developer_28.html" target="_blank">next article</a> we will be discussing about the security & quality measures to be taken for the administrator section.</div>
<ol style="text-align: left;">
</ol>
<ol style="text-align: left;">
</ol>
<div>
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com1tag:blogger.com,1999:blog-1195485636293192511.post-41160093112494612642012-12-14T06:20:00.001-08:002015-06-21T10:06:40.630-07:00Creating Marker / Overlays in Google Map<div dir="ltr" style="text-align: left;" trbidi="on">
Overlays in Google maps are used to point to a specific location that we point to. It is an easy task. Here in this tutorial I'm only stressing at creating Overlays , if any doubt regarding creating maps please refer to my <a href="http://coders-bay.blogspot.in/2012/12/creating-google-maps-using-api.html">previous post</a>.<br />
<br />
So lets get started.<br />
Overlays are objects on the map that are bound to latitude/longitude coordinates.Google maps has several types of overlays: Marker, Polyline, Polygon, Circle, Rectangle etc.<br />
<br />
<b><u>Google Maps - Add a Marker</u></b><br />
<b><u><br /></u></b>
Add the marker to the map by using the setMap() method:<br />
<b><i><a href="http://glen-online.web44.net/demos/google-map-with-marker.php" target="_blank">See demo</a></i></b><br />
<br />
<pre class="brush:html"><script>
var myCenter=new google.maps.LatLng(9.9667,76.2167);
function initialize()
{
var mapProp = {
center:myCenter,
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
<b>//Marker</b>
var marker=new google.maps.Marker({
position:myCenter,
});
marker.setMap(map);
}
<b>//End</b>
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</pre>
<br />
<b><u>Animating Marker</u></b><br />
<b><u><br /></u></b>
Applying animation property to the marker.<br />
<b><i><a href="http://glen-online.web44.net/demos/google-map-with-animated-marker.php" target="_blank">See demo</a></i></b><br />
<br />
<pre class="brush:js">marker=new google.maps.Marker({
position:myCenter,
animation:google.maps.Animation.BOUNCE
});
marker.setMap(map);
</pre>
<br />
<br />
<b><i><br /></i></b>
Thank You!<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-32446898421411519122012-12-14T06:05:00.002-08:002015-06-21T10:06:56.824-07:00Creating Google Maps using API<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Creating a Basic Google Map</h3>
<div>
Here we going to discuss about creating Google maps with API. API means 'Application Program Interface'. Before proceeding to the tutorial for the maps to work an API key is needed which can be received free of cost from Google.</div>
<div>
<br /></div>
<div>
In this section I will explain you how to create a basic Google Map. Its easy, just try it out...,</div>
<div>
<b><i><a href="http://glen-online.webege.com/demos/basic-map.php" target="_blank">See demo</a></i></b><br />
<br />
<pre class="brush:html"><!DOCTYPE html>
<html>
<head>
<script src="http://maps.googleapis.com/maps/api/js?key=<YOUR_API_KEY>&sensor=false">
</script>
<script>
function initialize()
{
var mapProp = {
center:new google.maps.LatLng(9.9667,76.2167),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap")
,mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="googleMap" style="width:500px;height:380px;"></div>
</body>
</html>
</pre>
</div>
<div>
<br /></div>
<div>
<u><b>Code Explanation</b> </u></div>
<div>
<br /></div>
<div>
<div>
<pre class="brush:js"><script src="http://maps.googleapis.com/maps/api/js?key=<b><YOUR_API_KEY></b>&sensor=false">
</script>
</pre>
</div>
</div>
<div>
This tag is required to include Google Maps API. key=<b><YOUR_API_KEY> </b>, enter you API key provided.</div>
<div>
The "sensor" attribute can be true or false.</div>
<div>
<br /></div>
<pre class="brush:html">var mapProp = {
center:new google.maps.LatLng(9.9667,76.2167),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
</pre>
<div>
<br /></div>
<div>
"<i>center</i>" property decides were to center the map depending upon the latitude and longitude given.</div>
<div>
"<i>zoom</i>" decides the initial zoom level of the map.</div>
<div>
"<i>mapTypeId</i>" property specifies the map type. It can be ROADMAP, HYBRID, TERRAIN and so on..,</div>
<div>
<br /></div>
<div>
Finally on execution the map will be shown on the specified target.</div>
<div>
<br /></div>
<div>
Its all about creating a basic Google Map. If any suggestions or help please use the comments area.</div>
<div>
<br /></div>
<div>
Thank You!</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-68345372393584071152012-12-07T21:27:00.003-08:002014-03-04T23:02:21.388-08:00Creating RSS Feed in PHP<div dir="ltr" style="text-align: left;" trbidi="on">
Do you know what is RSS feed?<br />
RSS is a great way to promote your blog. In fact, most blogs will automatically set up an RSS feed to go with the blog unless you specifically tell the software not to. It is not only for blog, you might have heard about podcasts, but you can also promote other articles, new products or just interesting information with an RSS feed.<br />
<br />
Some interesting uses of RSS feeds that I've seen include:<br />
<br />
<ul style="text-align: left;">
<li>What's new with the company or website.</li>
<li>Lists of just about anything - from gift wishlists to rental queues to quotations and more.</li>
<li>Daily quotes or subscription details. etc.</li>
</ul>
RSS feeds provide an easy, almost automated way to update your site's content. It allows viewers the opportunity to decide what they want to read without forcing them to go anywhere, which they`re likely to appreciate. It allows both human readers and search engine spiders to find content based on keywords without compromising the quality for either one. It`s an excellent way to market any type of website, but especially blogs since these tend to be updated much more frequently and consequently have more subscribers. It`s a great method for keeping people informed during a collaborative effort. Having your feed taken up by other webmasters can increase the number and quality of back-links to your site.<br />
<div>
<br /></div>
<div>
Well, lets come to our topic Creating RSS feed with PHP.</div>
<div>
<br /></div>
<div>
<b><u>feed-xml.php</u></b></div>
<div>
<br /></div>
<div>
'feed-xml.php' is a feed for your website, make sure the below script is edited upon your requirement.</div>
<div>
<div>
<?php</div>
<div>
header("Content-Type: application/rss+xml; charset=ISO-8859-1");</div>
<div>
</div>
<div>
DEFINE ('DB_USER', 'root'); </div>
<div>
DEFINE ('DB_PASSWORD', ''); </div>
<div>
DEFINE ('DB_HOST', 'localhost'); </div>
<div>
DEFINE ('DB_NAME', 'codersbay'); </div>
<div>
</div>
<div>
$rssfeed = '<?xml version="1.0" encoding="ISO-8859-1"?>';</div>
<div>
$rssfeed .= '<rss version="2.0">';</div>
<div>
$rssfeed .= '<channel>';</div>
<div>
$rssfeed .= '<title>NFPM</title>';</div>
<div>
$rssfeed .= '<link>Link to the Site</link>';</div>
<div>
$rssfeed .= '<description>Descirption about your site.</description>';</div>
<div>
$rssfeed .= '<language>en-us</language>';</div>
<div>
$rssfeed .= '<copyright>Copyright (C) 2012 glen-online.webege.com</copyright>';</div>
<div>
</div>
<div>
$connection = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)</div>
<div>
or die('Could not connect to database');</div>
<div>
mysql_select_db(DB_NAME)</div>
<div>
or die ('Could not select database');</div>
<div>
</div>
<div>
$query = "SELECT * FROM blog ORDER BY date DESC";</div>
<div>
$result = mysql_query($query) or die ("Could not execute query");</div>
<div>
</div>
<div>
while($row = mysql_fetch_array($result)) {</div>
<div>
extract($row);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
$rssfeed .= '<item>';</div>
<div>
$rssfeed .= '<title>' . $row['title'] . '</title>';</div>
<div>
$rssfeed .= '<description>' . $row['contents'] . '</description>';</div>
<div>
//$rssfeed .= '<link>' . $link . '</link>';</div>
<div>
$rssfeed .= '<pubDate>' . date("D, d M Y H:i:s O", strtotime($row['date'])) . '</pubDate>';</div>
<div>
$rssfeed .= '</item>';</div>
<div>
}</div>
<div>
</div>
<div>
$rssfeed .= '</channel>';</div>
<div>
$rssfeed .= '</rss>';</div>
<div>
</div>
<div>
echo $rssfeed;</div>
<div>
?></div>
</div>
<div>
<br /></div>
<div>
On your web page add this script to show feed burner icon and to call the above functionality.</div>
<div>
<br /></div>
<div>
<a href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open('http://www.seocentro.com/cgi-bin/promotion/bookmark-rss/rss.pl?u='+c( 'http://your-site/feed-xml.php' ),'bookmark_popup','left='+((a.screenX||a.screenLeft)+10)+',top='+((a.screenY||a.screenTop)+10)+',height=480px,width=720px,scrollbars=1,resizable=1,alwaysRaised=1');a.setTimeout(function(){ d.focus()},300)})();" title="RSS" class="rss"></div>
<div>
<img src='http://www.businessawardseurope.com/images/general/rss75x75.gif' alt='rss' /></div>
<div>
</a></div>
<div>
<br /></div>
<div>
Check it out, if any suggestions or doubts please use the comment facility.</div>
<div>
<br /></div>
<div>
Thank You!.</div>
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-91862585032806651062012-12-04T08:32:00.002-08:002014-03-04T23:01:58.886-08:00HTML to PDF Conversion in PHP<div dir="ltr" style="text-align: left;" trbidi="on">
Today I'm presenting you one interesting feature in PHP, it is nothing but html to pdf conversion just using a simple php scripts. For this purpose we will be using a 3rd party library which can make our job easy.<br />
<br />
The third party library I'm introducing is "HTML2PDF". For creating a pdf out of html file please refer below:<br />
<br />
<b><u>test.html</u></b><br />
<br />
<br />
<!DOCTYPE html><br />
<html lang="en"><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br />
<title>Test HTML</title><br />
</head><br />
<br />
<body><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h1>HTML TO PDF</h1><br />
<p>Hello World!</p><br />
</body><br />
</html><br />
<div>
<br /></div>
<div>
Above is a html snippet. Here it is a demo to convert the above html file to pdf. See the code below.</div>
<br />
<br />
<b><u>index.php</u></b><br />
<br />
<br />
<?php<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>error_reporting(0);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>require("html2fpdf.php"); <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$htmlFile = "test.html";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$buffer = file_get_contents($htmlFile);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$pdf = new HTML2FPDF('P', 'mm', 'Letter');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$pdf->AddPage();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$pdf->WriteHTML($buffer);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$pdf->Output('test.pdf', 'F'); <span class="Apple-tab-span" style="white-space: pre;"> </span><br />
?><br />
<br />
"html2fpdf.php" included is the library. Click <a href="http://sourceforge.net/projects/html2fpdf/" target="_blank">here</a> to download.<br />
<br />
It the simplest method available to convert html to pdf. Please suggest any idea if you find any.<br />
<br />
Thank You!</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com2tag:blogger.com,1999:blog-1195485636293192511.post-91823905701836601202012-12-03T06:20:00.004-08:002015-06-21T10:05:12.180-07:00Unzipping a zipped file using PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Below is a code to unzip a zipped file. Hope you can make the best of it.<br />
<br />
<b><u>function.php</u></b><br />
<b><u><br /></u></b>
<?php<br />
function unzip($ziplocation,$unzippedLocation){<br />
if(exec("unzip $ziplocation",$arr)){<br />
mkdir($newLocation);<br />
for($i = 1;$i< count($arr);$i++){<br />
$file = trim(preg_replace("~inflating: ~","",$arr[$i]));<br />
copy($ziplocation.'/'.$file,$unzippedLocation.'/'.$file);<br />
unlink($ziplocation.'/'.$file);<br />
}<br />
return TRUE;<br />
}else{<br />
return FALSE;<br />
}<br />
}<br />
?><br />
<br />
<b><u>index.php</u></b><br />
<br />
<br />
<?php<br />
include 'functions.php';<br />
if(unzip('zipfolder/test.zip','unziped/newZip'))<br />
echo 'Success!';<br />
else<br />
echo 'Error';<br />
?><br />
<br />
Thank You!<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-4752604482238149452012-12-03T06:09:00.001-08:002015-06-21T10:07:26.081-07:00Email validation in PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Email validation in php using regular expression.<br />
<br />
$email = $_POST['email'];<br />
if(preg_match("~([a-zA-Z0-9!#$%&amp;'*+-/=?^_`{|}~])@([a-zA-Z0-9-]).([a-zA-Z0-9]{2,4})~",$email)) {<br />
echo 'This is a valid email.';<br />
} else{<br />
echo 'This is an invalid email.';<br />
}<br />
<br />
Thank You!</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-37497638439931459752012-12-02T03:27:00.001-08:002014-03-04T23:04:56.890-08:00Payment through WorldPay<div dir="ltr" style="text-align: left;" trbidi="on">
WorldPay is one of the well known payment gateways available. Here it an integration code. Hope you will find it helpful.<br />
<br />
<html><br />
<!-- The name, style, and properties of the page are defined in the 'head' tags. --><br />
<head><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><title>HTML Redirect Example 0.1</title><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><meta http-equiv="Content-Type" content="text/html"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><meta name="description" content="Junior HTML Example 0.1"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><meta name="keywords" content="Junior, html"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><style type="text/css">td {text-align:"left"; vertical-align:"middle"; font-family:"arial"; color:"black"} h1,h2,h3,h4,h5,h6,h7 {text-align:"center"; vertical-align:"middle"; font-family:"arial"; color:"black"}</style><br />
</head><br />
<br />
<!-- The content to be used on the page is placed between the 'body' tags. --><br />
<body><br />
<br />
<!-- This is a purchase token, for more information on the elements with in a purchase token see the supplied help section. --><br />
<form action="https://secure-test.worldpay.com/wcc/purchase" name="BuyForm" method="POST"><br />
<input type="hidden" name="instId" value="211616"><br />
<input type="hidden" name="cartId" value="abc123"><br />
<input type="hidden" name="currency" value="GBP"><br />
<input type="hidden" name="amount" value="0"><br />
<input type="hidden" name="desc" value=""><br />
<input type="hidden" name="testMode" value="100"><br />
<br />
<!-- JavaScript is used to give functionality to some of the pages elements. --><br />
<script language=JavaScript><br />
<br />
<!-- This function defines the price of each product. To add the product edit further down the page. --><br />
function calc(productNo)<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (productNo==1)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.BuyForm.amount.value = 5.00;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.BuyForm.desc.value = "Product 1";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if (productNo==2)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.BuyForm.amount.value = 10.00;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.BuyForm.desc.value = "Product 2";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><!-- To add a new product price, copy from here... --><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if (productNo==3)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.BuyForm.amount.value = 15.00;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>document.BuyForm.desc.value = "Product 3";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><!-- ...to here, and paste directly below. You will need to alter the 'productNo' and its price value. --><br />
}<br />
<br />
</script><br />
<br />
<h1>One-Click Shop</h1><br />
<br />
<!-- This table provides layout for the products listed on the webpage. --><br />
<table align="center" cellpadding="3" border="2"><br />
<tr><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td>Product 1</td><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td> Price: &pound;5.00</td><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td><input type="image" src="buy_button.jpg" alt="Buy button" onClick="calc(1)"></td><br />
</tr><br />
<tr><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td>Product 2</td><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td>Price: &pound;10.00</td><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td><input type="image" src="buy_button.jpg" alt="Buy button" onClick="calc(2)"></td><br />
</tr><br />
<!-- To add a new product, copy from here... --><br />
<tr><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td>Product 3</td><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td>Price: &pound;15.00</td><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><td><input type="image" src="buy_button.jpg" alt="Buy button" onClick="calc(3)"></td><br />
</tr><br />
<!-- ...to here, and paste directly below. You will need to alter three things: the product number, price, and calc(put product number here) --><br />
</table><br />
<br />
</form><br />
</body><br />
</html><br />
<br />
Thank You!</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-2384550810250913672012-12-01T22:33:00.001-08:002014-03-04T23:05:46.430-08:00Image Upload in Different Sizes in PHP<div dir="ltr" style="text-align: left;" trbidi="on">
Below is a PHP code to upload image in different sizes. This code will be useful while creating image gallery, shopping carts or any other colorful web based projects.<br />
<br />
<b>index.php</b><br />
<br />
<i><!-- html code [UI] --></i><br />
<i><br /></i>
<br />
<!DOCTYPE html><br />
<html lang="en"><br />
<head><br />
<meta charset="utf-8" /><br />
<title>File Upload</title><br />
</head><br />
<br />
<body><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><form method="post" enctype="multipart/form-data"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><p><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input type="file" name="file" id="file" /><br />
<input type="submit" name="submit" id="submit" value="Upload" /><br />
</p><br />
</form><br />
</body><br />
</html><br />
<i><!-- html end --></i><br />
<br />
<i><!-- image upload and processing code in php --></i><br />
<br />
<br />
<?php<br />
define ("MAX_SIZE","500");<br />
<br />
$errors=0;<br />
<br />
if($_SERVER["REQUEST_METHOD"] == "POST")<br />
{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$image =$_FILES["file"]["name"];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$uploadedfile = $_FILES['file']['tmp_name'];<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if ($image)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$filename = stripslashes($_FILES['file']['name']);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$extension = getExtension($filename);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$extension = strtolower($extension);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo ' Unknown Image extension ';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$errors=1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$size=filesize($_FILES['file']['tmp_name']);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if ($size > MAX_SIZE*1024)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo "You have exceeded the size limit";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$errors=1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if($extension=="jpg" || $extension=="jpeg" )<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$uploadedfile = $_FILES['file']['tmp_name'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$src = imagecreatefromjpeg($uploadedfile);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else if($extension=="png")<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$uploadedfile = $_FILES['file']['tmp_name'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$src = imagecreatefrompng($uploadedfile);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>else<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$src = imagecreatefromgif($uploadedfile);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>list($width,$height)=getimagesize($uploadedfile);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$newwidth=800;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$newheight=($height/$width)*$newwidth;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$tmp=imagecreatetruecolor($newwidth,$newheight);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$newwidth1=75;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$newheight1=($height/$width)*$newwidth1;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$tmp1=imagecreatetruecolor($newwidth1,$newheight1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$width,$height);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$width,$height);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$filename = "uploads/". $_FILES['file']['name'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$filename1 = "uploads/small". $_FILES['file']['name'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagejpeg($tmp,$filename,100);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagejpeg($tmp1,$filename1,100);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagedestroy($src);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagedestroy($tmp);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>imagedestroy($tmp1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//If no errors registred, print the success message<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(isset($_POST['Submit']) && !$errors)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// mysql_query("update SQL statement ");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Image Uploaded Successfully!";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>function getExtension($str) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$i = strrpos($str,".");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (!$i) { return ""; }<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$l = strlen($str) - $i;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$ext = substr($str,$i+1,$l);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return $ext;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
?><br />
<br />
<br />
<i><!-- End --></i><br />
<i><br /></i>
<i>Here using the above code the image will be uploaded in two different sizes with width's 800px & 75px respectively.</i><br />
<i><br /></i>
Thank You!</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-25520936933447331332012-12-01T08:26:00.003-08:002014-03-04T23:06:56.993-08:00Importing Excel Records to MySQL<div dir="ltr" style="text-align: left;" trbidi="on">
How to import MS Excel records to as MySQL table?<br />
<br />
At first before executing the below query the Excel document should converted to .csv format. For this select save as and chose file type as *.csv(Comma delimiter).<br />
<br />
The query is as follows:<br />
<br />
LOAD DATA LOCAL INFILE '[path://]file.csv' INTO TABLE database.tableName FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' (field1,field2,field3,.....);<br />
<br />
Thank You!</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-828605315599978712012-11-30T09:16:00.003-08:002012-11-30T09:18:09.759-08:00Create thumbnails for Youtube & Vimeo Videos using PHP<div dir="ltr" style="text-align: left;" trbidi="on">
Here we are going to see how to generate thumbnail images from youtube and vimeo videos. This article will be useful when creating a video gallery.<br />
<div>
<br /></div>
<div>
<b><span style="font-size: large;">Creating thumbnails of Youtube videos</span></b><br />
<b><span style="font-size: large;"><br /></span></b></div>
<div>
Creating thumbnails for Youtube is an easy task to perform, actually PHP code is not necessary to perform this.</div>
<div>
<br /></div>
<div>
Each YouTube video has 4 generated images. They are predictably formatted as follows:</div>
<div>
<br /></div>
<div>
<div>
http://img.youtube.com/vi/<b><insert-youtube-video-id-here></b>/0.jpg</div>
<div>
http://img.youtube.com/vi/<b><insert-youtube-video-id-here></b>/1.jpg</div>
<div>
http://img.youtube.com/vi/<b><insert-youtube-video-id-here></b>/2.jpg</div>
<div>
http://img.youtube.com/vi/<b><insert-youtube-video-id-here></b>/3.jpg</div>
</div>
<div>
<br /></div>
<div>
Example:</div>
<div>
Say link "http://www.youtube.com/watch?v=QdoTdG_VNV4&feature=g-all",</div>
<div>
In this youtube link video id is "QdoTdG_VNV4". So if you want to create thumbnail for this videos use this id with the above representation.</div>
<div>
<br /></div>
<div>
http://img.youtube.com/vi/<b>QdoTdG_VNV</b>/0.jpg</div>
<div>
<br /></div>
<div>
<b><span style="font-size: large;">Creating thumbnails of Vimeo videos</span></b></div>
<div>
<br /></div>
<div>
For Vimeo thumbnails can be generated using simple PHP code. </div>
<div>
<br /></div>
<div>
<div>
<?php</div>
<div>
<br /></div>
<div>
$imgid = <b><video-id></b>;</div>
<div>
<br /></div>
<div>
$hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));</div>
<div>
<br /></div>
<div>
echo $hash[0]['thumbnail_medium']; </div>
</div>
<div>
<br /></div>
<div>
?></div>
<div>
<br /></div>
<div>
If "<b>http://vimeo.com/36519586</b>" is the Vimeo link then <b><video-id></b> is "36519586".</div>
<div>
<br />
<br />
Thank You!</div>
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-6028279039815882442012-11-29T08:02:00.002-08:002015-06-21T10:08:29.395-07:00Creating 404 page in PHP (.htaccess)<div dir="ltr" style="text-align: left;" trbidi="on">
404 is a status shown by your browser when the requested page is not found by your server. In PHP you can design a custom 404 page using .htaccess functionality. Here is a sample code for this:<br />
<br />
<b>.htaccess</b><br />
RewriteEngine on<br />
ErrorDocument 404 [path]404.php<br />
<br />
Place this code in your projects root. 404.php can be a custom page designed by you. Try it out.<br />
<br />
Thank You!</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-59317533394757688982012-11-28T08:33:00.001-08:002012-11-28T08:33:40.325-08:00Download Link Using PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Create a download link using PHP.<br />
<br />
It needs two files index.php and download.php, this is just for an representation. Below is the code:<br />
<br />
<b><u>index.php</u></b><br />
<a href="download.php?file=conent.zip" title="Download"><br />
<b>Download file</b><br />
</a><br />
<br />
<b><u>download.php</u></b><br />
<br />
<?php<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$file =$_GET['file'];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>header("Content-type: application/text");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>header("Content-Disposition: attachment; filename=". $file);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>readfile($file);<br />
?><br />
<br />
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-89901891506612179662012-11-27T06:14:00.003-08:002012-11-27T06:14:43.856-08:00Print Current Day to End Day of Month in PHP<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<?php<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$datetime_start = strtotime(date('D Y/m/d'));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$datetime_end = strtotime(date("D Y/m/d",mktime(0, 0, 0, (date('m') + 1), 0, date('Y'))));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$datetime_temp = $datetime_start;<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<select class="input-box" name=""><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php while ($datetime_temp <= $datetime_end) { ?><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><option><?php echo date('D d/m/Y', $datetime_temp); ?></option><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><?php<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$datetime_temp = strtotime('+1 day', $datetime_temp); <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>?><br />
</select><br />
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-70206800916605328702012-11-27T06:10:00.003-08:002012-11-27T06:10:40.456-08:00Fetch data from database using php<div dir="ltr" style="text-align: left;" trbidi="on">
Fetching Data From Database,<br />
<br />
There is mainly two function that can be used to fetch data in php<br />
1. mysql_fetch_array() : Returns values as arrays.<br />
2. mysql_fetch_object() : Return object<br />
<?php<br />
$select = "select * from <table_name>";<br />
$result = mysql_query($select);<br />
?><br />
<br />
<b>1. mysql_fetch_array() </b><br />
<?php<br />
$data=mysql_fetch_array($result);<br />
$optionField1 = $data['fieldname1'];<br />
$optionField2 = $data['fieldname2'];<br />
?><br />
<br />
<b>2. mysql_fetch_object()</b><br />
<br />
<?php<br />
$data=mysql_fetch_object($result);<br />
$optionField1 = $data->fieldname1;<br />
$optionField2 = $data->fieldname2;<br />
?><br />
<br />
Thank You!<br />
</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-32428812870054600192012-11-26T10:12:00.002-08:002012-11-26T10:12:32.481-08:00Php code to update values in database<div dir="ltr" style="text-align: left;" trbidi="on">
Lets see how we can use php mysql to update values in the database,<br />
<br />
Database connection and other related facts are discussed earlier, so let move on to update directly,<br />
<br />
Syntax: update <table_name> set <field1>='[update value]' where [condition 1][condition 2]....<br />
<br />
See this demo,<br />
<br />
<u>id | name</u><br />
1 Rogg<br />
2 Hoggs<br />
3 Brad<br />
<br />
In the above that we need to update the name 'Hoggs' with 'Hopes',<br />
<br />
<?php<br />
$update = "update test_table set name='Hopes' where id=2";<br />
$result = mysql_query($update);<br />
?><br />
<br />
The statement will result in updation of the record with id is '2'.<br />
<br />
Thank You.</div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0tag:blogger.com,1999:blog-1195485636293192511.post-89814776176965176852012-11-25T09:39:00.004-08:002012-11-25T09:41:01.523-08:00Php code to insert values into database<div dir="ltr" style="text-align: left;" trbidi="on">
Here it is a sample code to insert elements into database.<br />
<br />
Inserting elements into database is a simple task, but before performing this task we should be connected with database and so on.<br />
<br />
<b>How to get connected with database using php?</b><br />
<b><br /></b>
Here in this case with are opting MySQL as the database, world's largest open source database. Connection is like this:<br />
<br />
$con=mysql_connect('[Host]','[username]','[password]') or die ('Connection failed');<br />
Format is like this.<br />
<br />
<?php<br />
$con=mysql_connect('localhost','root','') or die ('Connection failed');<br />
?><br />
<br />
This will connect you to the database, if not it will prompt you an error message 'Connection failed'. And our task is to insert data on to database.<br />
<br />
<?php<br />
mysql_connect_db('db_name',$con) or die('Connection to database failed');<br />
//Set database connection.<br />
//Say 'db_name' as database name.<br />
?><br />
<br />
Insert values to database:<br />
<br />
<?php<br />
$sql_insert="insert into <table_name> values (field1,field2) values ('val1','val2')";<br />
$result =mysql_query($sql_insert);<br />
?><br />
<br />
Thank You!<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/08350864387133207593noreply@blogger.com0