Friday, July 20, 2012

Cannot modify header information - pluggable.php


Warning: Cannot modify header information - headers already sent by (output started at /homepages/9/d260170483/htdocs/pettraining/wordpress-2.8/wordpress/wp-content/themes/dog-lover/functions.php:6) in /homepages/9/d260170483/htdocs/pettraining/wordpress-2.8/wordpress/wp-includes/pluggable.php on line 865

If you find this problem in your site  look the page you lastly updated or  the page  on which you are using header location  function   .
After  finding the  page or template  you need to put the   code on top of page

<?php   Ob_start();  ?>

After placing the code at top  save the file  and your problem will be resolved . if have any other issue let me know  or check file  again .

How to use fck editor in php

First download the fck editor and ck finder and place them in your directory and  replace the path with your own path

ckeditor from here ---
http://ckeditor.com/download/

ckfinder from here ----
http://ckfinder.com/download/
 

basePath = 'http://localhost/test_new2/wp-content/themes/twentyeleven/ckeditor/';
CKFinder::SetupCKEditor($ckeditor, '/ckfinder/');
$ckeditor->editor('CKEditor1');
$FCKeditor->Width = '220px';
$FCKeditor->Height = '100px';
$ckeditor->ckeditor->config['toolbar'] = 'Full';
$ckeditor->ckeditor->config['language'] = 'en';
*/
?>

Tuesday, June 5, 2012

To Export Data In Excel Sheet From Sql Table

 <?php
if(isset($_REQUEST['spreadsheet']))
{
mysql_connect("localhost","root","");
mysql_select_db('sunsoft1_greeprivate');
$query="select * from table_name";

$res=mysql_query($query);

/* $DbConnection->Select("*","payment_student","","","");
$registredData = $DbConnection->GetRows(); */
//echo $registredData[0][name];
 function xlsBOF() {
    echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
    return;
}

function xlsEOF() {
    echo pack("ss", 0x0A, 0x00);
    return;
}

function xlsWriteNumber($Row, $Col, $Value) {
    echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
    echo pack("d", $Value);
    return;
}

function xlsWriteLabel($Row, $Col, $Value ) {
    $L = strlen($Value);
    echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
    echo $Value;
return;
}

$filename=time();
 

    // Send Header
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");;
    header("Content-Disposition: attachment;filename=".$filename.".xls");
    header("Content-Transfer-Encoding: binary ");

    // XLS Data Cell

                xlsBOF();
               // xlsWriteLabel(1,0,"Event :".$eventInfo['fldTitle']);
              //  xlsWriteLabel(2,0,"Registred Members");
                xlsWriteLabel(0,0,"booking_id");
                xlsWriteLabel(0,1,"pay_amount");
                xlsWriteLabel(0,2,"payment_date");
                xlsWriteLabel(0,3,"payer_email");
                xlsWriteLabel(0,4,"item_name");
              
              
                /*xlsWriteLabel(6,5,"Company Function");
                xlsWriteLabel(6,6,"Telephone");
                xlsWriteLabel(6,7,"Aum");
                xlsWriteLabel(6,8,"Registration Date");
                xlsWriteLabel(6,9,"Data Protection");*/
                $xlsRow = 1;
               // foreach($registredData as $record)
               while($record=mysql_fetch_array($res)){
            
                     ++$i;
        //if($record['protection']=="YES") { $protection="Yes";} else { $protection="No"; }
      
        xlsWriteLabel($xlsRow,0,$record[booking_id]);
        xlsWriteLabel($xlsRow,1,$record[pay_amount]);
        xlsWriteLabel($xlsRow,2,$record[payment_date]);
        xlsWriteLabel($xlsRow,3,$record[payer_email]);
        xlsWriteLabel($xlsRow,4,$record[item_name]);
      
        /*xlsWriteLabel($xlsRow,5,$record['companyfunction']);
        xlsWriteLabel($xlsRow,6,$record['telephone']);
        xlsWriteLabel($xlsRow,7,$record['aum']);
        xlsWriteLabel($xlsRow,8,date("M d Y",strtotime($record['dated'])));
        xlsWriteLabel($xlsRow,9,$protection);*/
                    $xlsRow++;
                    }
                     xlsEOF();
                 exit();


}


after that in the form you have to call the file

<form action="excel.php">
<input type="submit" name="submit">
</form>

?>

Friday, April 13, 2012

linux Commands

    alias - create names or abbreviations for commands
    apropos - search the manual page names and descriptions
    at [man page] - queue, examine or delete jobs for later execution

    bc [man page] - An arbitrary precision calculator language

    cal - displays a calendar
    cat [man page] - concatenate files and print on the standard output
    cd - change directory
    chgrp [man page] - change group ownership
    chmod [man page] - change file access permissions
    cksum [man page] - checksum and count the bytes in a file
    cp [man page] - copy files and directories
    csplit [man page] - split a file into sections determined by context lines

    date [man page] - print or set the system date and time
    dd [man page] - convert and copy a file
    du [man page] - estimate file space usage

    egrep [man page] - print lines matching a pattern
    export - set an environment variable

    fgrep [man page] - print lines matching a pattern
    find [man page] - search for files in a directory hierarchy
    fold [man page] - wrap each input line to fit in specified width

    grep [man page] - print lines matching a pattern
  
    head [man page] - output the first part of files

    join [man page] - join lines of two files on a common field

    logrotate [man page] - rotates, compresses, and mails system logs
    ls [man page] - list directory contents

    mkdir [man page] - make directories
    mv [man page] - move (rename) files
    mount [man page] - mount a file system

    nl [man page] - number lines of files

    od [man page] - dump files in octal and other formats

    pwd [man page] - print name of current/working directory

    rgrep [man page] - print lines matching a pattern
    rm [man page] - remove files or directories

    scp - secure copy (remote file copy program)
    ssh - OpenSSH SSH client (remote login program)

    tail [man page] - output the last part of files
    tar [man page] - The GNU version of the tar archiving utility
    tee [man page] - read from standard input and write to standard output and files
    time [man page] - run programs and summarize system resource usage
    touch [man page] - change file timestamps

    vim - Vi IMproved, a programmers text editor
  
    watch [man page] - execute a program periodically, showing output fullscreen
    wc [man page] - print newline, word, and byte counts for each file
    whoami [man page] - print effective userid

yes [man page] - output a string repeatedly until killed

To export you sql to excel file

" . mysql_error() . "
" . mysql_errno()); //select database $Db = @mysql_select_db($DB_DBName, $Connect) or die("Couldn't select database:
" . mysql_error(). "
" . mysql_errno()); //execute query $result = @mysql_query($sql,$Connect) or die("Couldn't execute query:
" . mysql_error(). "
" . mysql_errno()); while($row = mysql_fetch_assoc($result)) { //print_r($result); $data[]=array('ID'=>$row[ID],'First_name'=>$row[user_nicename],'Last_name'=>$row[display_name]); } //echo sizeof($data); $key=0; foreach($data as $id) { $sql1="SELECT * FROM wp_usermeta where user_id=".$id['ID']; //echo $sql1; $result1 = @mysql_query($sql1,$Connect); while($row1 = mysql_fetch_assoc($result1)) { $k=$row1[meta_key]; $v=$row1[meta_value]; $data[$key][$k]=$v; //$data[]=array('ID'=>$row1[ID]); } $key++; } /* echo"
";
    print_r($data);
    echo"
"; */ $field=array('League','First Name','Last Name','Gender','DOB','AHC No.','Address','Postal Code','Parent /Guardian One information Last Name','Parent /Guardian One information First Name','Parent /Guardian One Phone','Parent /Guardian One Email','Parent /Guardian Two information Last Name','Parent /Guardian Two Information First Name','Parent /Guardian Two Home','Parent /Guardian Two Email','Community ID','Medical Issues?','Post 1 Volunteer','Post 1 Name','Shirt Size','Post 2 Volunteer','Post 2 Name','Shirt Size','Who I'd like to Volunteer with First','Who I'd like to Volunteer with Last','How Registered'); if (isset($w) && ($w==1)) { $file_type = "msword"; $file_ending = "doc"; }else { $file_type = "vnd.ms-excel"; $file_ending = "xls"; } //header info for browser: determines file type ('.doc' or '.xls') header("Content-Type: application/$file_type"); header("Content-Disposition: attachment; filename=database_dump.$file_ending"); header("Pragma: no-cache"); header("Expires: 0"); if (isset($w) && ($w==1)) //check for $w again { $sep="\t"; $new="\n"; foreach($field as $attri) { echo $attri.$sep; } echo $new; $keys=0; foreach($data as $data_con){ /** 1.League***/ if($data_con['select7']) { echo $data_con['select7']; echo $sep; } else { echo $sep; } /** 2.First name***/ if($data_con['First_name']) { echo $data_con['First_name']; echo $sep; } else { echo $sep; } /** 3.Last name***/ if($data_con['Last_name']) { echo $data_con['Last_name']; echo $sep; } else { echo $sep; } /** 4.Gender***/ if($data_con['radiobutton_Gender']) { echo $data_con['radiobutton_Gender']; echo $sep; } else { echo $sep; } /** 5.DOB***/ if($data_con['dob3']) { echo $data_con['dob1'].'-'.$data_con['dob2'].'-'.$data_con['dob3']; echo $sep; } else { echo $sep; } /** 6.AHC No.***/ if($data_con['Community']) { echo $data_con['Community']; echo $sep; } else { echo $sep; } /** 7.Address ***/ if($data_con['uadd']) { echo $data_con['uadd']; echo $sep; } else { echo $sep; } /** 8.Postal Code ***/ if($data_con['pcode']) { echo $data_con['pcode']; echo $sep; } else { echo $sep; } /** 9.Parent /Guardian One information Last Name ***/ if($data_con['g1_lname']) { echo $data_con['g1_lname']; echo $sep; } else { echo $sep; } /** 10.Parent /Guardian One information First Name ***/ if($data_con['g1_fname']) { echo $data_con['g1_fname']; echo $sep; } else { echo $sep; } /** 11.Parent /Guardian One Phone ***/ if($data_con['g1_ph']) { echo $data_con['g1_ph']; echo $sep; } else { echo $sep; } /** 12.Parent /Guardian One Email ***/ if($data_con['g1_email']) { echo $data_con['g1_email']; echo $sep; } else { echo $sep; } /** 13.Parent /Guardian Two information Last Name ***/ if($data_con['g2_lname']) { echo $data_con['g2_lname']; echo $sep; } else { echo $sep; } /** 14.Parent /Guardian Two Information First Name ***/ if($data_con['g2_fname']) { echo $data_con['g2_fname']; echo $sep; } else { echo $sep; } /** 15.Parent /Guardian Two Phone ***/ if($data_con['g2_ph']) { echo $data_con['g2_ph']; echo $sep; } else { echo $sep; } /** 16.Parent /Guardian Two Email ***/ if($data_con['g2_email']) { echo $data_con['g2_email']; echo $sep; } else { echo $sep; } /** 17.Community ID ***/ if($data_con['Community']) { echo $data_con['Community']; echo $sep; } else { echo $sep; } /** 18.Medical Issues? ***/ if($data_con['HealthCare']) { echo $data_con['HealthCare']; echo $sep; } else { echo $sep; } /** 19.Post 1 Volunteer ***/ if($data_con['Volunteer_position1']) { echo $data_con['Volunteer_position1']; echo $sep; } else { echo $sep; } /** 20.Post 1 Name ***/ if($data_con['Volunteer_name1']) { echo $data_con['Volunteer_name1']; echo $sep; } else { echo $sep; } /** 21.Shirt Size ***/ if($data_con['Shirt_size1']) { echo $data_con['Shirt_size1']; echo $sep; } else { echo $sep; } /** 22.Post 2 Volunteer ***/ if($data_con['Volunteer_position2']) { echo $data_con['Volunteer_position2']; echo $sep; } else { echo $sep; } /** 23.Post 2 Name ***/ if($data_con['Volunteer_name2']) { echo $data_con['Volunteer_name2']; echo $sep; } else { echo $sep; } /** 24.Shirt Size ***/ if($data_con['Shirt_size2']) { echo $data_con['Shirt_size2']; echo $sep; } else { echo $sep; } /** 25.Who I'd like to Volunteer with First ***/ if($data_con['volunteerwithfname']) { echo $data_con['volunteerwithfname']; echo $sep; } else { echo $sep; } /** 26.Who I'd like to Volunteer with Last ***/ if($data_con['volunteerwithlname']) { echo $data_con['volunteerwithlname']; echo $sep; } else { echo $sep; } /** 27.How Registered ***/ if($data_con['Fees']) { echo $data_con['Fees']; echo $sep; } else { echo $sep; } echo $new; } }else{ $sep="\t"; $new="\n"; foreach($field as $attri) { echo $attri.$sep; } echo $new; $keys=0; foreach($data as $data_con){ /** 1.League***/ if($data_con['select7']) { echo $data_con['select7']; echo $sep; } else { echo $sep; } /** 2.First name***/ if($data_con['First_name']) { echo $data_con['First_name']; echo $sep; } else { echo $sep; } /** 3.Last name***/ if($data_con['Last_name']) { echo $data_con['Last_name']; echo $sep; } else { echo $sep; } /** 4.Gender***/ if($data_con['radiobutton_Gender']) { echo $data_con['radiobutton_Gender']; echo $sep; } else { echo $sep; } /** 5.DOB***/ if($data_con['dob3']) { echo $data_con['dob1'].'-'.$data_con['dob2'].'-'.$data_con['dob3']; echo $sep; } else { echo $sep; } /** 6.AHC No.***/ if($data_con['Community']) { echo $data_con['Community']; echo $sep; } else { echo $sep; } /** 7.Address ***/ if($data_con['uadd']) { echo $data_con['uadd']; echo $sep; } else { echo $sep; } /** 8.Postal Code ***/ if($data_con['pcode']) { echo $data_con['pcode']; echo $sep; } else { echo $sep; } /** 9.Parent /Guardian One information Last Name ***/ if($data_con['g1_lname']) { echo $data_con['g1_lname']; echo $sep; } else { echo $sep; } /** 10.Parent /Guardian One information First Name ***/ if($data_con['g1_fname']) { echo $data_con['g1_fname']; echo $sep; } else { echo $sep; } /** 11.Parent /Guardian One Phone ***/ if($data_con['g1_ph']) { echo $data_con['g1_ph']; echo $sep; } else { echo $sep; } /** 12.Parent /Guardian One Email ***/ if($data_con['g1_email']) { echo $data_con['g1_email']; echo $sep; } else { echo $sep; } /** 13.Parent /Guardian Two information Last Name ***/ if($data_con['g2_lname']) { echo $data_con['g2_lname']; echo $sep; } else { echo $sep; } /** 14.Parent /Guardian Two Information First Name ***/ if($data_con['g2_fname']) { echo $data_con['g2_fname']; echo $sep; } else { echo $sep; } /** 15.Parent /Guardian Two Phone ***/ if($data_con['g2_ph']) { echo $data_con['g2_ph']; echo $sep; } else { echo $sep; } /** 16.Parent /Guardian Two Email ***/ if($data_con['g2_email']) { echo $data_con['g2_email']; echo $sep; } else { echo $sep; } /** 17.Community ID ***/ if($data_con['Community']) { echo $data_con['Community']; echo $sep; } else { echo $sep; } /** 18.Medical Issues? ***/ if($data_con['HealthCare']) { echo $data_con['HealthCare']; echo $sep; } else { echo $sep; } /** 19.Post 1 Volunteer ***/ if($data_con['Volunteer_position1']) { echo $data_con['Volunteer_position1']; echo $sep; } else { echo $sep; } /** 20.Post 1 Name ***/ if($data_con['Volunteer_name1']) { echo $data_con['Volunteer_name1']; echo $sep; } else { echo $sep; } /** 21.Shirt Size ***/ if($data_con['Shirt_size1']) { echo $data_con['Shirt_size1']; echo $sep; } else { echo $sep; } /** 22.Post 2 Volunteer ***/ if($data_con['Volunteer_position2']) { echo $data_con['Volunteer_position2']; echo $sep; } else { echo $sep; } /** 23.Post 2 Name ***/ if($data_con['Volunteer_name2']) { echo $data_con['Volunteer_name2']; echo $sep; } else { echo $sep; } /** 24.Shirt Size ***/ if($data_con['Shirt_size2']) { echo $data_con['Shirt_size2']; echo $sep; } else { echo $sep; } /** 25.Who I'd like to Volunteer with First ***/ if($data_con['volunteerwithfname']) { echo $data_con['volunteerwithfname']; echo $sep; } else { echo $sep; } /** 26.Who I'd like to Volunteer with Last ***/ if($data_con['volunteerwithlname']) { echo $data_con['volunteerwithlname']; echo $sep; } else { echo $sep; } /** 27.How Registered ***/ if($data_con['Fees']) { echo $data_con['Fees']; echo $sep; } else { echo $sep; } echo $new; } } ?>

Wednesday, April 4, 2012

adding-one-post-in-multiple-blog



You can add your one post to your multiple blog .

 For this there is one site providing this facilities.
Site: --    ping.fm
Create an account on this. Select the network you want to add eg presently using blogspot.com 

then check  the field in posting  option .