RES: [PHP] Printing

2012-01-06 Thread Alejandro Michelin Salomon
Jim:

The TCPDF software library does not need php pdf functions. Is 100% php
code.
To use only put a require_once '/tcpdf/tcpdf.php'; lik this.

Create a new instance:
$pdf = new TCPDF( 'P', 'mm', 'A4', true, 'UTF-8', false);

And call the methods.

The library has a folder with a lot of examples.

Alejandro MS

-Mensagem original-
De: Jim Giner [mailto:jim.gi...@albanyhandball.com] 
Enviada em: quinta-feira, 5 de janeiro de 2012 17:13
Para: Alejandro Michelin Salomon
Assunto: Re: [PHP] Printing

I don't know what you mean.  How do I create a pdf with php?  Do I have to
have my host install a package or something?
- Original Message -
From: Alejandro Michelin Salomon amichel...@hotmail.com
To: 'Jim Giner' jim.gi...@albanyhandball.com
Sent: Thursday, January 05, 2012 2:01 PM
Subject: RES: [PHP] Printing


 Jim:

 You do not need PDF printer drivers.

 This lib create a PDF file with 100% PHP code.

 When the creation is done, you chose what to do:

 Save a file to download or send directly to the browser.

 Example;

 // reset pointer to the last page
 $pdf-lastPage();

 //Close and output PDF document

 if ( trim( $sFile ) != '' )
$pdf-Output( $sFile, 'F' ); // Save to file else
$pdf-Output(); // Send to browser directly


 Alejandro MS
 -Mensagem original-
 De: Jim Giner [mailto:jim.gi...@albanyhandball.com]
 Enviada em: quinta-feira, 5 de janeiro de 2012 16:55
 Para: Alejandro Michelin Salomon
 Assunto: Re: [PHP] Printing

 I have several pdf printer drivers.  HOw do I use them in a hosted php
 script?
 - Original Message -
 From: Alejandro Michelin Salomon amichel...@hotmail.com
 To: 'Jim Giner' jim.gi...@albanyhandball.com
 Cc: Pgsql-General pgsql-gene...@postgresql.org
 Sent: Thursday, January 05, 2012 1:50 PM
 Subject: RES: [PHP] Printing


 Jim :

 TCPDF software library has excellent examples to teach you how to do
 the work

 http://www.tcpdf.org/

 My legal documents mix images, barcode, etc. All the problems printing
 go to space

 Alejandro MS


 -Mensagem original-
 De: Jim Giner [mailto:jim.gi...@albanyhandball.com]
 Enviada em: quinta-feira, 5 de janeiro de 2012 16:46
 Para: Alejandro Michelin Salomon
 Assunto: Re: [PHP] Printing

 a pdf would solve the problem.
 - Original Message -
 From: Alejandro Michelin Salomon amichel...@hotmail.com
 To: 'Jim Giner' jim.gi...@albanyhandball.com
 Cc: Pgsql-General pgsql-gene...@postgresql.org
 Sent: Thursday, January 05, 2012 1:43 PM
 Subject: RES: [PHP] Printing


 Jim:

 I think the problems is that trying to print directly from PHP is not
 a good idea.

 Example:
 My system is in a host that is located in other city, so the printer
 is near my, but the PHP code is running in other place almost 1800kms
 between the printer and the PHP system.

 My customer use the system a prints from html page generated. When a
 need specific printing, I create a PDF file on the fly with TCPDF
 software library.
 I use this lib to create a printable version of a legal document as
 PDF on the fly, open directly in the Firefox o IE

 Is your server running near the printer?

 Is so specific that create a PDF file does not resolve the problem?

 Alejandro MS

 -Mensagem original-
 De: Jim Giner [mailto:jim.gi...@albanyhandball.com]
 Enviada em: quinta-feira, 5 de janeiro de 2012 13:55
 Para: php-general@lists.php.net
 Assunto: Re: [PHP] Printing



 I can't tell you much on this, because I don't use windows. You have
 to get the source at http://pecl.php.net/printer and compile it. I
 don't know the procedure, etc.

 --
 Nilesh Govindarajan
 http://nileshgr.com

 That was a short trip.  Clicked on the link for documentation and it
 takes me right back to the php manual pages that I'd already read.
 Clicked on the link to download the latest and it's a dead link.

 Does anyone print from their php websites??



 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php













 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing

2012-01-05 Thread Jim Giner
My first attempt to print something to a printer.
I actually just went ahead and tried this from my website:
$hdl = printer_open();
printer_write($hdl,This is my printed page);
printer_write($hdl,This is line 1);
printer_write($hdl,This is line 2);
printer_write($hdl,This is line 3);
printer_close($hdl);


The error I got was:  Fatal error: Call to undefined function printer_open() 
in .

Reading in the manual I find the following conflicting statements:
 1) These functions are only available under Windows 9.x, ME, NT4 and 2000. 
They have been added in PHP 4.0.4.
2) No external libraries are needed to build this extension.

3) This » PECL extension is not bundled with PHP. Windows users must enable 
php_printer.dll inside of php.ini in order to use these functions. A DLL for 
this PECL extension is currently unavailable. See also the building on 
Windows section.



I'm not sure what all those tidbits of information are telling me.  Are they 
outdated?  Is there some other chapter in the manual  I should read?  I only 
looked in Printer.

FWIW - I'm running windows xp on my client.  My host runs Apache and 2.2.21 
and PHP 5.3.6.

My question is:  Is there something I (me!) have to do to get printing to 
function in my domain's PHP install?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2012-01-05 Thread Nilesh Govindarajan
On Thu, Jan 5, 2012 at 8:35 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
 My first attempt to print something to a printer.
 I actually just went ahead and tried this from my website:
 $hdl = printer_open();
 printer_write($hdl,This is my printed page);
 printer_write($hdl,This is line 1);
 printer_write($hdl,This is line 2);
 printer_write($hdl,This is line 3);
 printer_close($hdl);


 The error I got was:  Fatal error: Call to undefined function printer_open()
 in .

 Reading in the manual I find the following conflicting statements:
  1) These functions are only available under Windows 9.x, ME, NT4 and 2000.
 They have been added in PHP 4.0.4.
 2) No external libraries are needed to build this extension.

 3) This » PECL extension is not bundled with PHP. Windows users must enable
 php_printer.dll inside of php.ini in order to use these functions. A DLL for
 this PECL extension is currently unavailable. See also the building on
 Windows section.

 

 I'm not sure what all those tidbits of information are telling me.  Are they
 outdated?  Is there some other chapter in the manual  I should read?  I only
 looked in Printer.

 FWIW - I'm running windows xp on my client.  My host runs Apache and 2.2.21
 and PHP 5.3.6.

 My question is:  Is there something I (me!) have to do to get printing to
 function in my domain's PHP install?


It is PECL extension not bundled by default -
www.php.net/manual/en/printer.installation.php

-- 
Nilesh Govindarajan
http://nileshgr.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2012-01-05 Thread Jim Giner
Add extension=php_printer.dll in php.ini?

Will adding that line install the extension? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2012-01-05 Thread Nilesh Govindarajan
On Thu, Jan 5, 2012 at 9:05 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
 Add extension=php_printer.dll in php.ini?

 Will adding that line install the extension?




It will enable the extension. Install = compile + enable. It will
not work if you don't have the DLL.

-- 
Nilesh Govindarajan
http://nileshgr.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2012-01-05 Thread Nilesh Govindarajan
On Thu, Jan 5, 2012 at 9:16 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
 and where do I get the dll?  That was my original question.  The
 documentation didn't tell me anything other than it had to be enabled.
 - Original Message - From: Nilesh Govindarajan
 cont...@nileshgr.com
 To: Jim Giner jim.gi...@albanyhandball.com
 Cc: php-general@lists.php.net
 Sent: Thursday, January 05, 2012 10:42 AM
 Subject: Re: [PHP] Printing



 On Thu, Jan 5, 2012 at 9:05 PM, Jim Giner jim.gi...@albanyhandball.com
 wrote:

 Add extension=php_printer.dll in php.ini?

 Will adding that line install the extension?




 It will enable the extension. Install = compile + enable. It will
 not work if you don't have the DLL.

 --
 Nilesh Govindarajan
 http://nileshgr.com





I can't tell you much on this, because I don't use windows. You have
to get the source at http://pecl.php.net/printer and compile it. I
don't know the procedure, etc.

-- 
Nilesh Govindarajan
http://nileshgr.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2012-01-05 Thread Jim Giner

Nilesh Govindarajan cont...@nileshgr.com wrote in message 
news:CAPo3nobqHPTH5V+0RqsRsQ0vDAne7V4s1Nc0dB12Gb=akws...@mail.gmail.com...
On Thu, Jan 5, 2012 at 9:16 PM, Jim Giner jim.gi...@albanyhandball.com 
wrote:
 and where do I get the dll? That was my original question. The
 documentation didn't tell me anything other than it had to be enabled.
 - Original Message - From: Nilesh Govindarajan
 cont...@nileshgr.com
 To: Jim Giner jim.gi...@albanyhandball.com
 Cc: php-general@lists.php.net
 Sent: Thursday, January 05, 2012 10:42 AM
 Subject: Re: [PHP] Printing



 On Thu, Jan 5, 2012 at 9:05 PM, Jim Giner jim.gi...@albanyhandball.com
 wrote:

 Add extension=php_printer.dll in php.ini?

 Will adding that line install the extension?




 It will enable the extension. Install = compile + enable. It will
 not work if you don't have the DLL.

 --
 Nilesh Govindarajan
 http://nileshgr.com





I can't tell you much on this, because I don't use windows. You have
to get the source at http://pecl.php.net/printer and compile it. I
don't know the procedure, etc.

-- 
Nilesh Govindarajan
http://nileshgr.com

Now that is some new information!  Thanks for the pointer - I'll read up on 
it. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2012-01-05 Thread Jim Giner


I can't tell you much on this, because I don't use windows. You have
to get the source at http://pecl.php.net/printer and compile it. I
don't know the procedure, etc.

-- 
Nilesh Govindarajan
http://nileshgr.com

That was a short trip.  Clicked on the link for documentation and it takes 
me right back to the php manual pages that I'd already read.  Clicked on the 
link to download the latest and it's a dead link.

Does anyone print from their php websites?? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Printing

2012-01-05 Thread Steven Staples
If I am not mistaken, that is only for printing ON the SERVER... not on the
client.   If you're printing, then you're trying to print to a locally
connected printer on your server.

PHP runs server side, and therefore doesn't know anything about your locally
attached printers.


I did notice that you started a new thread about printing from PDF's, and if
you're trying to create a document to print on your client machine, then
creating a PDF is much easier.

http://fpdf.org


Steven Staples


 -Original Message-
 From: Jim Giner [mailto:jim.gi...@albanyhandball.com]
 Sent: January 5, 2012 10:55 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Printing
 
 
 
 I can't tell you much on this, because I don't use windows. You have
 to get the source at http://pecl.php.net/printer and compile it. I
 don't know the procedure, etc.
 
 --
 Nilesh Govindarajan
 http://nileshgr.com
 
 That was a short trip.  Clicked on the link for documentation and it takes
 me right back to the php manual pages that I'd already read.  Clicked on
 the
 link to download the latest and it's a dead link.
 
 Does anyone print from their php websites??
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -
 No virus found in this message.
 Checked by AVG - www.avg.com
 Version: 2012.0.1901 / Virus Database: 2109/4724 - Release Date: 01/05/12


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing PDF

2010-12-29 Thread Steve Staples
Hi!

I have an app that needs to be created, and it is all running on linux.
I am sure I shoulnd't really write it using PHP, but it's kinda what I
know, and am familiar with... so I am thinking about doing with PHP.

Anyway, for simplicity sake, i am creating a pdf through php (no
problems there) and it needs to be printed.  I've never done printing on
linux, but is there an easy way to send the pdf print job via command
lines to the local (or network) printer?

a friend of mine said postscript or cups, but I am not familiar with
them, so I thought I would ask you GURU's here :)

thank in advance!

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread Greg Bair
On Wed, 29 Dec 2010 10:36:30 -0500
Steve Staples sstap...@mnsi.net wrote:

 Hi!
 
 I have an app that needs to be created, and it is all running on
 linux. I am sure I shoulnd't really write it using PHP, but it's
 kinda what I know, and am familiar with... so I am thinking about
 doing with PHP.
 
 Anyway, for simplicity sake, i am creating a pdf through php (no
 problems there) and it needs to be printed.  I've never done printing
 on linux, but is there an easy way to send the pdf print job via
 command lines to the local (or network) printer?
 
 a friend of mine said postscript or cups, but I am not familiar
 with them, so I thought I would ask you GURU's here :)
 
 thank in advance!
 
 Steve
 
 
You could use the lpr command.  Info here :
http://www.marksanborn.net/linux/printing-from-the-linux-command-line/

Greg

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread Paul M Foster
On Wed, Dec 29, 2010 at 10:36:30AM -0500, Steve Staples wrote:

 Hi!
 
 I have an app that needs to be created, and it is all running on linux.
 I am sure I shoulnd't really write it using PHP, but it's kinda what I
 know, and am familiar with... so I am thinking about doing with PHP.
 
 Anyway, for simplicity sake, i am creating a pdf through php (no
 problems there) and it needs to be printed.  I've never done printing on
 linux, but is there an easy way to send the pdf print job via command
 lines to the local (or network) printer?
 
 a friend of mine said postscript or cups, but I am not familiar with
 them, so I thought I would ask you GURU's here :)

The big problem here is that the site is on the server and the printer
is on the client (most likely). Normally if you provide a link to a PDF
in a webpage, the user/client downloads that PDF and the browser tries
to open it in whatever program it thinks is good for that (like XPDF
under Linux). The program in which it opens the PDF will have an option
to print the file. I've been printing invoices, checks and reports out
of my corporate system for years this way.

Paul

-- 
Paul M. Foster
http://noferblatz.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread Steve Staples
On Wed, 2010-12-29 at 11:49 -0500, Paul M Foster wrote:
 On Wed, Dec 29, 2010 at 10:36:30AM -0500, Steve Staples wrote:
 
  Hi!
  
  I have an app that needs to be created, and it is all running on linux.
  I am sure I shoulnd't really write it using PHP, but it's kinda what I
  know, and am familiar with... so I am thinking about doing with PHP.
  
  Anyway, for simplicity sake, i am creating a pdf through php (no
  problems there) and it needs to be printed.  I've never done printing on
  linux, but is there an easy way to send the pdf print job via command
  lines to the local (or network) printer?
  
  a friend of mine said postscript or cups, but I am not familiar with
  them, so I thought I would ask you GURU's here :)
 
 The big problem here is that the site is on the server and the printer
 is on the client (most likely). Normally if you provide a link to a PDF
 in a webpage, the user/client downloads that PDF and the browser tries
 to open it in whatever program it thinks is good for that (like XPDF
 under Linux). The program in which it opens the PDF will have an option
 to print the file. I've been printing invoices, checks and reports out
 of my corporate system for years this way.
 
 Paul
 

actually... it is a localized app (it should be more of a C++ or Java
(or even Python), but I know PHP more weller than the others... and
there is also a few other things they want... so right now, it will be
on the local machine, but down the road, it will be on a server, but
it is all on the local intranet, so the printers will be accessible.
this is not a world app, just internal.

I can create the PDF's no problem, it is just how to send the created
pdf to the printer to print (it is a label printer, printing 3x5 labels)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread Richard Quadling
On 29 December 2010 17:24, Steve Staples sstap...@mnsi.net wrote:
 I can create the PDF's no problem, it is just how to send the created
 pdf to the printer to print (it is a label printer, printing 3x5 labels)

What type of printer? Some printers require their own language and
won't have any sort of PS, PCL, Esc/2 or GDI support.

I've worked with industrial printers which take strings of plain text
to do page layout/description. You load template layouts into the
printer and can use them.

Completely useless under normal circumstances.

If the printer is something like an Epson TM-L90 (thermal label
printer with barcode support), then sending it a PDF isn't possible as
it doesn't have PS support. It is much easier to send it the string of
codes to have the barcode generated within the label.

On Windows, the drivers deal with all of this stuff. I've no idea on Unix.

The exact model of the printer would help.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread Steve Staples
On Wed, 2010-12-29 at 17:36 +, Richard Quadling wrote:
 On 29 December 2010 17:24, Steve Staples sstap...@mnsi.net wrote:
  I can create the PDF's no problem, it is just how to send the created
  pdf to the printer to print (it is a label printer, printing 3x5 labels)
 
 What type of printer? Some printers require their own language and
 won't have any sort of PS, PCL, Esc/2 or GDI support.
 
 I've worked with industrial printers which take strings of plain text
 to do page layout/description. You load template layouts into the
 printer and can use them.
 
 Completely useless under normal circumstances.
 
 If the printer is something like an Epson TM-L90 (thermal label
 printer with barcode support), then sending it a PDF isn't possible as
 it doesn't have PS support. It is much easier to send it the string of
 codes to have the barcode generated within the label.
 
 On Windows, the drivers deal with all of this stuff. I've no idea on Unix.
 
 The exact model of the printer would help.

I am currently unaware of the printer model, I am mostly working at
building a quote for them.   I suppose I should get the make/models of
what they are going to be using... and hope to hell that they are
compatible.  I do know that the printer has a custom formatted label, so
I hope that there is some drivers or wahtever availble to linux that i
can send the PDF to it to print... looks like this will be some trial
and error (err... research and development?).   The printing is the only
real trivial part of the whole thing.

maybe i should just make this all a greenscreen app, using windows .bat
scripting :)

thanks for all your insight, and once i get some more information, and
after googleing some, if i have MORE questions, i'll be back!!

hope everyone's holidays (if you celebrated any over the last few weeks)
were good, and the new year treats you well!

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread David Hutto
On Wed, Dec 29, 2010 at 3:13 PM, Steve Staples sstap...@mnsi.net wrote:
 On Wed, 2010-12-29 at 17:36 +, Richard Quadling wrote:
 On 29 December 2010 17:24, Steve Staples sstap...@mnsi.net wrote:
  I can create the PDF's no problem, it is just how to send the created
  pdf to the printer to print (it is a label printer, printing 3x5 labels)

 What type of printer? Some printers require their own language and
 won't have any sort of PS, PCL, Esc/2 or GDI support.

 I've worked with industrial printers which take strings of plain text
 to do page layout/description. You load template layouts into the
 printer and can use them.

 Completely useless under normal circumstances.

 If the printer is something like an Epson TM-L90 (thermal label
 printer with barcode support), then sending it a PDF isn't possible as
 it doesn't have PS support. It is much easier to send it the string of
 codes to have the barcode generated within the label.

 On Windows, the drivers deal with all of this stuff. I've no idea on Unix.

 The exact model of the printer would help.

 I am currently unaware of the printer model, I am mostly working at
 building a quote for them.

Welcome to being a software developer.

 I suppose I should get the make/models of
 what they are going to be using... and hope to hell that they are
 compatible.  I do know that the printer has a custom formatted label, so
 I hope that there is some drivers or wahtever availble to linux that i
 can send the PDF to it to print... looks like this will be some trial
 and error (err... research and development?).   The printing is the only
 real trivial part of the whole thing.
.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing PDF

2010-12-29 Thread Paul M Foster
On Wed, Dec 29, 2010 at 12:24:14PM -0500, Steve Staples wrote:

 On Wed, 2010-12-29 at 11:49 -0500, Paul M Foster wrote:
  On Wed, Dec 29, 2010 at 10:36:30AM -0500, Steve Staples wrote:
 
   Hi!
  
   I have an app that needs to be created, and it is all running on linux.
   I am sure I shoulnd't really write it using PHP, but it's kinda what I
   know, and am familiar with... so I am thinking about doing with PHP.
  
   Anyway, for simplicity sake, i am creating a pdf through php (no
   problems there) and it needs to be printed.  I've never done printing on
   linux, but is there an easy way to send the pdf print job via command
   lines to the local (or network) printer?
  
   a friend of mine said postscript or cups, but I am not familiar with
   them, so I thought I would ask you GURU's here :)
 
  The big problem here is that the site is on the server and the printer
  is on the client (most likely). Normally if you provide a link to a PDF
  in a webpage, the user/client downloads that PDF and the browser tries
  to open it in whatever program it thinks is good for that (like XPDF
  under Linux). The program in which it opens the PDF will have an option
  to print the file. I've been printing invoices, checks and reports out
  of my corporate system for years this way.
 
  Paul
 
 
 actually... it is a localized app (it should be more of a C++ or Java
 (or even Python), but I know PHP more weller than the others... and
 there is also a few other things they want... so right now, it will be
 on the local machine, but down the road, it will be on a server, but
 it is all on the local intranet, so the printers will be accessible.
 this is not a world app, just internal.
 
 I can create the PDF's no problem, it is just how to send the created
 pdf to the printer to print (it is a label printer, printing 3x5 labels)

I have heard of (and seen) some Javascript code which can be embedded
in a PDF to make it print without the need for what I described. But I
don't recall where I saw it. Might have been on this list, so you could
check the archives.

Paul

-- 
Paul M. Foster
http://noferblatz.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing....

2010-10-22 Thread Steve Staples
Ok, here is an interesting one...

I am building an application, that basically listens for input on 2 ip
addresses (not a problem there)... then it does a bunch of stuff, puts
info to a terminal window (again, i dont think this will be an issue)...
but then once the user says yep... print i need to be able to connect
to a networked printer, and print the label... 

the printer will be accessable to the server (the server will be linux
based), so I just need to connect, and send data to it... is this
possble??

or am I biting off more than i should chew here?


and YES... i do know it is friday afternoon... ;)

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing....

2010-10-22 Thread Daniel P. Brown
On Fri, Oct 22, 2010 at 16:43, Steve Staples sstap...@mnsi.net wrote:
 Ok, here is an interesting one...

 I am building an application, that basically listens for input on 2 ip
 addresses (not a problem there)... then it does a bunch of stuff, puts
 info to a terminal window (again, i dont think this will be an issue)...
 but then once the user says yep... print i need to be able to connect
 to a networked printer, and print the label...

 the printer will be accessable to the server (the server will be linux
 based), so I just need to connect, and send data to it... is this
 possble??

Of course.  Check into CUPS.  Here, specifically, are some
command-line options:

http://www.cups.org/documentation.php/options.html

I've done this multiple times myself.  I may even still have some
PHP code lying around.  I'll try to take a look for it if you need it,
but I highly doubt you'll have any issues.

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing in columns

2010-08-27 Thread Ashley M. Kirchner
 

I need some guidance here.  I've been fighting with this
problem for a few days now and not having a whole lot of luck.  I have some,
but I run into issues sooner or later.  So I'm hoping that someone here can
give me some ideas of how to better approach this, perhaps help with coding
as well.

 

My data consists of a number of addresses in any number of
US states.  I need to format them as such:

 

- have a title that consists of the state name, spanning the
full width of a

- have all the addresses pertaining to that specific state
split into two columns and displayed below.

- output everything to Letter size PDF.

 

In very simple form, it looks something like this (hoping
this doesn't get mangled in formatting):

 

+---+

|   STATE NAME  |

+---+

|  Address 1  |   Address 5 |

|  Address 2  |   Address 6 |

|  Address 3  |   Address 7 |

|  Address 4  | |

+---+

 

So far what I've been able to get done is so the data
sorting and matching up the addresses with their states.  I can format the
address the way I want them displayed and all.  All the way to where I start
outputting the data.  However .

 

I have to account for page length so that my data doesn't
run past the page.  I have to account for the possibility that the current
state being processed will have some lines on one page and some more on the
next page . which is fine, but when that happens, I want the title repeated
on the next page like so: STATE NAME (Cont.)

 

So here's how far I got:

- grab data from CSV file

- process/sort data

- loop through data, line by line, inserting same state
addresses into an array()

- when I encounter a new state, I move to output the current
contents of the array()

- when it's time to output the array, I do:

- array_chunk($array, ceil(count($array)/2))

- output chunks into respective column

 

The problem I have is when I reach the bottom of the page
while printing the first chunk.  Let's say I have 120 records to print, and
I only have room for 23 lines.  So initially the array gets split into two
chunks of 60 records each.  I start outputting data.  I reach the end of the
document and still have 37 lines left, so now what?

 

Right now I'm thinking I need to take that remaining data,
merge it with the second chunk and start outputting that into the second
column till I reach the bottom of the page again (which would be 23 lines
later.)  At that point I will still have 74 record left (14 PLUS the initial
60 lines that was the original 2nd chunk.)  I start a new page, add the same
state name title, and go through the motions again of rechunking the
remaining data and outputting again.

 

Does any of that even make sense?  Am I going on about it
the right way?  Is there a better way to do this to begin with?

 



[PHP] Printing

2008-12-17 Thread Dan Shirah
Hello all,

Could someone please point me in the right direction for printing files
through PHP?

I already have my application setup so that it creates documents and saves
them to a folder.  How would I go about printing all of the files in the
folder via PHP?

I've looked into the Print functions in the manual (
http://us2.php.net/manual/en/ref.printer.php) but this does not seem to be
the right thing to use to print documents that already exist.

Thanks,
Dan


Re: [PHP] Printing

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 2:57 PM, Dan Shirah mrsqua...@gmail.com wrote:

 Hello all,

 Could someone please point me in the right direction for printing files
 through PHP?

 I already have my application setup so that it creates documents and saves
 them to a folder.  How would I go about printing all of the files in the
 folder via PHP?

 I've looked into the Print functions in the manual (
 http://us2.php.net/manual/en/ref.printer.php) but this does not seem to be
 the right thing to use to print documents that already exist.

 Thanks,
 Dan

I would suggest sending a PDF to the client and allowing the client to
handle the rest.


-- 

Bastien

Cat, the other other white meat


Re: [PHP] Printing

2008-12-17 Thread Jason Pruim


On Dec 17, 2008, at 2:57 PM, Dan Shirah wrote:


Hello all,

Could someone please point me in the right direction for printing  
files

through PHP?

I already have my application setup so that it creates documents  
and saves
them to a folder.  How would I go about printing all of the files  
in the

folder via PHP?

I've looked into the Print functions in the manual (
http://us2.php.net/manual/en/ref.printer.php) but this does not  
seem to be

the right thing to use to print documents that already exist.


Do you want to print this on your office printer or on the website  
users printer?


If you are looking for away to print it on their printer, why not  
just grab all the files that need to be printed, make a PDF of it,  
and then use the browsers print feature?




--
Jason Pruim
japr...@raoset.com
616.399.2355





RE: [PHP] Printing

2008-12-17 Thread Jay Blanchard
[snip]
Could someone please point me in the right direction for printing files
through PHP?

I already have my application setup so that it creates documents and
saves
them to a folder.  How would I go about printing all of the files in the
folder via PHP?

I've looked into the Print functions in the manual (
http://us2.php.net/manual/en/ref.printer.php) but this does not seem to
be
the right thing to use to print documents that already exist.
[/snip]

Does it save them to a folder on the server? Or does it save them on the
client?

If it is on the server then the server would have to send the docs to a
printer queue.

If it is on the client PHP cannot really do anything about. PHP cannot
force the client to print but it could send the docs to the client once
a request has been made.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing

2008-12-17 Thread Dan Shirah

   Do you want to print this on your office printer or on the website users
 printer?

 If you are looking for away to print it on their printer, why not just grab
 all the files that need to be printed, make a PDF of it, and then use the
 browsers print feature?



  --
 Jason Pruim
 japr...@raoset.com
 616.399.2355


I want it to print to the users local printer.

Basically the user has a form and based on their search criteria they will
get multiple results.

Next to each result I have a checkbox that the user will use to select the
documents they want to print.

Once they have selected everything they want to print, they click on a
Print Selection link.

The checkboxes all have the same name but different dynamically assigned
values, so once they click to print, an array of values for the checkbox
name is passed to my next page.

I have a for () loop on the next page that extracts each individual value
and uses it in a query to extract information and build a pdf which is
automatically output to a file.

Once a PDF has been generated I want to send it to the users printer to be
printed.


Re: [PHP] Printing

2008-12-17 Thread Dan Shirah

 Does it save them to a folder on the server? Or does it save them on the
 client?

 If it is on the server then the server would have to send the docs to a
 printer queue.

 If it is on the client PHP cannot really do anything about. PHP cannot
 force the client to print but it could send the docs to the client once
 a request has been made.


Yes, it saves the created documents to a folder on the server.  Since any
user could request to print the same document I first check to see if the
document already exists.

If it does exist I naturally want to skip the creation process and just
print it and move on to the next selection.

I have another process that clears out this folder once every 24 hours so it
doesn't accumulate a massive store of files.


Re: [PHP] Printing

2008-12-17 Thread Bastien Koert
On Wed, Dec 17, 2008 at 3:16 PM, Dan Shirah mrsqua...@gmail.com wrote:

 
Do you want to print this on your office printer or on the website
 users
  printer?
 
  If you are looking for away to print it on their printer, why not just
 grab
  all the files that need to be printed, make a PDF of it, and then use the
  browsers print feature?
 
 
 
   --
  Jason Pruim
  japr...@raoset.com
  616.399.2355
 

 I want it to print to the users local printer.

 Basically the user has a form and based on their search criteria they will
 get multiple results.

 Next to each result I have a checkbox that the user will use to select the
 documents they want to print.

 Once they have selected everything they want to print, they click on a
 Print Selection link.

 The checkboxes all have the same name but different dynamically assigned
 values, so once they click to print, an array of values for the checkbox
 name is passed to my next page.

 I have a for () loop on the next page that extracts each individual value
 and uses it in a query to extract information and build a pdf which is
 automatically output to a file.

 Once a PDF has been generated I want to send it to the users printer to be
 printed.


You can't, the best you can do is send the PDF down and let the user choose
to do with it what they will

-- 

Bastien

Cat, the other other white meat


Re: [PHP] Printing

2008-12-17 Thread Dan Shirah

   You can't, the best you can do is send the PDF down and let the user
 choose to do with it what they will



 --

 Bastien


So you think I should try and look into a way to have FPDF append each
document to the already created document, and once all pages have been added
to the PDF force it back to the user to open in the broswer?


Re: [PHP] Printing

2008-12-17 Thread Dan McCullough
I did something similar, but it was some work I did for a company and the
application was an internal application that used PHP and a Java applet to
send the file to a workers local printer since it cant be accomplished by
PHP itself.

On Wed, Dec 17, 2008 at 3:30 PM, Dan Shirah mrsqua...@gmail.com wrote:

 
You can't, the best you can do is send the PDF down and let the user
  choose to do with it what they will
 
 
 
  --
 
  Bastien
 

 So you think I should try and look into a way to have FPDF append each
 document to the already created document, and once all pages have been
 added
 to the PDF force it back to the user to open in the broswer?



Re: [PHP] Printing

2008-12-17 Thread clive

Dan Shirah wrote:

Hello all,

Could someone please point me in the right direction for printing files
through PHP?

  
On I project I recently worked on, I used php to read a template file 
(rtf) and makes some changes and then save it in a folder on the server. 
This was a windows machine and I used  a small program called 
batchprintpro. It simply monitors a directory and prints any new file 
that should appear. Its quite configurable and seems stable enough to 
print a few hundred documents per week.


Clive


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Web Page

2008-11-13 Thread Patrick Moloney
Thanks to all. That worked well. I just had to insert the stylesheet 
link on each of a couple dozen pages, but it worked.
My pages were a little complicated and took some work - and could 
probably use more but I'll deal with that as I go.


Some samples I found were very simple print stylesheets, others were 
longer but written from scratch. I started with my previous screen 
stylesheet and modified it. That seemed to work pretty well.


Patrick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Web Page

2008-11-08 Thread Ashley Sheridan
On Sat, 2008-11-08 at 08:01 -0500, Patrick Moloney wrote:
 Ashley Sheridan wrote:
  On Thu, 2008-11-06 at 22:35 +0100, Frank Arensmeier wrote:
  6 nov 2008 kl. 21.21 skrev Patrick Moloney:
 
  I'd like to enable my users to print individual web pages from their  
  browser. If they simply select the browser print button they don't  
  get all the text that is displayed in a scrolling text area.
  The web page is static html and css, in a php file.
 
  This might be a good starting point.
 
  http://www.alistapart.com/articles/printyourway
 
  //frank
 
 
  link href=print.css media=print type=text/css rel=stylesheet/
  
  Then set out your CSS in print.css to lay out the page without scrolling
  areas.
  
  
  Ash
  www.ashleysheridan.co.uk
  
 
 Thanks all! So, to state the obvious (to you all) the solution is to 
 address my original question through CSS. That sounds good.
 Ashly, your post is helpful. What is the next step, to display the page 
 on screen using the new stylesheet, then rely on the user to use the 
 browsers print button?
 
 Thanks,
 Patrick
 
 
Easier than that even, the browser automatically selects this stylesheet
when the user presses the print button (or you issue a window.print()
from javascript) because it recognises the media=print attribute. You
can use the media type for other browsers too, like audio, print,
screen, projectors, etc.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Web Page

2008-11-08 Thread Patrick Moloney

Ashley Sheridan wrote:

On Thu, 2008-11-06 at 22:35 +0100, Frank Arensmeier wrote:

6 nov 2008 kl. 21.21 skrev Patrick Moloney:

I'd like to enable my users to print individual web pages from their  
browser. If they simply select the browser print button they don't  
get all the text that is displayed in a scrolling text area.

The web page is static html and css, in a php file.


This might be a good starting point.

http://www.alistapart.com/articles/printyourway

//frank



link href=print.css media=print type=text/css rel=stylesheet/

Then set out your CSS in print.css to lay out the page without scrolling
areas.


Ash
www.ashleysheridan.co.uk



Thanks all! So, to state the obvious (to you all) the solution is to 
address my original question through CSS. That sounds good.
Ashly, your post is helpful. What is the next step, to display the page 
on screen using the new stylesheet, then rely on the user to use the 
browsers print button?


Thanks,
Patrick


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing Web Page

2008-11-06 Thread Patrick Moloney
I'd like to enable my users to print individual web pages from their 
browser. If they simply select the browser print button they don't get 
all the text that is displayed in a scrolling text area.

The web page is static html and css, in a php file.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Printing Web Page

2008-11-06 Thread Jay Blanchard
[snip]
I'd like to enable my users to print individual web pages from their 
browser. If they simply select the browser print button they don't get 
all the text that is displayed in a scrolling text area.
The web page is static html and css, in a php file.
[/snip]

There are some very good articles on setting up a CSS for printing web
pages if you search Google.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Web Page

2008-11-06 Thread Frank Arensmeier

6 nov 2008 kl. 21.21 skrev Patrick Moloney:

I'd like to enable my users to print individual web pages from their  
browser. If they simply select the browser print button they don't  
get all the text that is displayed in a scrolling text area.

The web page is static html and css, in a php file.



This might be a good starting point.

http://www.alistapart.com/articles/printyourway

//frank


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Web Page

2008-11-06 Thread Ashley Sheridan
On Thu, 2008-11-06 at 22:35 +0100, Frank Arensmeier wrote:
 6 nov 2008 kl. 21.21 skrev Patrick Moloney:
 
  I'd like to enable my users to print individual web pages from their  
  browser. If they simply select the browser print button they don't  
  get all the text that is displayed in a scrolling text area.
  The web page is static html and css, in a php file.
 
 
 This might be a good starting point.
 
 http://www.alistapart.com/articles/printyourway
 
 //frank
 
 
link href=print.css media=print type=text/css rel=stylesheet/

Then set out your CSS in print.css to lay out the page without scrolling
areas.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing JPEG

2008-10-23 Thread Kyle Terry
I'm stuck... What is the best way to send a jpg to a printer with PHP? Looks
like it is only working with png and bmp...

-- 
Kyle Terry | www.kyleterry.com


[PHP] Printing date out of array

2008-08-31 Thread Michael S. Dunsavage
This is my date array:

$months = array (1 = 'January', 'February', 'March', 'April', 'May',
'June', 'July', 'August', 'September', 'October', 'November',
'December');



This is my date select in the form:


echo 'select name=day';
for ($day = 1; $day = 31; $day++) {
echo option value=\$day\$day/option\n;
}
echo '/select';

echo 'select name=year';
$year = 2008;
while ($year = 2020) {
echo option value=\$year\$year/option\n;
$year++;
}
echo '/select';


This is how it submits to mysql:




Now, when I submit it to mysql, it's all in mm-dd- format.

When I submit it to an e-mail, I'd like it to me Month-dd-. How
could I do this?

Would it be easier to pull the date from mysql and break it down
somehow? And if so how would I do that?


-- 
Michael S. Dunsavage


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing date out of array

2008-08-31 Thread Ólafur Waage
I would suggest the time() value to be saved in your database. Since
the date() function can use that as the second parameter and you can
use any format date() allows. Or make your own.

Ólafur Waage
[EMAIL PROTECTED]

2008/8/31 Michael S. Dunsavage [EMAIL PROTECTED]:
 This is my date array:

 $months = array (1 = 'January', 'February', 'March', 'April', 'May',
 'June', 'July', 'August', 'September', 'October', 'November',
 'December');



 This is my date select in the form:


 echo 'select name=day';
 for ($day = 1; $day = 31; $day++) {
echo option value=\$day\$day/option\n;
 }
 echo '/select';

 echo 'select name=year';
 $year = 2008;
 while ($year = 2020) {
echo option value=\$year\$year/option\n;
$year++;
 }
 echo '/select';


 This is how it submits to mysql:




 Now, when I submit it to mysql, it's all in mm-dd- format.

 When I submit it to an e-mail, I'd like it to me Month-dd-. How
 could I do this?

 Would it be easier to pull the date from mysql and break it down
 somehow? And if so how would I do that?


 --
 Michael S. Dunsavage


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing date out of array

2008-08-31 Thread Jochem Maas

Michael S. Dunsavage schreef:

This is my date array:

$months = array (1 = 'January', 'February', 'March', 'April', 'May',
'June', 'July', 'August', 'September', 'October', 'November',
'December');


you want, if you ask me, to get you head round the following functions.

http://php.net/set_locale
http://php.net/time
http://php.net/date
http://php.net/mktime

more generally, check out this section of the manual (and let it
be known, dates are tricky buggers ... they can bite):

http://php.net/manual/en/book.datetime.php

additionally, check out the UNIX_TIMESTAMP() function in MySQL, which
will give you a unix timestamp (of all things!) that you can use to
generate formatted date strings easily in php using date()



This is my date select in the form:


echo 'select name=day';
for ($day = 1; $day = 31; $day++) {
echo option value=\$day\$day/option\n;
}
echo '/select';

echo 'select name=year';
$year = 2008;
while ($year = 2020) {
echo option value=\$year\$year/option\n;
$year++;
}
echo '/select';


This is how it submits to mysql:




Now, when I submit it to mysql, it's all in mm-dd- format.

When I submit it to an e-mail, I'd like it to me Month-dd-. How
could I do this?

Would it be easier to pull the date from mysql and break it down
somehow? And if so how would I do that?





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing Question

2008-01-26 Thread Peter Jackson

OK this is very general.

Whats the best way to do formatted printing via php?

In my case I have a postgre database that I connect to with a 
php(naturally seeing as this is the php list).


 My aim is to convert an Access db to php/postgre.

 In this access db there are several reports that require landscape 
printing.


 So the question is how to replace this via php/whatever.

(I did say it was a vague question)

 Oh and I'm aiming for a unix/windows outcome.

 any links welcome.

TIA

Peter

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Question

2008-01-26 Thread Floor Terra
On Jan 26, 2008 1:03 PM, Peter Jackson [EMAIL PROTECTED] wrote:

 Whats the best way to do formatted printing via php?

You could try PDFlib().
Draw your reports to landscape formated pdf's and print them.

 Oh and I'm aiming for a unix/windows outcome.

pdf is platform independent.

I hope this is what you meant.

Floor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing Question

2008-01-26 Thread Robert Cummings

On Sat, 2008-01-26 at 15:19 +0100, Floor Terra wrote:
 On Jan 26, 2008 1:03 PM, Peter Jackson [EMAIL PROTECTED] wrote:
 
  Whats the best way to do formatted printing via php?
 
 You could try PDFlib().
 Draw your reports to landscape formated pdf's and print them.
 
  Oh and I'm aiming for a unix/windows outcome.
 
 pdf is platform independent.
 
 I hope this is what you meant.

I recently had a request from a client to create a button on client
search results that would generate page that could print off a mailing
envelope for each selected client. They wanted to run a print batch on a
couple of thousand clients. So I used HTML, CSS. Specifically to force
page breaks while printing I used the following:

div style=page-break-after: always/div

Note that you can't use a span for the above css attribute. Then for
various dimensions of the envelope and return address etc, I used CSS
attributes defined by the inches unit. I'll admint I whipped it up quick
and dirty using tables (sorry, tables are just simpler for generating
quick layouts than divs are... talk to the hand smelly purists :)
So something like the following:

table.envelopeLayout
{
width: 13in;
}

table.envelopeLayout td.returnAddress
{
height: 3in;
}

So this looked nice in the browser, but when they went to print it got
all borked when they told IE to use landscape mode. So I told them to
upgrade to a real browser (Firefox (though I prefer Opera :)). After
that they told me it worked perfectly. So, to make the point... you do't
need PDF, HTML will do. BTW, I did this all remotely and someone on-site
did a couple of print tests to give me feedback. I never even got to see
their new fancy schmancy printer :)

I've done other print stuff via the browser before too... such as state
driving certificates for presentation in court. Never had a problem once
the layout and print configuration were refined.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing within functions

2007-11-12 Thread Philip Thompson
Hi. I thought of this when I read the emails about using functions or
includes...

What are your thoughts about *printing* things from within functions? For
example:

?php
function printSomething () {
echo Something about nothing. ;
echo Another something.;
}

function something () {
$text = Something about nothing. ;
$text .= Another something.;
return $text;
}
?
html
...
p?php printSomething (); ?/p
p?php echo something (); ?/p
...
/html

Obviously, these are over-simplified functions, but you get the point.
Nonetheless, do you tend to print things within functions or pass the
results back and then print them? I understand it may depend on the current
context, but which way do you lean and is one way or the other considered
*better practice*?

Thanks,
~Philip


Re: [PHP] Printing within functions

2007-11-12 Thread Jake

Obviously, these are over-simplified functions, but you get the point.
Nonetheless, do you tend to print things within functions or pass the
results back and then print them? I understand it may depend on the 
current

context, but which way do you lean and is one way or the other considered
*better practice*?


I'd say 98% of the time I return a value back so I can verify the result. 
You could verify the result within the function, but that would cause the 
function to become less portable, and most of the time I use the same 
function in more than one place, or try to.


Jake 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing MSSQL-Query ERROR description in PHP

2007-06-05 Thread Jim Lucas

karthi keyan wrote:

Hi,
   
  Is there any way to print the reason why the query has been failed, like the way MySQL-PHP has mysql_error()?
   
  Regards,

KARTHIK.

   
-

 Download prohibited? No problem! CHAT from any browser, without download.


Is this what you are looking for?

http://us.php.net/manual/en/function.mssql-get-last-message.php

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing MSSQL-Query ERROR description in PHP

2007-06-05 Thread Stut

karthi keyan wrote:

  Is there any way to print the reason why the query has been failed, like the 
way MySQL-PHP has mysql_error()?


Hmm, where to look for information on the MSSQL functions in PHP.

Hey, I got a crazy plan. Let's try looking in the MSSQL part of the PHP 
manual. Come navigate there with me: http://php.net/mssql


Let's scroll down to find the function list. Ahh, there is it. Hmm, what 
we got here the... bind, close, connect, data_seek. Nope, none of those. 
Let's keep going.


Oooh, do you see what I see? mssql_get_last_message - that sounds 
promising. What does the description say? Returns the last message from 
the server. Well, if there's been an error in the last query we tried 
to run it makes sense that the last message from the server would 
contain the error message.


Hey, how about this. You try that and let us know whether you learnt 
something from this lesson.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing MSSQL-Query ERROR description in PHP

2007-06-05 Thread Richard Lynch
On Mon, June 4, 2007 11:02 pm, karthi keyan wrote:
   Is there any way to print the reason why the query has been failed,
 like the way MySQL-PHP has mysql_error()?

Gee, I dunno.

You think there might be?

Maybe it's in the manual?!

http://us2.php.net/manual/en/ref.mssql.php

There are only 40 functions there.

You are already using at least 5 of those, if you have anything
working at all.

20 of them are so obviously named that they cannot possibly be what
you want.

Did you put even 10 SECONDS into this before posting?!

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing MSSQL-Query ERROR description in PHP

2007-06-04 Thread karthi keyan
Hi,
   
  Is there any way to print the reason why the query has been failed, like the 
way MySQL-PHP has mysql_error()?
   
  Regards,
KARTHIK.

   
-
 Download prohibited? No problem! CHAT from any browser, without download.

[PHP] printing out this nested array

2007-05-14 Thread Don Don
I am having a bit of a confusion printing the values of an array i have. When i 
print_r this array it contains the following:
 
Array ( [ValueA] = ValueA [ValueB] = valueB [TestValue] = TestValue [Errors] 
= Array ( [0] = Array ( [ErrorId] = AD27JH [ErrorMsg] = OK ) ) )  
  I can get the values of ValueA, ValueB and TestValue but I am a bit confused 
at getting the values of ErrorId and ErrorMsg.
   
  e.g. echo $arrayName['ValueA'];  // will display the value contained there
  
am thinking echo $arrayName['Errors']['ErrorId']; // should display the value 
but it does not
  Anyone wants to shed more light ?
  
Cheers


 
-
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.

Re: [PHP] printing out this nested array

2007-05-14 Thread Crayon Shin Chan
On Monday 14 May 2007 18:41, Don Don wrote:

 am thinking echo $arrayName['Errors']['ErrorId']; // should display the
 value but it does not Anyone wants to shed more light ?

echo $arrayName['Errors'][0]['ErrorId']; // ??

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing out this nested array

2007-05-14 Thread Richard Davey

Don Don wrote:


I am having a bit of a confusion printing the values of an array i have. When i 
print_r this array it contains the following:
 
Array ( [ValueA] = ValueA [ValueB] = valueB [TestValue] = TestValue [Errors] = Array ( [0] = Array ( [ErrorId] = AD27JH [ErrorMsg] = OK ) ) )  
  I can get the values of ValueA, ValueB and TestValue but I am a bit confused at getting the values of ErrorId and ErrorMsg.
   
  e.g. echo $arrayName['ValueA'];  // will display the value contained there
  
am thinking echo $arrayName['Errors']['ErrorId']; // should display the value but it does not

  Anyone wants to shed more light ?


$arrayName['Errors'][0]['ErrorId']

Cheers,

Rich
--
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing out this nested array

2007-05-14 Thread Don Don
oops ! [0] 
   
  cheers

Richard Davey [EMAIL PROTECTED] wrote:
  Don Don wrote:

 I am having a bit of a confusion printing the values of an array i have. When 
 i print_r this array it contains the following:
 
 Array ( [ValueA] = ValueA [ValueB] = valueB [TestValue] = TestValue 
 [Errors] = Array ( [0] = Array ( [ErrorId] = AD27JH [ErrorMsg] = OK ) ) ) 
 I can get the values of ValueA, ValueB and TestValue but I am a bit confused 
 at getting the values of ErrorId and ErrorMsg.
 
 e.g. echo $arrayName['ValueA']; // will display the value contained there
 
 am thinking echo $arrayName['Errors']['ErrorId']; // should display the value 
 but it does not
 Anyone wants to shed more light ?

$arrayName['Errors'][0]['ErrorId']

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



   
-
Luggage? GPS? Comic books? 
Check out fitting  gifts for grads at Yahoo! Search.

RE: [PHP] printing out this nested array

2007-05-14 Thread Brad Fuller
Don Don wrote:
 I am having a bit of a confusion printing the values of an
 array i have. When i print_r this array it contains the following:
 
 Array ( [ValueA] = ValueA [ValueB] = valueB [TestValue] =
 TestValue [Errors] = Array ( [0] = Array ( [ErrorId] =
 AD27JH [ErrorMsg] = OK ) ) )
   I can get the values of ValueA, ValueB and TestValue but I
 am a bit confused at getting the values of ErrorId and ErrorMsg.
 
   e.g. echo $arrayName['ValueA'];  // will display the value
 contained there 
 
 am thinking echo $arrayName['Errors']['ErrorId']; // should
 display the value but it does not
   Anyone wants to shed more light ?
 
 Cheers

echo $arrayName['Errors'][0]['ErrorId'];

-B

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing out this nested array

2007-05-14 Thread Jim Lucas

Don Don wrote:

I am having a bit of a confusion printing the values of an array i have. When i 
print_r this array it contains the following:
 
Array ( [ValueA] = ValueA [ValueB] = valueB [TestValue] = TestValue [Errors] = Array ( [0] = Array ( [ErrorId] = AD27JH [ErrorMsg] = OK ) ) )  
  I can get the values of ValueA, ValueB and TestValue but I am a bit confused at getting the values of ErrorId and ErrorMsg.
   
  e.g. echo $arrayName['ValueA'];  // will display the value contained there
  
am thinking echo $arrayName['Errors']['ErrorId']; // should display the value but it does not

  Anyone wants to shed more light ?
  
Cheers



 
-

8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.
suggestion for next time.  echo a pre or plaintext tag out before you echo your array next time 
and you will then see the nesting of the arrays


Doing that would have made the answer to this question very obvious

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Unknown

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing out this nested array

2007-05-14 Thread Myron Turner
Jim Lucas wrote:-- 



   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Unknown



Malvolio,12th Night, III.iv

--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing out this nested array

2007-05-14 Thread Richard Davey

Jim Lucas wrote:

suggestion for next time.  echo a pre or plaintext tag out before 
you echo your array next time and you will then see the nesting of the 
arrays


Doing that would have made the answer to this question very obvious


You could also benefit from installing this very handy little bit of 
code into your PHP project:


http://krumo.sourceforge.net/

Cheers,

Rich
--
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] printing a one-to-many relationship

2007-04-25 Thread Thufir
There's a one-to-many relationship between px_items.id and contacts.id, and I
want a printout of some data from each.

I want to print out the query results px_items.id field once and once only, but
the contacts.notes field many times, as there could be many entries.

Right now it prints out each row, which is workable for now, but could get
annoying.  I'm trying for something like


entry one
note a
note b
note c

entry two
note a

entry three
notb a
note b



Here's my schema and code:

[EMAIL PROTECTED] ~]# 
[EMAIL PROTECTED] ~]# cat /var/www/html/items_notes.php -n
 1  html
 2  headtitleitems and notes/title/head
 3  body
 4  ?php
 5  $user=feeds;
 6  $host=localhost;
 7  $password=password;
 8  $database = feeds;
 9  
10  $connection = mysql_connect($host,$user,$password)
11  or die (couldn't connect to server);
12  $db = mysql_select_db($database,$connection)
13  or die (Couldn't select database);
14
15
16  $query = SELECT * FROM contacts, px_items WHERE
contacts.id=px_items.id ORDER BY px_items.id DESC;
17
18  $result = mysql_query($query)
19  or die (Couldn't execute query.);
20
21  while ($row = mysql_fetch_array($result)) 
22  {
23  extract ($row);
24
25  echo bigbigb;
26  echo $id;
27  echo /b/big/big;
28
29  echo br;
30  echo $title;
31
32  echo br;
33  echo $content;
34  echo br;
35
36  echo br;
37  echo $timestamp;
38  echo br;
39
40  echo br;
41  echo $notes;
42  echo br;
43
44  echo a href=\;
45  echo $link;
46  echo \;
47  echo $link;
48  echo /a;
49
50  echo brbr;
51
52  }//while
53  ?
54  /body
55  /html 
[EMAIL PROTECTED] ~]# 
[EMAIL PROTECTED] ~]# 
[EMAIL PROTECTED] ~]# 
[EMAIL PROTECTED] ~]# mysql -u feeds -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 25 to server version: 5.0.27

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql use feeds;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql show tables;
+-+
| Tables_in_feeds |
+-+
| contacts| 
| px_feeds| 
| px_items| 
+-+
3 rows in set (0.00 sec)

mysql describe contacts;
+---+---+--+-+---+---+
| Field | Type  | Null | Key | Default   | Extra |
+---+---+--+-+---+---+
| id| int(11)   | YES  | MUL | NULL  |   | 
| timestamp | timestamp | NO   | | CURRENT_TIMESTAMP |   | 
| notes | longtext  | YES  | | NULL  |   | 
+---+---+--+-+---+---+
3 rows in set (0.07 sec)

mysql describe px_items;
+---+--+--+-+---++
| Field | Type | Null | Key | Default   | Extra  |
+---+--+--+-+---++
| id| int(11)  | NO   | PRI | NULL  | auto_increment | 
| feed_id   | int(11)  | NO   | MUL | 0 || 
| timestamp | timestamp| NO   | | CURRENT_TIMESTAMP || 
| link  | text | YES  | | NULL  || 
| title | varchar(250) | YES  | | NULL  || 
| content   | text | YES  | | NULL  || 
| dcdate| text | YES  | | NULL  || 
| dccreator | text | YES  | | NULL  || 
| dcsubject | text | YES  | | NULL  || 
| read  | tinyint(4)   | YES  | MUL | NULL  || 
+---+--+--+-+---++
10 rows in set (0.00 sec)

mysql quit
Bye
[EMAIL PROTECTED] ~]# 
[EMAIL PROTECTED] ~]# date
Wed Apr 25 19:30:38 BST 2007
[EMAIL PROTECTED] ~]# 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing a one-to-many relationship

2007-04-25 Thread Jim Lucas

give this a shot

html
headtitleitems and notes/title/head
body
?php
$user=feeds;
$host=localhost;
$password=password;
$database = feeds;

$connection = mysql_connect($host,$user,$password) or die (couldn't connect to 
server);
$db = mysql_select_db($database,$connection) or die (Couldn't select 
database);

$query = SELECT * FROM contacts, px_items WHERE contacts.id=px_items.id ORDER BY 
px_items.id DESC;

$result = mysql_query($query) or die (Couldn't execute query.);

$title = '';
while ($row = mysql_fetch_array($result)) {
if ( $title != $row['title'] ) {
$title = $row['title'];
echo h2{$title}/h2;
}
echonbsp;nbsp;{$id} - {$content} - {$timestamp} - {$notes} - .
a href=\{$link}\{$link}/abr;
}//while
?
/body
/html


This should do the trick

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different strings. But there are times 
for you and me when all such things agree.


- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing a one-to-many relationship

2007-04-25 Thread Richard Lynch

$last_entry = 'an extremely unlikely entry';
while (list($entry, $note) = mysql_fetch_row($entries)){
  if ($entry != $last_entry){
echo $entry;
$last_entry = $entry;
  }
  echo $note;
}


On Wed, April 25, 2007 1:35 pm, Thufir wrote:
 There's a one-to-many relationship between px_items.id and
 contacts.id, and I
 want a printout of some data from each.

 I want to print out the query results px_items.id field once and once
 only, but
 the contacts.notes field many times, as there could be many entries.

 Right now it prints out each row, which is workable for now, but could
 get
 annoying.  I'm trying for something like


 entry one
 note a
 note b
 note c

 entry two
 note a

 entry three
 notb a
 note b



 Here's my schema and code:

 [EMAIL PROTECTED] ~]#
 [EMAIL PROTECTED] ~]# cat /var/www/html/items_notes.php -n
  1  html
  2  headtitleitems and notes/title/head
  3  body
  4  ?php
  5  $user=feeds;
  6  $host=localhost;
  7  $password=password;
  8  $database = feeds;
  9
 10  $connection = mysql_connect($host,$user,$password)
 11  or die (couldn't connect to server);
 12  $db = mysql_select_db($database,$connection)
 13  or die (Couldn't select database);
 14
 15
 16  $query = SELECT * FROM contacts, px_items WHERE
 contacts.id=px_items.id ORDER BY px_items.id DESC;
 17
 18  $result = mysql_query($query)
 19  or die (Couldn't execute query.);
 20
 21  while ($row = mysql_fetch_array($result))
 22  {
 23  extract ($row);
 24
 25  echo bigbigb;
 26  echo $id;
 27  echo /b/big/big;
 28
 29  echo br;
 30  echo $title;
 31
 32  echo br;
 33  echo $content;
 34  echo br;
 35
 36  echo br;
 37  echo $timestamp;
 38  echo br;
 39
 40  echo br;
 41  echo $notes;
 42  echo br;
 43
 44  echo a href=\;
 45  echo $link;
 46  echo \;
 47  echo $link;
 48  echo /a;
 49
 50  echo brbr;
 51
 52  }//while
 53  ?
 54  /body
 55  /html
 [EMAIL PROTECTED] ~]#
 [EMAIL PROTECTED] ~]#
 [EMAIL PROTECTED] ~]#
 [EMAIL PROTECTED] ~]# mysql -u feeds -p
 Enter password:
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 25 to server version: 5.0.27

 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 mysql use feeds;
 Reading table information for completion of table and column names
 You can turn off this feature to get a quicker startup with -A

 Database changed
 mysql show tables;
 +-+
 | Tables_in_feeds |
 +-+
 | contacts|
 | px_feeds|
 | px_items|
 +-+
 3 rows in set (0.00 sec)

 mysql describe contacts;
 +---+---+--+-+---+---+
 | Field | Type  | Null | Key | Default   | Extra |
 +---+---+--+-+---+---+
 | id| int(11)   | YES  | MUL | NULL  |   |
 | timestamp | timestamp | NO   | | CURRENT_TIMESTAMP |   |
 | notes | longtext  | YES  | | NULL  |   |
 +---+---+--+-+---+---+
 3 rows in set (0.07 sec)

 mysql describe px_items;
 +---+--+--+-+---++
 | Field | Type | Null | Key | Default   | Extra
   |
 +---+--+--+-+---++
 | id| int(11)  | NO   | PRI | NULL  |
 auto_increment |
 | feed_id   | int(11)  | NO   | MUL | 0 |
   |
 | timestamp | timestamp| NO   | | CURRENT_TIMESTAMP |
   |
 | link  | text | YES  | | NULL  |
   |
 | title | varchar(250) | YES  | | NULL  |
   |
 | content   | text | YES  | | NULL  |
   |
 | dcdate| text | YES  | | NULL  |
   |
 | dccreator | text | YES  | | NULL  |
   |
 | dcsubject | text | YES  | | NULL  |
   |
 | read  | tinyint(4)   | YES  | MUL | NULL  |
   |
 +---+--+--+-+---++
 10 rows in set (0.00 sec)

 mysql quit
 Bye
 [EMAIL PROTECTED] ~]#
 [EMAIL PROTECTED] ~]# date
 Wed Apr 25 19:30:38 BST 2007
 [EMAIL 

[PHP] printing page functionality

2006-11-16 Thread Ulf Hyltmark
Hi,

We are in need of a printing functionality for our webpage.
The problem is that some of our pages has a greater width than a A4 paper
so not all of the content will be printed when using the built in printer
functionality in the browser.

Is there any useful script out there that can take the necessary content of
the page and convert it to
simple text and columns that will fit the paper when printing?

or even better, a server application that can take the full content of the
page and convert it to
pdf or an image in a rescaled version that will fit the A4 paper?

I've had a look at these HTML to PDF conversion apps:
http://www.digitaljunkies.ca/dompdf/
http://www.rustyparts.com/pdf.php

But they don't really cut it as we are using relative and absolute
positioned divs and they don't
have support for this.

Thanks in advance
-Ulf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] printing special characters in PHP

2006-07-11 Thread Antonio Bassinger

Dear ALL,

I've an binary file with special (non-printable) characters including ''
'/'  ''. I retrieve this file from the database, into a variable
$binaryFILE.

I then copy the content to a temporary file, opened with handle $handle :


if (!fwrite($handle, $binaryFILE)) {
  echo Failed to copy $bname...;
  }
  else
  {
  echo Success;
  }

The file copies to a file on the filesystem correctly. However, if I try to
print out the characters of this file on a browser, using

echo $binaryFILE;

the output isn't the same. The characters '' and '' and anything included
within is not printed.

I tried printing line by line, using:

$binaryMS = explode(,$binaryMMS);
foreach ($binaryFILE as $ii)
{
 echo $ii;
}

However, no change in result.

Do I print character by character? I shall appreciate any pointers on this
problem.

Many Thanks
Antonio


Re: [PHP] printing special characters in PHP

2006-07-11 Thread Jochem Maas
Antonio Bassinger wrote:
 Dear ALL,
 
 I've an binary file with special (non-printable) characters including ''
 '/'  ''. I retrieve this file from the database, into a variable

those 3 chars are not non-printable (the fact that I see them in this email is
proof enough.

 $binaryFILE.
 
 I then copy the content to a temporary file, opened with handle $handle :
 
 
 if (!fwrite($handle, $binaryFILE)) {
   echo Failed to copy $bname...;
   }
   else
   {
   echo Success;
   }
 
 The file copies to a file on the filesystem correctly. However, if I try to
 print out the characters of this file on a browser, using
 
 echo $binaryFILE;
 
 the output isn't the same. The characters '' and '' and anything included
 within is not printed.
 
 I tried printing line by line, using:
 
 $binaryMS = explode(,$binaryMMS);
 foreach ($binaryFILE as $ii)
 {
  echo $ii;
 }
 
 However, no change in result.
 
 Do I print character by character? I shall appreciate any pointers on this
 problem.

either do 'view source' in your browser or pass the string through the 
htmlentities()
function - the reason you don't see stuff in between the LT and GT chars has to 
do
with the markup used for HTML tags  think about it for a second :-)

 
 Many Thanks
 Antonio
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing special characters in PHP

2006-07-11 Thread nicolas figaro

Antonio Bassinger a écrit :

Dear ALL,

I've an binary file with special (non-printable) characters including ''
'/'  ''. I retrieve this file from the database, into a variable
$binaryFILE.

$binaryMS = explode(,$binaryMMS);
foreach ($binaryFILE as $ii)
{
 echo $ii;

try this :
echo htmlspecialchars($ii);

N F

}

However, no change in result.

Do I print character by character? I shall appreciate any pointers on 
this

problem.

Many Thanks
Antonio




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] printing special characters in PHP

2006-07-11 Thread tedd
At 10:16 AM + 7/11/06, Antonio Bassinger wrote:
Dear ALL,

I've an binary file with special (non-printable) characters including ''
'/'  ''. I retrieve this file from the database, into a variable
$binaryFILE.

I then copy the content to a temporary file, opened with handle $handle :


if (!fwrite($handle, $binaryFILE)) {
  echo Failed to copy $bname...;
  }
  else
  {
  echo Success;
  }

The file copies to a file on the filesystem correctly. However, if I try to
print out the characters of this file on a browser, using

echo $binaryFILE;

the output isn't the same. The characters '' and '' and anything included
within is not printed.

I tried printing line by line, using:

$binaryMS = explode(,$binaryMMS);
foreach ($binaryFILE as $ii)
{
 echo $ii;
}

However, no change in result.

Do I print character by character? I shall appreciate any pointers on this
problem.

Many Thanks
Antonio

Antonio:

The reason why you are not seeing the characters is that they are being 
grabbed-up by the browser as html code. In other words, you are injecting html 
into your web page.

Take a look at this:

http://www.weberdev.com/htmlentities

Now, pass your content through this function and then display.

tedd



-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing in php

2006-07-05 Thread BBC
 weetat wrote:
  Hi all ,
 
   I am using PHP 4.3.2 and MYSQL .
 
   I need to do printing function in php .
   Basically , in my client web page , it will display the list of items
  on the html page. And i have a print button , so that the user can print
  the html page to their local printer.
 
  Any way how to do this in PHP ?

I believe someone already told you,
I guess we can't do it in PHP, so why not in JavaScript
Sorry I don't mean to take you belittle, but I write this completely for
easy to look for others:
a href=”#” action=window.print();return falsePrint this page/a
 Best Regards
BBC
 **o0o**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing in php

2006-07-04 Thread Ligaya Turmelle

weetat wrote:

Hi all ,

 I am using PHP 4.3.2 and MYSQL .

 I need to do printing function in php .
 Basically , in my client web page , it will display the list of items 
on the html page. And i have a print button , so that the user can print 
the html page to their local printer.


Any way how to do this in PHP ?

Thanks


alternate method - CSS media print.

--

life is a game... so have fun.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Printing in php

2006-07-03 Thread weetat

Hi all ,

 I am using PHP 4.3.2 and MYSQL .

 I need to do printing function in php .
 Basically , in my client web page , it will display the list of items 
on the html page. And i have a print button , so that the user can print 
the html page to their local printer.


Any way how to do this in PHP ?

Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing in php

2006-07-03 Thread Chris

weetat wrote:

Hi all ,

 I am using PHP 4.3.2 and MYSQL .

 I need to do printing function in php .
 Basically , in my client web page , it will display the list of items 
on the html page. And i have a print button , so that the user can print 
the html page to their local printer.


Any way how to do this in PHP ?


No, but you can in javascript.

window.print();


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing in php

2006-07-03 Thread Richard Lynch
On Mon, July 3, 2006 3:53 am, weetat wrote:
   I am using PHP 4.3.2 and MYSQL .

   I need to do printing function in php .
   Basically , in my client web page , it will display the list of
 items
 on the html page. And i have a print button , so that the user can
 print
 the html page to their local printer.

 Any way how to do this in PHP ?

How many times on this very list have you been told that PHP runs on
the server?

Think about it.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing with php

2006-05-03 Thread Mace Eliason

Hi

I am working on a project that creates invoices.  It will allow the 
client to print out these invoices after they have been created.


Something that I have always noticed is that when you print form the 
internet you always get the site address and other info on the print out.


Is there a way to eliminate this?  I just want the invoice to print.

Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing with php

2006-05-03 Thread John Wells

On 5/3/06, Mace Eliason [EMAIL PROTECTED] wrote:

Hi

I am working on a project that creates invoices.  It will allow the
client to print out these invoices after they have been created.

Something that I have always noticed is that when you print form the
internet you always get the site address and other info on the print out.

Is there a way to eliminate this?  I just want the invoice to print.

Thanks


Has nothing to do with PHP (or any code for that matter), it's all in
the browser settings.  You can't do a thing about it.  If you're
really concerned, convert it to a PDF that the user downloads and
prints.

HTH,
John W

p.s. Ok technically I  think that if you're in an PC IE-only
environment you can use ActiveX or something else to control this, but
even so I'm categorically against controlling a user's local
settings/prefs/etc.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing with php

2006-05-03 Thread tg-php
Couple of things you can try..

1. If you have control of the browsers being used, there may be a setting to 
turn off the address printing (I seem to remember something like that.. but 
don't remember what browser it was).

2. CSS2 has some print control functionality that might help

3. (more PHP relevant answer) Why not create PDFs out of your invoices and 
initiate a print of that instead of a web page?  Check out the stock PDF 
functions or libraries like FPDF and PDFLib.

Good luck!

-TG

= = = Original message = = =

Hi

I am working on a project that creates invoices.  It will allow the 
client to print out these invoices after they have been created.

Something that I have always noticed is that when you print form the 
internet you always get the site address and other info on the print out.

Is there a way to eliminate this?  I just want the invoice to print.

Thanks


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing library in PHP ?

2006-03-20 Thread robert mena
Hi Steve,

This seems to be a good alternative.  I've found pdflib($), ezPDF (dead?) e
this fpdf as different ways to generate pdf.

One drawback is that I'd have to construct all my documents 'by hand'.  For
trully dynamic this is no problem but for those that only differs at the
name of the client that would represent too much work for a little gain.

After some research it seems that there is a tool called docbook that allows
me to convert it's format (a XML based?) into a lot of things, PDF included.

Well, I have two ways now:
- use a pdf library for those dynamic reports
- convert my word documents into docbook (using an editor), put some
placeholders and using PHP to replace the placeholders with actual data
(such as name, price) and call docbook to generate the pdf.

- rm

On 3/14/06, Steve Brown [EMAIL PROTECTED] wrote:

  I am currently migrating an application originally written with Delphi
 to
  PHP.  Everything is going fine except the printing of the reports that
 does
  not produce the same visual result (i.e does not look the same or has
 some
  aligmment issues).

 We generate all of our printed reports using FPDF
 (http://www.fpdf.org) to generate PDF files.  Its very flexible, can
 do must of what you are aksing for, and unlike some alternatives, its
 free.PDFs are going to be the easiest way to get total control of
 the output.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Printing library in PHP ?

2006-03-14 Thread Steve Brown
 I am currently migrating an application originally written with Delphi to
 PHP.  Everything is going fine except the printing of the reports that does
 not produce the same visual result (i.e does not look the same or has some
 aligmment issues).

We generate all of our printed reports using FPDF
(http://www.fpdf.org) to generate PDF files.  Its very flexible, can
do must of what you are aksing for, and unlike some alternatives, its
free.PDFs are going to be the easiest way to get total control of
the output.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing library in PHP ?

2006-03-13 Thread robert mena
Hi,

I am currently migrating an application originally written with Delphi to
PHP.  Everything is going fine except the printing of the reports that does
not produce the same visual result (i.e does not look the same or has some
aligmment issues).

From what I've read I should use CSS to achieve such result but I was
wondering if there is any toolkit, library in PHP that would ease my work.

For example:
I have a specific report I have to add a header to each page
I have another one with tabular data that when the result is larger than a
page I should break the table and start at the next page so the table
headers can be seen again...

In both I'd need a way to decide/find out how many pages will be necessary
(given the size of the paper sheet) so I could generate the HTML correctly.


Re: [PHP] printing keys and values of array

2006-01-06 Thread tg-php
I agree with the previous responder, foreach() is the way to go. Here's the doc 
page:

http://uk2.php.net/manual/en/control-structures.foreach.php


To get the keys, use the examples that are use $key = $value.


Assuming your array is in $infoArr, you'd do this:

foreach ($infoArr as $category = $data) {

  echo $category:$databr\n;

}


Also, if you ever needed to get just the keys or just the values of an array, 
you can use:

array_keys()
and
array_values()

Both return an array.

Good luck!

-TG

= = = Original message = = =

Hi
i need some help with printing an array, i would like to print the
keys and the values of them
example :

if i have an array like that


[EXTENDED] = Array
(
[RTCode] = CASE395
[ManuPartNum] = 1BRA1ACFB
[Colour] = WHITE
[Compatibility] = (ATX/E ATX)
[PowerSupply] = YES
[PowerSupplySize] = redundant 337W2
[ExtDriveBays] = 3 x 5.25 1 x 3.5
[IntDriveBays] = 6 x 5.25
[USBPortsFront] = no
[FirewirePortsFront] = no
[AudioPortsFront] = no
[CaseFan] = 8cm FAN2  12cm FAN1  P/S2
[NumCaseFans] = 5
[FreeCaseFanPoints] = No
[Material] = Stainless steel
[Window] = No
[Packaging] = Retail
[Warranty] = 24 months for the PSU
[BoxContents] = Manual
[CartonHeight] = 735mm
[CartonWidth] = 285mm
[CartonDepth] = 585mm
[ItemsPerCarton] = 1
[CartonWeight] = 1.6kg
[EAN] =
[BoxWeight] =
[ItemHeight] =
[ItemWidth] =
[ItemDepth] =
)

and i like to print it this way

RTCode:CASE395
ManuPartNum] :1BRA1ACFB
Colour] :WHITE
Compatibility :(ATX/E ATX)
PowerSupply :YES
PowerSupplySize:redundant 337W2
ExtDriveBays:3 x 5.25 1 x 3.5
IntDriveBays:6 x 5.25
USBPortsFront:no
FirewirePortsFront:no
AudioPortsFront:no
CaseFan:8cm FAN2  12cm FAN1  P/S2
NumCaseFans:5
FreeCaseFanPoints] = No
Material :Stainless steel
Window :No
Packaging:Retail
Warranty:24 months for the PSU
BoxContents:Manual
CartonHeight:735mm
CartonWidth:285mm
CartonDepth:585mm
ItemsPerCarton:1
CartonWeight:1.6kg
EAN:
BoxWeight:
ItemHeight:
ItemWidth:
ItemDepth:

can anyone tell me plz how to do that ?
any help would be appreciated

thanks in advance

--
Ahmed Abdel-Aliem
Web Developer
www.SafariStudio.net
+20101108551
registered Linux user number 382789


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] printing keys and values of array

2006-01-05 Thread Ahmed Abdel-Aliem
Hi
i need some help with printing an array, i would like to print the
keys and the values of them
example :

if i have an array like that


[EXTENDED] = Array
(
[RTCode] = CASE395
[ManuPartNum] = 1BRA1ACFB
[Colour] = WHITE
[Compatibility] = (ATX/E ATX)
[PowerSupply] = YES
[PowerSupplySize] = redundant 337W2
[ExtDriveBays] = 3 x 5.25 1 x 3.5
[IntDriveBays] = 6 x 5.25
[USBPortsFront] = no
[FirewirePortsFront] = no
[AudioPortsFront] = no
[CaseFan] = 8cm FAN2  12cm FAN1  P/S2
[NumCaseFans] = 5
[FreeCaseFanPoints] = No
[Material] = Stainless steel
[Window] = No
[Packaging] = Retail
[Warranty] = 24 months for the PSU
[BoxContents] = Manual
[CartonHeight] = 735mm
[CartonWidth] = 285mm
[CartonDepth] = 585mm
[ItemsPerCarton] = 1
[CartonWeight] = 1.6kg
[EAN] =
[BoxWeight] =
[ItemHeight] =
[ItemWidth] =
[ItemDepth] =
)

and i like to print it this way

RTCode:CASE395
ManuPartNum] :1BRA1ACFB
Colour] :WHITE
Compatibility :(ATX/E ATX)
PowerSupply :YES
PowerSupplySize:redundant 337W2
ExtDriveBays:3 x 5.25 1 x 3.5
IntDriveBays:6 x 5.25
USBPortsFront:no
FirewirePortsFront:no
AudioPortsFront:no
CaseFan:8cm FAN2  12cm FAN1  P/S2
NumCaseFans:5
FreeCaseFanPoints] = No
Material :Stainless steel
Window :No
Packaging:Retail
Warranty:24 months for the PSU
BoxContents:Manual
CartonHeight:735mm
CartonWidth:285mm
CartonDepth:585mm
ItemsPerCarton:1
CartonWeight:1.6kg
EAN:
BoxWeight:
ItemHeight:
ItemWidth:
ItemDepth:

can anyone tell me plz how to do that ?
any help would be appreciated

thanks in advance

--
Ahmed Abdel-Aliem
Web Developer
www.SafariStudio.net
+20101108551
registered Linux user number 382789

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing keys and values of array

2006-01-05 Thread Zareef Ahmed
read  about  foreach  function. 


Zareef Ahmd

- Original Message - 
From: Ahmed Abdel-Aliem [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Thursday, January 05, 2006 7:58 PM
Subject: [PHP] printing keys and values of array


Hi
i need some help with printing an array, i would like to print the
keys and the values of them
example :

if i have an array like that


[EXTENDED] = Array
(
[RTCode] = CASE395
[ManuPartNum] = 1BRA1ACFB
[Colour] = WHITE
[Compatibility] = (ATX/E ATX)
[PowerSupply] = YES
[PowerSupplySize] = redundant 337W2
[ExtDriveBays] = 3 x 5.25 1 x 3.5
[IntDriveBays] = 6 x 5.25
[USBPortsFront] = no
[FirewirePortsFront] = no
[AudioPortsFront] = no
[CaseFan] = 8cm FAN2  12cm FAN1  P/S2
[NumCaseFans] = 5
[FreeCaseFanPoints] = No
[Material] = Stainless steel
[Window] = No
[Packaging] = Retail
[Warranty] = 24 months for the PSU
[BoxContents] = Manual
[CartonHeight] = 735mm
[CartonWidth] = 285mm
[CartonDepth] = 585mm
[ItemsPerCarton] = 1
[CartonWeight] = 1.6kg
[EAN] =
[BoxWeight] =
[ItemHeight] =
[ItemWidth] =
[ItemDepth] =
)

and i like to print it this way

RTCode:CASE395
ManuPartNum] :1BRA1ACFB
Colour] :WHITE
Compatibility :(ATX/E ATX)
PowerSupply :YES
PowerSupplySize:redundant 337W2
ExtDriveBays:3 x 5.25 1 x 3.5
IntDriveBays:6 x 5.25
USBPortsFront:no
FirewirePortsFront:no
AudioPortsFront:no
CaseFan:8cm FAN2  12cm FAN1  P/S2
NumCaseFans:5
FreeCaseFanPoints] = No
Material :Stainless steel
Window :No
Packaging:Retail
Warranty:24 months for the PSU
BoxContents:Manual
CartonHeight:735mm
CartonWidth:285mm
CartonDepth:585mm
ItemsPerCarton:1
CartonWeight:1.6kg
EAN:
BoxWeight:
ItemHeight:
ItemWidth:
ItemDepth:

can anyone tell me plz how to do that ?
any help would be appreciated

thanks in advance

--
Ahmed Abdel-Aliem
Web Developer
www.SafariStudio.net
+20101108551
registered Linux user number 382789

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] printing keys and values of array

2006-01-05 Thread Brady Mitchell
 -Original Message-
 i need some help with printing an array, i would like to 
 print the keys and the values of them example :

I use the dump_array posted by examancer at the following address:
http://www.phpbuilder.com/board/showthread.php?t=10213508 when
debugging, it should work well for you.

Brady

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing keys and values of array

2006-01-05 Thread Jim Moseby

Ahmed Abdel-Aliem wrote:


...

and i like to print it this way

RTCode:CASE395
...
 



foreach($array as $key=$value){echo $key.':'.$value;}

JM

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PRINTing Problem with CheckBox

2005-11-21 Thread Chirantan Ghosh
Hi All,

I have developed this form where people click the check boxes of interested 
phone numbers which gets emailed to me.

My ACT guys tells me I need to print all the Check Box values as unique fields 
for his intake.

I have posted the problem in detail in following URL:
http://www.primarywave.com/NONworkingCODE.txt

Can anyone please help me sort this out.

 Thanks,
C


Re: [PHP] Printing to a buffer

2005-11-14 Thread Richard Lynch
On Sun, November 13, 2005 8:20 am, Marcus Bointon wrote:

 On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

 seem to do that.  I just tried application/text since I use
 application/pdf for other applications.

 Whatever it's giving the user the ability to do, it's probably
 because the browser doesn't recognise the (invalid) MIME-Type.

 Quite - it's right up there with 'application/force-download'. If you
 want to suggest (the final choice is not yours to make) that a
 browser might download something instead of displaying it, set an
 appropriate content-disposition header instead of setting the wrong
 type.

E.

It may not be my final choice whether they download or not, but if a
browser doesn't treat:
application/octet-stream
as a download, and only as a download, then that browser is pretty
broken.

Letting the user configure their browser for that MIME type to be
opened by an application is just plain wrong for a browser, by
specification.

If you find a browser that lets you configure application/octet-stream
to be opened with a specific application, then file a bug report with
whomever wrote that browser.

All the other johnny-come-lately hacks from Redmond to 'force'
downloads are highly suspect and non-portable, and should be avoided
if you want to keep your hair.

You can't rely on Content-disposition ... filename either, so you
either make the URL end in the filename you want as the default, or
you can count on some browsers using some other filename.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-14 Thread Richard Lynch




On Sun, November 13, 2005 1:53 pm, Marcus Bointon wrote:
 On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:

 Many thanks!  I did not know that MIME-Type.  Change duly made!

 You're not suggesting that you actually set the MIME-Type to
 application/force-download, are you?

 I think he is. I've called the MIME-type police and they'll be round
 later.

 Todd, I think you should read this: http://support.microsoft.com/kb/
 q260519/

 There's a PHP example just before the user notes here: http://
 www.php.net/header

 Marcus
 --
 Marcus Bointon
 Synchromedia Limited: Putting you in the picture
 [EMAIL PROTECTED] | http://www.synchromedia.co.uk

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-14 Thread Richard Lynch
On Sun, November 13, 2005 4:55 pm, Todd Cary wrote:
 Because this was just a test of what will be many print lines.  The
 original application used a file to hold the data and upon request by
 the user, it was emailed.  But with my client's shared server, files
 cannot be opened...a pain.

 If you have a better solution, I am open to other ideas.

Switch hosts?
:-^

PS
I'll say it again:
Content-disposition will give you grief from older browsers.
Content-type: application/octet-stream will just work

To get the filename default prompt, tack the filename onto the end of
your URL.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-14 Thread Marcus Bointon

On 14 Nov 2005, at 19:01, Richard Lynch wrote:


It may not be my final choice whether they download or not, but if a
browser doesn't treat:
application/octet-stream
as a download, and only as a download, then that browser is pretty
broken.

Letting the user configure their browser for that MIME type to be
opened by an application is just plain wrong for a browser, by
specification.

If you find a browser that lets you configure application/octet-stream
to be opened with a specific application, then file a bug report with
whomever wrote that browser.


There's no such spec for browsers per se (which is why they vary so  
much) - they are just HTTP clients. I can think of a perfectly  
reasonable situation where I would want a plugin to handle  
application/octet-stream - say I'm pulling some arbitrary binary data  
and while I'm debugging, an in-browser hex dump could be very useful.  
The other thing is that I may be being forced to use that 'wrong'  
MIME type to work around bad implementations of content- 
disposition... I know that's not a common situation, but there should  
be nothing preventing me from doing it. There are browsers that don't  
do downloads at all (I've written some), there are others that do  
nothing but downloads (I use Interarchy for just that). I could offer  
a similar opinion about the browsers that have odd implementations of  
content-disposition.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread Marcus Bointon


On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

seem to do that.  I just tried application/text since I use  
application/pdf for other applications.


Whatever it's giving the user the ability to do, it's probably  
because the browser doesn't recognise the (invalid) MIME-Type.


Quite - it's right up there with 'application/force-download'. If you  
want to suggest (the final choice is not yours to make) that a  
browser might download something instead of displaying it, set an  
appropriate content-disposition header instead of setting the wrong  
type.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread Todd Cary

Marcus -

Many thanks!  I did not know that MIME-Type.  Change duly made!

Todd

Marcus Bointon wrote:


On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

seem to do that.  I just tried application/text since I use  
application/pdf for other applications.



Whatever it's giving the user the ability to do, it's probably  
because the browser doesn't recognise the (invalid) MIME-Type.



Quite - it's right up there with 'application/force-download'. If you  
want to suggest (the final choice is not yours to make) that a  browser 
might download something instead of displaying it, set an  appropriate 
content-disposition header instead of setting the wrong  type.


Marcus


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread Jasper Bryant-Greene

Todd Cary wrote:

Marcus -

Many thanks!  I did not know that MIME-Type.  Change duly made!


You're not suggesting that you actually set the MIME-Type to 
application/force-download, are you?





Todd

Marcus Bointon wrote:


On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

seem to do that.  I just tried application/text since I use  
application/pdf for other applications.



Whatever it's giving the user the ability to do, it's probably  
because the browser doesn't recognise the (invalid) MIME-Type.



Quite - it's right up there with 'application/force-download'. If you  
want to suggest (the final choice is not yours to make) that a  
browser might download something instead of displaying it, set an  
appropriate content-disposition header instead of setting the wrong  
type.


Marcus




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread Marcus Bointon

On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:


Many thanks!  I did not know that MIME-Type.  Change duly made!


You're not suggesting that you actually set the MIME-Type to  
application/force-download, are you?


I think he is. I've called the MIME-type police and they'll be round  
later.


Todd, I think you should read this: http://support.microsoft.com/kb/ 
q260519/


There's a PHP example just before the user notes here: http:// 
www.php.net/header


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread Todd Cary


Just before the police knocked at my door, I made a few changes!

?
  ob_start();
  print This is a testbr;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: text/plain);
  header(Content-Length: $len);
  header(Content-Disposition: attachment; filename=sfyc.html);
  print($buf);
?

Todd
Marcus Bointon wrote:

On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:


Many thanks!  I did not know that MIME-Type.  Change duly made!



You're not suggesting that you actually set the MIME-Type to  
application/force-download, are you?



I think he is. I've called the MIME-type police and they'll be round  
later.


Todd, I think you should read this: http://support.microsoft.com/kb/ 
q260519/


There's a PHP example just before the user notes here: http:// 
www.php.net/header


Marcus


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread M. Sokolewicz

call me stupid, but why don't you do it like this:

$buf = This is a testbr;
header(Content-type: text/plain);
header(Content-Length: .strlen($buf));
header(Content-Disposition: attachment; filename=sfyc.html);
echo $buf;

??
looks easier to me... no output buffering required...

Todd Cary wrote:


Just before the police knocked at my door, I made a few changes!

?
  ob_start();
  print This is a testbr;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: text/plain);
  header(Content-Length: $len);
  header(Content-Disposition: attachment; filename=sfyc.html);
  print($buf);
?

Todd
Marcus Bointon wrote:


On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:


Many thanks!  I did not know that MIME-Type.  Change duly made!




You're not suggesting that you actually set the MIME-Type to  
application/force-download, are you?




I think he is. I've called the MIME-type police and they'll be round  
later.


Todd, I think you should read this: http://support.microsoft.com/kb/ 
q260519/


There's a PHP example just before the user notes here: http:// 
www.php.net/header


Marcus


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-13 Thread Todd Cary
Because this was just a test of what will be many print lines.  The 
original application used a file to hold the data and upon request by 
the user, it was emailed.  But with my client's shared server, files 
cannot be opened...a pain.


If you have a better solution, I am open to other ideas.

Todd

M. Sokolewicz wrote:

call me stupid, but why don't you do it like this:

$buf = This is a testbr;
header(Content-type: text/plain);
header(Content-Length: .strlen($buf));
header(Content-Disposition: attachment; filename=sfyc.html);
echo $buf;

??
looks easier to me... no output buffering required...

Todd Cary wrote:



Just before the police knocked at my door, I made a few changes!

?
  ob_start();
  print This is a testbr;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: text/plain);
  header(Content-Length: $len);
  header(Content-Disposition: attachment; filename=sfyc.html);
  print($buf);
?

Todd
Marcus Bointon wrote:


On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:


Many thanks!  I did not know that MIME-Type.  Change duly made!





You're not suggesting that you actually set the MIME-Type to  
application/force-download, are you?





I think he is. I've called the MIME-type police and they'll be round  
later.


Todd, I think you should read this: http://support.microsoft.com/kb/ 
q260519/


There's a PHP example just before the user notes here: http:// 
www.php.net/header


Marcus


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Printing to a buffer

2005-11-12 Thread Todd Cary
My client's new shared server does not allow printing to a file, so I 
want my print statement to print to a buffer, then I'll send it to the 
user via Headers.  This does not work since print does no go to the 
buffer, or at least appears not to: I get the errors from the header 
statements;


?
  ob_start;
  print This is a testbf;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: application/text);
  header(Content-Length: $len);
  header(Content-Disposition: inline; filename=Sfyc.html);
  print($buf);
?

Todd

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-12 Thread Jasper Bryant-Greene

Todd Cary wrote:
My client's new shared server does not allow printing to a file, so I 
want my print statement to print to a buffer, then I'll send it to the 
user via Headers.  This does not work since print does no go to the 
buffer, or at least appears not to: I get the errors from the header 
statements;


?
  ob_start;


You're missing some parentheses on the ob_start function. I think you 
meant to write:


ob_start();


  print This is a testbf;


You probably meant br in that string too.


  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: application/text);


application/text isn't a MIME-Type, is it? Do you mean text/plain?


  header(Content-Length: $len);
  header(Content-Disposition: inline; filename=Sfyc.html);
  print($buf);
?

Todd



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Printing to a buffer

2005-11-12 Thread php-mail


-Original Message-
From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
[snip]
application/text isn't a MIME-Type, is it? Do you mean text/plain?
[/snip]

Or maybe text/html?

Sent: 12 November 2005 22:46
To: Todd Cary
Cc: php-general@lists.php.net
Subject: Re: [PHP] Printing to a buffer

Todd Cary wrote:
 My client's new shared server does not allow printing to a file, so I 
 want my print statement to print to a buffer, then I'll send it to the 
 user via Headers.  This does not work since print does no go to the 
 buffer, or at least appears not to: I get the errors from the header 
 statements;
 
 ?
   ob_start;

You're missing some parentheses on the ob_start function. I think you 
meant to write:

ob_start();

   print This is a testbf;

You probably meant br in that string too.

   $buf = ob_get_contents();
   $len = strlen($buf);
   ob_end_clean();
   header(Content-type: application/text);

application/text isn't a MIME-Type, is it? Do you mean text/plain?

   header(Content-Length: $len);
   header(Content-Disposition: inline; filename=Sfyc.html);
   print($buf);
 ?
 
 Todd
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__ NOD32 1.1284 (2005) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-12 Thread Todd Cary

Yup!  It was the missing parentheses!  Works as planned.

Many thanks

The application/text gives the user the ability; text/plain does not 
seem to do that.  I just tried application/text since I use 
application/pdf for other applications.


Todd

Jasper Bryant-Greene wrote:

Todd Cary wrote:

My client's new shared server does not allow printing to a file, so I 
want my print statement to print to a buffer, then I'll send it to the 
user via Headers.  This does not work since print does no go to the 
buffer, or at least appears not to: I get the errors from the header 
statements;


?
  ob_start;



You're missing some parentheses on the ob_start function. I think you 
meant to write:


ob_start();


  print This is a testbf;



You probably meant br in that string too.


  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: application/text);



application/text isn't a MIME-Type, is it? Do you mean text/plain?


  header(Content-Length: $len);
  header(Content-Disposition: inline; filename=Sfyc.html);
  print($buf);
?

Todd



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Printing to a buffer

2005-11-12 Thread Jasper Bryant-Greene

Todd Cary wrote:

Yup!  It was the missing parentheses!  Works as planned.

Many thanks

The application/text gives the user the ability; text/plain does not 


The ability to...?

seem to do that.  I just tried application/text since I use 
application/pdf for other applications.


Whatever it's giving the user the ability to do, it's probably because 
the browser doesn't recognise the (invalid) MIME-Type.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] printing from php

2005-10-29 Thread Richard Lynch
On Fri, October 28, 2005 6:17 am, Tom Cruickshank wrote:
  I've been reading up on printing out documents using PHP (using
 Printer
 functions calls in the php manual)

 I'm using a Linux and/or FreeBSD operating system to run my php code
 on (in
 apache). However, I am surfing these pages using a Windows XP machine.

 Has anyone ever tried having a print button (or link) in php that
 would make
 Whatever page is being displayed being printed with the above
 scenario?

 How might you of gone about it to make it work? (the Linux or FreeBSD
 box is
 not configured to have a printer on it, shared or local, does that
 make a
 difference? )

If you are trying to get the print-out on a printer tied to the
server, PHP is maybe going to be involved.

If you want it printed to a printer tied to the client (browser) PHP
is long-gone and has nothing to do with it by the time you click on
Print button.

There are a bunch of JavaScript print buttons/links/scripts you can
find with Google to help.

If you need your HTML to be made printer-friendly BEFORE you print it,
PHP and http://php.net/pdflib may help.  Or is it
http://php.net/libpdf? I can never remember.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   3   4   >