Sunday, August 28, 2011

Create template in wordpress

We can create like this

Put the comment in new php file and save it in wordpress theme folder, then new template is created with below name "MyFirstTemplate"

/*
Template Name: MyFirstTemplate

*/

Change Wordpress Theme Name

We can change it in style.css of that them folder

Facebook login button not displaying in IE

We have to use facebook html tags at the document starting, we can see the button if we use the facebook html tag (those tags will be 2 lines)


Php session is not storing

Open the php.ini file and set the session path. Generally we have to give the temporary directory.

For Example In Windows:

C:\DOCUME~1\Admin\LOCALS~1\Temp ..............like this. In this folder session is saved in a file with random name (The data will be in serilize format)

Monday, April 18, 2011

search keywords from static files

$content = file_get_contents('filename.extension'); //Example file_get_contents('filename.hml');

Here $key is the search word //Example $key = "php";

if(preg_match("/".$key."/", $content, $matches))
echo "found";
else
echo "not found";

open source cms in php

CMS - Content Management System
1)joomla
2)drupal
3)wordpress
4)magento
4)oscommerce
5)zencart
6)phpbb(forum)
7)concrete
8)pligg
9)sugarcrm(crm)

internal server error in php

This error is most common while using htaccess if htaccess is not enable in localhost we will get this error.

We can solve this error by enable the Htaccess


Open AppSer installed folder in that find conf folder and find httpd.conf file. In that file find below line(LoadModule rewrite_module modules/mod_rewrite.so)

For Example In Windows: D:\AppServ\Apache2.2\conf\

"LoadModule rewrite_module modules/mod_rewrite.so" if hash is there before the line remove that hash("#") and save the file and restart the AppServer to work

for remaining servers also same procedure i.e have to find the httpd.conf file and have to remove the starting # from the mod_rewrite line and restart the server

svn in php

The concept is to save the previous files that what we had modified. The most common tool used for this one is tortoise.

you can download it from below link

http://websvn.tigris.org/servlets/ProjectDocumentList


and you can get some useful information

http://lifehacker.com/#!192367/hack-attack-using-subversion-with-tortoisesvn


http://www.openkore.com/index.php/TortoiseSVN_Guide

networking freelance projects

you can found in

http://www.ifreelance.com/Freelancers/Freelance-Network-Administrators/


http://www.freelanceindia.com/Employer/Networking_Hardware_Telephone_Systems/

component generator joomla site

It will provide the basic component structure

http://www.notwebdesign.com/joomla-component-creator/index.php

php security issues

http://php-security.org/2010/05/01/article-php-web-security/

http://www.smashingmagazine.com/2010/01/14/web-security-primer-are-you-part-of-the-problem/

themes constant in wordpress

define('THEME_PATH', ABSPATH."/wp-content/themes");

turn off errors in php

ini_set('display_errors', false);

get url of wordpress site

<?php echo get_option('siteurl'); ?>

It prints the site url from wp_options table

concat fields in mysql

SELECT CONCAT('field1', 'field2', 'field3');

It returns the concatnated string followed by field1.field2.field3 rows

Monday, February 14, 2011

how to get projects online

we can use the number freelancer sites, some are paid and some are free to register.

After register we have to search for projects based on our qualifications and have to bid on the project with some cover letter. If client likes our profile then the person call for an interview

Some freelancer sites are

http://www.odesk.com/ (free to register, i had worked on it, it is good one)

www.freelancer.com

www.guru.com

www.elance.com

www.getacoder.com

many more are there.... search in google for freelance sites

The above sites are to get offshore projects. Many people there that they need websites and some projects, but they have less idea about how to approach for a particular project, we have to found those people and we have to ..........

what is seo

Follow the below links

http://en.wikipedia.org/wiki/Search_engine_optimization

http://www.webconfs.com/seo-tutorial/introduction-to-seo.php

Php frameworks

Zend , Codeigniter, Symfony, Kohana, Cakephp, Yii

Some more are there

Saturday, February 12, 2011

concrete5 cms block creation error

One common error is(block installed successfully but while adding in frontend we will get an error). when we are using controller name with Two words eg:TestCoin(controller name) then we have to give our block name and folder names like this (test_coin). It has solved my problem.

public static void main string args in java

public: This method is public because it is accessible to JVM, for execution.

static: main method is called with out creating an object for the class

void: main method doesn't return any value so we have to use void

String args: when user try to give input parameters from command prompt these arguments are handled by String args(Array)

Loading image using javascript

document.getElementById('divid').innerHTML = '<img src="imagepath" alt="Loading">';

How to use:

Before loading the content to div we have to use the above code with same divid

After that load your content to same div using innerHTML. We can't identify this image in localhost because it is fastly switched to content but in server we can see this image

Saturday, January 29, 2011

disable form element using jquery

Using Id:

jQuery('#id').attr('disabled','disabled'); //Here id is form element id
//Enable the form element
jQuery('#id').removeAttr("disabled");

Using Name:

jQuery('input[name="elementname"]').attr('disabled','disabled'); //Here element name is form element name
//Enable the form element
jQuery('input[name="elementname"]').removeAttr('disabled');

Saturday, January 22, 2011

get the text box value using jquery

By using textboxid:
jQuery('#texboxid').val();

By using name:
jQuery('input[name="textboxname"]').val();

Saturday, January 15, 2011

PHP MySQL Interview Questions

http://booleandreams.wordpress.com/php-mysql-interview-question/

get second of the current time using date function in php

$second = date("s");

get number of days between two given dates using MySQL

SELECT DATEDIFF( "2007-03-07", "2007-03-01" )

Difference between include and require

require(): It will cause a fatal error and halt the execution of the script if the file not found.
include(): If the file not found a warning will be issued, but execution will continue.

get number of records count in mysql

SELECT COUNT('fieldname') AS numcount FROM tablename;
//Instead of using COUNT(*) it is good i think

AJAX full form

Asynchronous JavaScript and XML

find the current date using MySQL

SELECT now();
or
SELECT CURDATE();
or
SELECT CURRENT_DATE();

submit a form without submit button

document.formname.submit(); //It will work when we are using single form in a page

document.forms['formname'].submit(); //It will work when we are using multiple forms

// above formname is our formname

submit a form using javascript

document.formname.submit(); //It will work when we are using single form in a page

document.forms['formname'].submit(); //It will work when we are using multiple forms

// above formname is our formname

maximum length of a database name, table name, field name in MySQL

Database name: 64 characters
Table name: 64 characters
Column name: 64 characters