Blog Archives

How to get list of files included in PHP.??

Every time I write a peace of PHP code, to perform database activity or calculations, I’m curious about how many files are included, by framework (CodeIgniter,Yii, Zend etc.). My moto  is, just don’t want to include those files, which are

Posted in PHP

What is Difference between MySQL delete and truncate table

This very common question in interviews.  Both remove records from the table, so what is the difference. Delete :                      Syntax :  Delete from TableName [where condition]; Deletes record  from table

Posted in Mysql

Yii Tips and Tricks

While working on Project base on Yii framework, got some questions/problems. After searching couple of hours found solutions,So sharing here…., How can change default action of Yii controller? Ans:- Declare variable  ‘ public $defaultAction = ‘actioname’; ” in controller. e.g.:-  class LoginController

Tagged with:
Posted in PHP, Yii

URL rewriting in Yii to hide index.php

Hi Folks, I am using Yii -yes it is,  MVC framework for new project in PHP. I started  learning  yii from the official site of yii. I found it is hard to start the work on yii, specially who don’t have knowledge of

Tagged with: ,
Posted in .htaccess, Yii

Include php file On all the pages of php

I need to include a files in all of your site’s pages? Normally, you’d use require() or include(). But do I really want to manually past the include code in every page? This may be at the start of page or end of page. There’s the little

Posted in .htaccess, PHP

PHP security tips

NEVER trust user input User the following validation methods for input. <?php $username = mysql_real_escape_string($_POST[‘username’]); $password = mysql_real_escape_string($_POST[‘password’]); // Query database to check if there are any matching users $query = “SELECT * FROM users WHERE user=’$username’ AND   password=’$password’”; mysql_query($query);

Posted in Uncategorized

Joomla1.5 manually add admin user

Hi ,… When we work with joomla site… we should have the back end access.. i.e.  super-admin access. But we don’t have that…. may be client may forgot to give you or given wrong details… So need to create new one.. or just

Tagged with: ,
Posted in Joomla 1.5, PHP