Pages

Bài đăng phổ biến

Thursday, November 17, 2011

[Resolved] Warning: Cannot modify header information - headers already sent by

When you see this error, you just put this tiny code to begin your code:
Go Daddy $7.49 .com Sale!

 ob_start()           turn on  buffer
 ob_end_flush()   turn off buffer and print all to browser


Example:

<?php

ob_start(); 

echo "Check phat";
header("Location: redirect.php");
ob_end_flush(); 
?>
Nguyen Si Nhan

Cpanel: Export email account to file

1. Use an editor to create new file with below content set with name getAllEmail.awk:

#!/bin/awk -f
#
# File: getAllEmail.awk
#
# This awk script takes the input of ls -d /home/*/mail/*/*
# checks to see if the directory exists, then outputs the email address. My example
# outputs them to a text file called emailaddress.txt
#
# I wrote it to get all the email addresses out of my cpanel box.
# You are free to use this program for your own purposes. If you
# improve it, please let me know. If it is horribly flawed, please let me know.
#
# Author: Hans C. Kaspersetz
# Date: 10/27/2007
# Email: hans [at] cyberxdesigns [dot] com
#
# Usage on cpaneli cli> ls -d /home/*/mail/*/*/ | getAllEmail.awk > emailaddress.txt

BEGIN {
}
{
tcmd = "test -d " $1
if(!system(tcmd)){
split($1,MyArray,"/")
print MyArray[6] "@" MyArray[5]
}
}
 
 2. After that run below cmd with root privileges:

#ls -d /home/*/mail/*/*/ | awk -f getAllEmail.awk > emailaddress.txt
Finish.

Nguyen Si Nhan - Cpanel.net