but i am still facing problem to retrive current date ( which is after '19-jan-2038') by datetime function. my code is as follows:

<?php 
$date= new datetime();
echo $date->format('d-m-Y');
?>

diafol sir plz give any solution

dear friends i got maximum solution from DateTime() function here is some helpful links
1.Click Here
2.Click Here
3.Click Here
4.Click Here

dear friends

    m using strtotime () function to compare two dates , but it is not working for the date greater then '19-jan-2038'.my os is win 7 32 bit and php 5.2 and apache 2.2.plz if any body having any solution , kindly share it

dear friend i want to insert a row in orecal which is

insert into employee ('AMIT D'SOZA', 'MANAGER','500')

thorugth php
but there is problem to insert data like 'AMIT D'SOZA'
so i want to restrict "'" (singal quets ) to enter in text fields
plz help me if you have any other solution then plz shere it

i have tryed thr folloing code:-

$handle = printer_open();
printer_start_doc($handle);
printer_start_page($handle);

printer_create_dc($handle);
/* do some stuff with the dc */
/*printer_set_option($handle, PRINTER_TEXT_COLOR, "333333");
printer_draw_text($handle, 1, 1, "text");
printer_delete_dc($handle);

/* create another dc */
/*printer_create_dc($handle);
printer_set_option($handle, PRINTER_TEXT_COLOR, "000000");
printer_draw_text($handle, 1, 1, "text");*/
/* do some stuff with the dc */

/*printer_delete_dc($handle);

printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);*/

it's shows error undefine function printer_open() in line 1.

i have create the report.txt on serverside, now i want to print that file on client side , without open for user (to avoid alteration/ammenent in original report) i.e send that file to local printer.

plz send the sampal code in php for it

i have tried

<input type="button" value="Print this page" onclick="printpage()">

but it shows no output
and when i use

<img src="printer.png" width="28" height="28" onclick="window.print()" />

its open printer diup box, if is good for laser printer/color printer, but it cteate problem for DMP printer i want solution for DMP printer

i want help to resolve this problem. kindly some body help me

the close lines are
LoadModule php5_module "C:/Program Files/php/php5apache2_4.dll"
LoadFile "C:/php/php5ts.dll"
configure the path to php.ini
PHPIniDir "C:/php"

create a file named info.php
saved it in location :-

"C:\Program Files\Apache Software Foundation\Apache2.4\htdocs\"
now i call this file bye localhost/info.php :-> output is its asking to save/open the file.
to resolve it i have added following lines at the end of httpd.config

LoadModule php5_module "C:/Program Files/php/php5apache2_4.dll"

LoadFile "C:/php/php5ts.dll"

LoadFile "C:/Program Files/php/php5.dll"

AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3
<FilesMatch .php$>

 SetHandler application/x-httpd-php

</FilesMatch>

configure the path to php.ini

PHPIniDir "C:/php"

then restart the pc ,but its give same output.
one more thing i want to say that if i open any lines (mantion above) leaded by #. the apache server will not restart. i want help to resolve this problem. kindly some body help me

i have download php 5.3.27 windows installer from php.net
then i download apache 2.4.4 windows installer from apache site.
now i have successfuly installed apache 2.4.4. to check this i have writehttp://localhost/ on the address bar and the out put is "its work".
now the step to install php 5.3.27
now i restart my pc.

i have cheked the sql query, it giving correct out put, now wht to do

currently m useing following code

<?php

$tcpdf_include_dirs = array(realpath('tcpdf.php'), '/usr/share/php/tcpdf/tcpdf.php', '/usr/share/tcpdf/tcpdf.php', '/usr/share/php-tcpdf/tcpdf.php', '/var/www/tcpdf/tcpdf.php', '/var/www/html/tcpdf/tcpdf.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf.php');
foreach ($tcpdf_include_dirs as $tcpdf_include_path) {
    if (@file_exists($tcpdf_include_path)) {
        require_once($tcpdf_include_path);
        break;
    }
}
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);

// set font
$pdf->SetFont('times', 'BI', 20);
//$empcode='913919';
include "../common.php";// for db conectivity
$tablename="rentsum";
$sql = "Select empcode,ticket_no,ctgcode,empname,allot_dt,to_char(qtrno) qtrno,type,seccode,wt,lf,'0' arr 
,CONSERV con,met_chg,'0' eu from $tablename where MONTH='1' AND YEAR='2013' and type not in ('4','5','0') order by qtrno ";
$sqldata =oci_parse($conn,$sql);
oci_execute($sqldata);
//echo $sql;

// add a page
$pdf->AddPage();
    // set some text to print
    while($result=oci_fetch_array($sqldata,OCI_BOTH))
    {
    if(isset($result['EMPCODE'])) {
    $empcode=$result['EMPCODE'];
    } else {
    $empcode = 'NOT DEFINED';
    }
    //echo $empcode."\r\n";
    $pdf->Write(0, $empcode, '', 0, 'C', true, 0, false, false, 0);
    }
     $pdf->Output('example_002.pdf', 'D');  

and the output is

TCPDF ERROR: Some data has already been output, can't send PDF file

the error is

TCPDF ERROR: Some data has already been output, can't send PDF file

broj1 sir i have tryed all the hint u have given
the error comes when am using while loop to feach the record and print it in pdf file

mughaltent sir plz share ur code, so that i can also solve the problem

m using windows 8 os , apache 2.2 and php 5 and orical 10g as db

thanks broj1 sir , i have solve that error by ur kind help.now i m using the following code:-

<?php

$tcpdf_include_dirs = array(realpath('tcpdf.php'), '/usr/share/php/tcpdf/tcpdf.php', '/usr/share/tcpdf/tcpdf.php', '/usr/share/php-tcpdf/tcpdf.php', '/var/www/tcpdf/tcpdf.php', '/var/www/html/tcpdf/tcpdf.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf.php');
foreach ($tcpdf_include_dirs as $tcpdf_include_path) {
    if (@file_exists($tcpdf_include_path)) {
        require_once($tcpdf_include_path);
        break;
    }
}
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);

// set font
$pdf->SetFont('times', 'BI', 20);
///$empcode='913919';
 include "../common.php";// for db conectivity
$tablename="rentsum";
$sql = "Select empcode,ticket_no,ctgcode,empname,allot_dt,to_char(qtrno) qtrno,type,seccode,wt,lf,'0' arr 
,CONSERV con,met_chg,'0' eu from $tablename where MONTH='1' AND YEAR='2013' and type not in ('4','5','0') order by qtrno ";
$sqldata =oci_parse($conn,$sql);
oci_execute($sqldata);

// add a page
$pdf->AddPage();

// set some text to print
while($result=oci_fetch_array($sqldata,OCI_BOTH))
{
$empcode=$result['EMPCODE'];
//echo $empcode."\r\n";
$txt = <<<EOD
$empcode
EOD;
$pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);        
}
$pdf->Output('example_002.pdf', 'I');

?>

but it shows error :-

TCPDF ERROR: Some data has already been output, can't send PDF file

and move over i want that this file should create on clint pc not in the same browser
like the text file create on clint pc by:-
"header("Content-type: application/pdf");
header("Content-disposition: attachment;filename=test.pdf");"

but same problem is there

yes i have done it properly

thanks friends for your help , i have download tcpdf , i have aslo see the examples. they r very nice . but if i put any of the example.php out of example folder it shows error:-"Class 'TCPDF' not found". while i have modify the path of all the file to be include correctly

hi friend , m facing problem to generate pdf file. i m using following code:-

if(isset($_POST['pro']))
{  
    include "common.php";// for db conectivity
    $tablename="rentsum";
    $sql = "Select empcode,ticket_no,ctgcode,empname,allot_dt,to_char(qtrno) qtrno,type,seccode,wt,lf,'0' arr ,CONSERV con,met_chg,'0' eu from $tablename where MONTH='$month' AND YEAR='$year' and type not in ('4','5','0') order by qtrno "; 
    $result =oci_parse($conn,$sql);
    oci_execute($result); 
    $filename="hrent.pdf";
header("Content-type: application/pdf");
header("Content-disposition: pdf" . date("Y-m-d") . ".pdf");
//header("Content-disposition: attachment;filename=$filename");
while($result=oci_fetch_array($sqldata,OCI_BOTH))
{
    $empcode=$result['EMPCODE'];
    echo $empcode."\r\n";

}

}

but it is not working. means pdf flie is generate but when im open the file it show error nmassage the this file is in damage format. plz help me that

thanks friens for the help
but sorry to say i m still failed to do so

hi friends
i want to draw graphs by feching data from database through php code . plz help me

sorry to responce so late, my problem was solved through the code given by "SPeed_FANat1c"
but I would like to thanks to both of u along daniweb.com for the greate help . thank u to all

hi friends

i have develpoed a prog. for pay calculation for my office in php.
now i want to show some thing like employee name in my pge which is currently processing or progress bar with persent if calcution has done.
plz note i m useing POST methord

dear friends , i got my solutions by using \r\n for line break and \n\f for paze break
but remimber that report should contains 60 to 75 nos of line per page depending on font/fonte size u use

thanks urtrivedi, its works for line break but at last i want something for page break

sir very very thanks for replying me but as i am a very fresher in this feild plz give me some sampal js and print ccs coding for line break / set page breaks etc so that i can get my output file [amit.txt] like

Your text to write
09-09-2012

instant of

[]Your text to write[]09-09-2012[][]

when i open it in windows [i.e my computer->c drive->amit.txt]

kind att. plz
currently i am using visual basic 6.0 and i use char(12) function for line break and char(13) function for page break
and
i want to switch this program vb 6.0 to php

i think i have made myself clear to u.

plz help me to come out of it

plz....................

i want to create a text report and i have use this coding:-

<?php
$f=fopen("c:\amit.txt", "wb");

// adding header
$text="\n Your text to write \n ".date('d')."-".date('m')."-".date('Y')."\n\n";
fputs($f, $text);
fclose($f);
?>

which results me some thing like when i open it in windows [i.e my computer->c drive->mit.txt] :-

[]Your text to write[]09-09-2012[][]

but i want it like this

Your text to write
09-09-2012

and in fanfold paper size 14" * 12"
as i have a huge data to create a report for ex payslip of all employee in my company

plz help me