Sunday, November 23, 2014

How to set HttpOnly in Apache Web Server


Without having HttpOnly and Secure flag in HTTP response header, it is possible to steal or manipulate web application session and cookies. It’s good practice to set HttpOnly and Secure flag in application code by developers. However, due to bad programming or developers’ unawareness it comes to Web Infrastructures.

Implement in Apache:



For detail Click here

Sunday, November 16, 2014

Cross-Site Request Forgery(CSRF)

Cross-Site Request Forgery

Cross-Site Request Forgery, or CSRF for short is a common and regular online attack is. CSRF also goes by the acronym XSRF and the phrase “Sea-Surf”. CSRF attacks include a malicious exploit of a website in which a user will transmit malicious requests that the target website trusts without the user’s consent. In Cross-Site Scripting (XSS), the attacker exploits the trust a user has for a website, with CSRF on the other hand, the attacker exploits the trust a website has against a user’s browser.

A Simple Example of a Cross-Site Request Forgery

For Detail Click here

Web Application Security

Saturday, November 15, 2014

How to combat XSS using CodeIgniter?

What's XSS?

Cross Site Scripting (XSS) is the process of addition of malicious code to a genuine website to gather user’s information with a malicious intent. XSS attacks are possible through security vulnerabilities found in Web applications and are commonly exploited by injecting a client-side script. Although JavaScript is usually employed, some attackers also use VBScript, ActiveX or Flash.
Cross-site Scripting (also known as XSS or CSS) is generally believed to be one of the most common application layer hacking techniques.
For Detail Click here

Wednesday, November 12, 2014

How to remove SQL injection in Codeigniter?

In the web application security, SQL injections are placing a very important role. To prevent SQL injections in PHP , we usually use mysql_real_escape_string() function along with other techniques for mysql database.

In codeIgniter ,we no need to use mysql_real_escape_string() function, Codeigniter provides inbuilt functions and libraries to generate SQL queries by using those methods or functions we can avoid SQL injections.
There are three methods to prevent SQL injections in Codeigniter application, they are
1) Escaping Queries
2) Query Binding
3) Active Record Class

Removing SQL injection in Codeigniter using Escaping Query Method

Example:

<?

 $email= $this->input->post('email');
 $query = 'SELECT * FROM accounts WHERE user_name='.$this->db->escape($email);
 $this->db->query($query);

?>

Here $this->db->escape() determines the data type so that it can escape only string data.
It also automatically adds single quotes around the data so you don’t have to do that as well.

Removing SQL injection in Codeigniter using Query Binding Method

Example:

<?
    $sql = "SELECT * FROM accounts WHERE status = ? AND email= ?";
    $this->db->query($sql, array('active', 'info@primebank.com.bd '));
?>


The question marks in the query are automatically replaced with the values in the array in the second parameter of the query function.
in Query Binding Method, you don’t have to escape the values manually as it will automatically do that for you.


Removing SQL injection in Codeigniter using Active Record Class

Using Active Records, query syntax is generated by each database adapter. It also allows for safer queries, since the values are escaped automatically by the system.

Example:
<?
 $this->db->get_where('accounts',array('status' => 'active','email' => 'info@primebank.com.bd'));
?>

Tuesday, August 26, 2014

MS SQL Server Date Functions


Process Creating Oracle Linked Server SQL Instance:

  • Install Oracle 10g Release 2 client software (available from Oracle website)
  • Install Oracle 10g Release 2 ODAC software (available from Oracle website)
  • Restart SQL services
  • Configure OraOLEDB.Oracle provider
  • Create linked server
  • Add remote logins for linked server

Monday, August 25, 2014

10 tips on buying shares in

Businesses want to share? Before buying anything, then you will be on target. Market share in the experience of experts and business interest abroad raises some fundamental issues. However, these things all the time that may not give effective results. It is difficult to get the desired results, especially in the short term. However, in considering the issues can be found in the long-term good results.
1. Share price to income ratios (P / E) view. It is better to be less than 0. Pi ratio is as low as, the less investment risk. The price-earnings ratio of a company is a measure of its earnings kataguna prices. If a company's earnings per share is Rs 5, Rs 45 and the market price of the shares, the price-earnings ratio of 9. If all of its income is distributed as dividends to the company if it will take 9 years to get back the money invested. But if the market price of the shares was Rs 100, the price-earnings ratio or 0 Pi ratio stood. If the retained earnings of the Company during the year to 0 on return of investment.
II. Asset value per share (NAV) to see. Should be consistent with the market price of one. Although the company abasayana (abolition) of the asset price, the investor does not practically matter. Its share of the assets of the shareholders if the company can get abasayana. Regard to price to sell assets before the bank loans and other debt is paid.And if some of the remaining is divided between the shareholders.
3. Earnings per share (EPS) to see. It is likely to be higher as well. If you have the opportunity to give more dividends than EPS. If the dividend is less than EPS capabilities.
4. View the total number of shares. And what of her floating. According to the demand-supply its price rises are likely to be less than the number of shares. The number of shares in the market, it is much more readily available. Such sums are like regular transactions like buying shares. If for any reason because of the urgent need of money can easily collect the money by selling shares. But that is not regularly invest in shares if the transaction can not recall an urgent investment.
5. Authorized capital (authorized capital) and capital (paid-up capital) to see the ratio.This is closer to the amount of capital to issue bonus and rights shares is quite difficult.Will increase in the authorized capital of the company before. The investor should also have a special affinity bonus labhyanse to meet these issues.
6. Dividend ilda: stock market prices may be more than face value in most cases. So do not indicate the actual return rate of profitability. Ildai dividend shares Precise returns.Dividends receivable on the basis of the percent of the market value so the dividend Yield investments. Declared dividends multiplied by 100 divided by the market price of its shares, dividend Yield is available. Investors received a better chance at the higher Yield.
7. Check out the track record of the last 3-4 years. See what the dividend amount. See the annual average value. Please try to buy shares at a price close to this.
8. DSE news published on the site to see the last 5-6 months. Economy and business stories from newspapers abroad see. To identify the potential of the sector and the company will be much easier.
9. DSE is now 4 months after the company's earning report. Amount at the end of the year may be a little head khatalei it is possible to know.
10. You have to buy the shares of the Company's Good Will and managers of social and political will to take the fact into consideration. How much would a good business for a company, depending on the extent of the potential expansion of the business entrepreneurs prudent, efficiency and state needs. Do whatever will be incorporated as a not-for profit alike, would profit field is strongly conservative, did not take into consideration the interests of investors rely on them also.
Remember, it is not the time to sell, but rather to ensure that the purchase will always profit. Found the best prices for the shares of the profits will be more likely to buy. When the price falls over time, the possibility of buying a little, but will be reduced.

Tuesday, August 19, 2014

Friday, August 8, 2014

Split string into array using comma delimiter in PHP

You may use explode function.

PHP Code:

$str="Banana,Apple,Mango,Coconut";

$val= explode(',', $str);

var_dump($val);

Output:

array(4) { [0]=> string(6) "Banana" 
[1]=> string(5) "Apple"
[2]=> string(5) "Mango" 
[3]=> string(7) "Coconut" }

Thanks.
It will help you.

If you feel better please comments.