Tuesday, 18 February 2014

How to add assets in CodeIgniter

When you are creating a Web Application with CI, you work with assets

you can create a "assets" folder in the root folder

To activate it

Step 1: Create Application Helper

application/helpers/utility_helper.php
function asset_url(){
   return base_url().'assets/';
}

Step 2: application/config/autoload.php:
$autoload['helper'] = array('url','utility');

After this you can very well use asset_url(); with in your application
 Ref

How to remove index.php from url in code igniter

Create a .htaccess file in root directory and

Copy paste this code
RewriteEngine on

RewriteCond $1 !^(index\.php|assets|robots\.txt)

RewriteRule ^(.*)$ index.php/$1 [L]
where assets is the folder in the root directly containing all your assets Ref

Wednesday, 31 July 2013

What is SQL Injection and How to avoid it?

SQL injection happens if the user input is not properly validated

This is just to play around with the database queries


To Avoid SQL Injection


  • Encrypt sensitive data.
  • Access the database using an account with the least privileges necessary.
  • Install the database using an account with the least privileges necessary.
  • Ensure that data is valid.
  • Do a code review to check for the possibility of second-order attacks.
  • Use parameterised queries.
  • Use stored procedures.
  • Re-validate data in stored procedures.
  • Ensure that error messages give nothing away about the internal architecture of the application or the database.



Difference between PHP4 and PHP5



Advantages of PHP5

Static Methods and Variables

Visitbility
Public , Private and Protected

Abstract Classes

Interfaces

Magic Methods

Final Keyword

__autoload Function

Type Hinting

Exceptions



Ref: http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html

Friday, 14 June 2013

How to check which wordpress theme or plugin is installed

Many a times you want to check which theme is installed on a wordpress site then you can surely use this tool to which theme is installed on that http://whatwpthemeisthat.com/
http://whatwpthemeisthat.com/
It also show installed plugins as well