How to Enable mod_rewrite at Server

mod_rewrite may not be enabled by default in your Apache configuration. To make sure,
open the Apache configuration file, named httpd.conf.
The full path of the file will be \Program Files\xampp\apache\conf\httpd.conf.

Open httpd.conf and find the following line:
#LoadModule rewrite_module modules/mod_rewrite.so
The leading #means the line is commented, so remove it in order to have Apache load the mod_rewrite
module upon its startup:

LoadModule rewrite_module modules/mod_rewrite.so

After any change to httpd.conf, you need to restart the Apache server in order for the changes to take
effect. In case you run into trouble, you can check Apache’s error log file /logs/error.log, which
should contain the details of the error.

Once mod_rewrite is installed and enabled, you add the rewriting rules to the Apache configuration
file, httpd.conf. Apache also lets you save configuration options (including rewriting rules) on a
per-directory basis to a configuration file named .htaccess. All you have to do is create a file named
.htaccessinto a directory of your application.

Web Hosting or DNS

It is common sense that if a web site is down it cannot get spidered, but we’ll state it regardless:
When a site is down, it cannot get spidered.And when your domain’s designated DNS is down, your
site cannot get spidered either — even if your web server is up. Reliable hosting and DNS, then, is
critical to your web site’s well-being. A web site that is down will irritate users and result directly
in fewer users visiting your web site. It may also reflect badly on your business, and users may not
be back. Likewise, if a search engine spider visits your web site and it does not respond after quite
a few unsuccessful attempts, it may result in your web site getting dropped from the index. For
this reason we recommend cutting costs elsewhere.

Most of the time, users opt to use a web hosting provider’s DNS. This may be wise, because they may
need to alter DNS records in order to move you to another server with another IP if the server your
web site is located on fails. However, domain providers (Network Solutions, GoDaddy, and so on)
have more recently begun to offer free managed DNS services as well. If you use managed DNS,
the hosting provider will not be able to change your domain’s records to reflect the new IP, and
your site will be down as a result. For this reason, we do not recommend using managed DNS
unless your provider is aware of it, and knows to notify you, so that you can change the records
yourself to reflect the new IP.

Hosting Providers

Should the need exist to change hosting providers, the process must be completed in the proper order.
Not doing so may result in a time window where your site is unreachable; and this is clearly not desirable,
from both a general and SEO perspective. The focus of this elaborate process is to prevent both users and
search engines from perceiving that the site is gone — or in the case of virtual hosting, possibly seeing the
wrong site.
Virtual hosting means that more than one web site is hosted on one IP. This is commonplace,
because the world would run out of IPs very quickly if every web site had its own IP. The problem
arises when you cancel service at your old web hosting provider and a spider still thinks your site
is located at the old IP. In this case, it may see the wrong site or get a 404 error; and as you suspect,
this is not desirable.
The proper approach involves having your site hosted at both hosting providers for a little while. When
your site is 100% functional at the new hosting provider, DNS records should then be updated.

Functionality was also used to set up the seophp.example.comdomain. On Windows machines,
the file is located in C:\WINDOWS\system32\drivers\etc\hosts.
Add the following lines:
xxx.xxx.xxx.xxx www.yourdomain.com
xxx.xxx.xxx.xxx yourdomain.com
This will let you access your web site at the new provider as if the DNS changes were already reflected.
Simply remove the lines after you are done setting up the site on the new web hosting provider’s server
to verify the changes have actually propagated.
If you have concerns about this procedure, or you need help, you may want to contact your new hosting
provider and ask for assistance. Explain your concerns, and hopefully they will be able to accommodate
you and put your mind at ease. If they are willing to work with you, it is a good indication that they are
a good hosting provider.

MSN Search has a useful feature that allows you to see all virtual hosts on one IP by the syntax of
IP:xxx.xxx.xxx.xxx. Multiple statements can be separated by ORto request a list of a range of IPs.
This lets you see who else is hosting in a range. Spam tends to travel in packs. Search engine algorithms are also aware of this. The fact that the operator exists may be a tacit admission by Microsoft
that it does examine the sites in an IP range for some reason.

what is CodeIgniter Helpers?

Helpers, as their name implies, help you with specific tasks. Unlike libraries, helpers are not object -oriented but procedural in nature. Each helper contains one or more functions, each focusing on a
specific task, with zero dependence on other functions.

Helpers can either be loaded locally or autoloaded in /system/application/config/autoload.php.

CodeIgniter's  helpers:

Array —  The   Array helpercontains functions that help you work with arrays. For example, the
random_element()function takes an array as input and returns a random element from it.

Cookie —  The   Cookie helpercontains functions that help you set, read, and delete cookie data.

Date —  The   Date helpercontains functions that help you work with dates. For example, the
now function returns the current time as a UNIX time stamp.

Directory —  The   Directory helpercontains a single function that helps you work with directories.
For example, the directory_mapfunction reads a specified directory path and builds an array
of it that contains all of its files and subdirectories.


Download —  The   Download helpercontains a single function that helps you download data
easily. The force_download()function generates server headers that force data to be
downloaded instead of viewed in a browser.

File —  The   File helpercontains functions that help you read, write, and delete files.

Form —  The   Form helpercontains functions that help you build forms. It is probably one of the
most used helpers in the CodeIgniter toolbox.

HTML —  The   HTML helpercontains functions that help you create HTML blocks quickly and
easily. For example, the ul()function can turn an array of items into a bulleted list.

Inflector —  The   Inflector helpercontains functions that help you to turn words into plural or
singular form, to apply camel case, or to turn words separated by spaces into an underscored
phrase.

Security —  The   Security helpercontains security - related functions like xss_clean(),  which
filters out any code that may be used in a cross site scripting hack.

Smiley —  The   Smiley helpercontains functions that help you manage emoticons. The functions
in this helper might seem superfluous, but become invaluable if you are coding a bulletin board
or chat application.

String —  The   String helpercontains functions that help you work with strings, like the random_
string  function, which as its name implies, creates random strings based on type and length
arguments.

Text —  The   Text helpercontains functions that help you work with text. For example, the word_
limiter function can limit a string to a certain number of words, which is useful if you ’ re
trying to limit user input on a form.

Typography —  The   Typography helpercontains a single function that helps you format text in
appropriate ways. For example, the auto_typography()function wraps paragraphs with < p >
and < /p > , converts line breaks to < br/ > , and converts quotes, dashes, and ellipses properly.

PHP, you can use the substr()function instead of the word_limiter or character_limiter
made available by the Text helper. Certainly, you ’ re not forced to use helpers, but they ’ re made available
to you, and they do a fine job of saving time and effort.


Codeigniter Database Library

The  Database librarycontains a series of helpful functions that make it easy for you to create and run
queries and process the result sets from those queries.

The first thing to note about the Database library in CodeIgniter is that it allows you to pass in simple
SQL queries. At the end of the day, many people who are new to CodeIgniter find this to be a great
comfort. Although some of the built - in Active Record patterns provide helpful shortcuts, just knowing
that you can bypass all of that and send in a complex query.

$sql = “select a.name, a.id, b.groupname
from persons a, groups b
where a.group_id = b.id
group by b.groupname, a.name”;
$Q = $this- > db- > query($sql); 

To loop over the result set of that query, you can use either the result()or result_array() methods,
depending on whether you like to process your results as an object or as an array.

$sql = “select a.name, a.id, b.groupname
from persons a, groups b
where a.group_id = b.id
group by b.groupname, a.name”;
$Q = $this- > db- > query($sql);
foreach ($Q- > result() as $row){
echo $row- > name;
echo $row- > id;
echo $row- > groupname;
}
//here’s the alternative approach, with result_array
foreach ($Q- > result_array() as $row){
echo $row[‘name’];
echo $row[‘id’];
echo $row[‘groupname’];
}

If you need a count of rows in a result set, use the num_rows() method:
$sql = “select a.name, a.id, b.groupname
from persons a, groups b
where a.group_id = b.id
group by b.groupname, a.name”;
$Q = $this- > db- > query($sql);
if ($Q- > num_rows()){
foreach ($Q- > result() as $row){
echo $row- > name;
echo $row- > id;
echo $row- > groupname;
}
}
Sometimes you may have a query that generates just one result row.

codeigniter routes page

The  routes.php filelets you remap URI requests to specific controller functions. For example, you may
have a controller named sitewith a function named index. The URI for this controller/function
combination might be:
http://www.example.com/site/index
Furthermore, if your site controller had a pagesfunction that accepted a numeric ID for database
lookup, the URI might look like this:
http://www.example.com/site/pages/4
In some cases, you might want to remap one or more of these default routes. For example, the second
example might be better displayed as this:
http://www.example.com/about_us/
In that case, your routes.php file would contain a rule like this:
$route[‘about_us’] = “site/pages/4”;
For right now, though, this kind of manipulation falls under “ advanced  usage, ”  so  don ’ t  worry  too  much
about it. However, please do note that this kind of thing is possible. Also, be aware that two “ reserved
routes ” exist: default_controller and scaffolding_trigger.
$route[‘default_controller’] = “welcome”;
The default_controller route tells CodeIgniter which controller should be loaded if no controller is
identified. For simplicity ’ s sake, keep this setting.

CodeIgniter Libraries

CodeIgniter libraries help you do your job faster and more efficiently. Each libraryis really a PHP class
with various methods that you can use once the library is loaded by a controller.

CodeIgniter gives  the following libraries:
Benchmarking —  The   Benchmarking libraryis always active. Use it to determine the time
difference between any two marked points in code and to calculate memory usage.

Calendaring —  The   Calendaring librarymust be loaded by a controller. Use it to dynamically
create calendars for given months and years, with some control over formatting and appearance.

Config —  The   Config libraryis initialized automatically by the system. Use it to retrieve
configuration information.

Database —  The   Database libraryis a very powerful set of methods that must be loaded. You ’ ll
be using this library so much that the next subsection of this chapter focuses on it exclusively.

Email —  The   Email librarymust be loaded. It includes a very powerful set of tools that simplifies
the job of sending e - mails.

Encryption —  The   Encryption librarymust be loaded. It provides you with powerful two - way
encryption methods.

File Uploading —  The   File Uploading librarymust be loaded. Use this library whenever you need
to handle file uploads. It includes powerful validation features that can restrict a file by mime
type, size in kilobytes, or even image dimensions.

FTP —  The   FTP librarymust be loaded. Use this library to transfer files to a remote server only
standard FTP is supported, by the way.

HTML Table —  The   HTML Table librarymust be loaded. Use this very versatile library to
autogenerate HTML tables from arrays or database result sets.

Image Manipulation —  The   Image Manipulation librarymust be loaded. Use it to resize images,
create thumbnails, crop or rotate images, and watermark images. Some functions require further
PHP support such as GD/GD2.

Input and Security —  The   Input and Security librarymust be loaded. Use it to pre - process  input
data from forms and URLs and to handle some security functions such as guarding against
XSS attacks.

Language —  The   Language librarymust be loaded. Use this library to load different sets of
language files for internationalization.

Loader —  The   Loader libraryis automatically loaded. You will use this library primarily to load
views with your controller, but it is also used to load libraries.

Output —  The   Output libraryis automatically loaded. This library has one main function: Send
the finalized web page to the requesting browser. It is also used for caching.

Pagination — The  Pagination librarymust be loaded. Use this labor - saving library to paginate
database results for performance and usability. You can control how many records to display per
page, how many records to pull from the database, and the look and feel of different parts of the
pagination.

Session —  The   Session librarymust be loaded. Use CodeIgniter ’ s Session library to maintain
state information about a user. This library does not use PHP ’ s  built - in  sessions  —  instead,  it
generates its own session data. Because this library is so important, a separate subsection of this
chapter is devoted to it.

Android with Nexus 5 and Nexus 7 rooted

The Developer Preview for Android L has only been announced a couple of days ago,
 and yesterday it became available for developers to download and play with. So far Google has posted factory images just for the LG Nexus 5 smartphone and the Asus Nexus 7 2013 tablet in its Wi-Fi-only iteration.

And today both of those have been rooted by the enterprising Android tinkerers out there. So if you own either the Nexus 5 or Nexus 7 and have the Android L Developer Preview loaded on your device but wish you'd also have root access - this is for you. According to well known Android developer Chainfire,
 only a few very easy changes are required to his SuperSU flashable zip in order to make it
compatible with Android L.

 Thankfully, the folks over at The Android Soul quickly jumped in and made the necessary adjustments, and even verified that the brand new SuperSU zip they provide does work just fine on the latest version of the OS. To install SuperSU, you first need to have a custom recovery. Don't worry though, for that's an easy thing to get, as is acquiring root afterwards.

Job at Puduvai Bharthiar Grama Bank

Puduvai Bharathiar Grama Bank
Puduvai Bharathiar Grama Bank  invites applications from Indian citizens, for the post of Officer in Middle Management Grade (Scale II), Officer in Junior Management Grade (Scale I) and Office Assistant (Multipurpose) from Indian citizens who have appeared at the Common Written Examination for RRBs conducted by IBPS in September / October  2013 and declared qualified.:

  • Officer Scale-I : 08 posts, Pay Scale : Rs.14500-25700
  • Office Assistant (Multipurpose)  : 05 posts, Pay Scale : Rs.7200-19300
Application fee  : Rs.100/- (Rs.20/- for SC/ST/PWD/Ex-Serviceman) to be paid through CBS at any of the Branches of Puduvai Bharathiar Grama Bank by means of a Payment challan  or by National Electronic Funds Transfer NEFT.

How to Apply : Apply Online at Deccan Gramin Bank website only from 26/06/2014 to 11/07/2014.

View Details:http://www.puduvaibharathiargramabank.in:81/career.php


Job at Aligarh Muslim University

Applications on the prescribed form are invited for the following posts in Aligarh Muslim University  AMU :

  1. Associate  Professor  : 02 posts, Pay Scale :  Rs. 37400-67000 AGP    Rs. 9000 
  2. Assistant  Professor  : 05 posts, Pay Scale : Rs. 15600-39100  AGP Rs. 6000
  3. Sr. Principal Assistant : 05 posts
  4. Stenographers : 04 posts
  5. Calligraphist : 01 post
  6. Drivers : 17 posts
How to Apply : Apply in the prescribed format may either be delivered personally at the Reception Counter of Administrative Block or sent by post, super scribing on the top left of the cover the post applied for, advertisement number and date, to the Assistant Registrar, (Selection Committee), Aligarh Muslim University (AMU), Aligarh-202002 (UP), so as to reach him by 07/07/2014.
View details: http://www.amuregistrar.com/ads/2_2014.txt

PHP-MySQL application Security

With these two methods, there’s no longer any need to ever use GET for requests internal to an application.
You may still need it for external requests, to other applications and web sites that aren’t coded to look for their
parameters as POST data, but you can’t do anything about them.
Of course, I also should mention that there’s not much security in POST unless you’re also using SSL
Hash the passwords with Phpass.
Store the hashed passwords in the database, protected to the extent possible.   
Use 2FA.Prevent SQL injection with parameterized queries.   
Prevent XSS by escaping all user-originated output.    
Prevent CSRF with a csrftoken. 

Prevent clickjacking with an  
X-Frame-Optionsheader.
Use POST rather than GET.

Use SSL.

 Submitting Requests with POST

Submitting requests with POST instead of GET makes it just a bit harder
 for an attacker to break in, since JavaScript has to be used and easy tricks like
 coding a request in an image srcattribute won’t work. POST also prevents data like
a csrftoken from accidentally getting e-mailed or posted on a social site.

The only requests that should use GET are those that don’t do anything
 other than to display a page. Indeed, RFC 2612, the official specification for HTTP,
 says “the convention has been established that the GET and HEAD methods
SHOULD NOT have the significance of taking an action other than retrieval.
  It’s not disallowed, just discouraged. But you should act like it’s disallowed.
   

Manage Databases on a Server by php

MySQL-related functions.

  • mysql_list_dbs() Used to list the databases on a MySQL server.
  • mysql_num_rows() Returns the number of rows in a result set.
  • mysql_tablename() Despite its name, can extract the name of a table or a database from a result.
The goal of this script is to list all the databases on the local MySQL server.
  1. Open a new file in your text editor and start a PHP block:
    <?
    
  2. Create a variable to hold the result of the mysql_connect() function. Include the @ to suppress warnings, as well as the die() function to cause the script to end and a message to display if the connection fails:
    $connection = @mysql_connect("localhost", "spike", "9sj7En4")
    or die(mysql_error());
    
    
  3. Create a variable to hold the result of the mysql_list_dbs() function. Include the @ to suppress warnings, as well as the die() function to cause the script to end and a message to display if the script can't get the list:
    $dbs = @mysql_list_dbs($connection) or die(mysql_error());
     
    The only argument necessary for the mysql_list_dbs() function is the link identifier for the current connection.

    1. You'll be looping through a result and dynamically populating a bullet list. Start that bullet list outside the loop:
      $db_list = "<ul>";
      
    2. Start a counter. You'll need it for your loop:
      $i = 0;
      
    3. Begin a while loop. This loop will continue for as long as the value of $i is less than the number of rows in the $dbs result value:
      while ($i < mysql_num_rows($dbs)) {
      
    4. Once you're within the while loop, get the name of the database reflected in the current row of the result:
      $db_names[$i] = mysql_tablename($dbs, $i); 
       
      1. The variable $i is replaced by its value, so during the first loop this line would be something like $db_names[0] = mysql_tablename($dbs, 0);
        Counting starts at 0, not 1, so this would reflect the first row in the result. As the counter increments, so does the row number.
      2. Add the current database name to the bullet list:
        $db_list .= "<li>$db_names[$i]";
        
      3. Increment your count before you close the while loop:
        $i++;
        
        
      4. Close the while loop, the bullet list, and your PHP block:
        }
        $db_list .= "</ul>";
        ?>