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



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



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



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



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



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



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



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



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



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 

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

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



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



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



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



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



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



Re: [PHP] printing from php

2005-10-28 Thread Jochem Maas

don't post a new question to an existing thread - it lessens your exposure!

Tom Cruickshank wrote:

Hello,
 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? )


either you let the client (browser) print the page - this has nothing to do with
php OR you let the server print 'something' (based on a specific request from 
the user
- i.e. he clicked on 'print' link or something) in which case you will _need_
to have access to a printer from the server (i.e. it needs to have a printer 
configured)

basically if the server 'has' no printer it can't print.



Would appreciate any feedback. Thanks!

Tom




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



Re: [PHP] Printing \n and \r to the screen

2005-08-25 Thread Richard Lynch
On Wed, August 24, 2005 8:33 am, Dotan Cohen wrote:
 I seem to be having trouble with \n and \r in variables. I write my
 code on a linux box, and the server is linux. So I should always have
 \n\r, no? Is there a way the I could print $variable; and have it show
 me the /n and /r 's ? I tried with a srt_replace() on /n and on /r,
 but they do not get replaced. I also tried escaping the backslash,
 then double escaping that as was suggested somewhere in the
 php.net/manual, then triple escaping!

Windows uses \r\n
Linux uses \n
Mac uses \r

Depending on what tools you use to read/write/create the files, and
where the data comes from, it's possible that you have any of those
formats.

This is especially true of FORM data from a TEXTAREA.

I frequently do this:

$text = $_POST['text'];
$text = str_replace(\r\n, \n, $text);
$text = str_replace(\r, \n, $text);
//Now I *know* it's in Linux newline format.

-- 
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 \n and \r to the screen

2005-08-25 Thread Rory Browne
If you're reading this text from a file, and then splitting it into
seperate lines, then I personally think you should leave this to the
built-in file() function.



On 8/24/05, Dotan Cohen [EMAIL PROTECTED] wrote:
 I seem to be having trouble with \n and \r in variables. I write my
 code on a linux box, and the server is linux. So I should always have
 \n\r, no? Is there a way the I could print $variable; and have it show
 me the /n and /r 's ? I tried with a srt_replace() on /n and on /r,
 but they do not get replaced. I also tried escaping the backslash,
 then double escaping that as was suggested somewhere in the
 php.net/manual, then triple escaping!
 
 Thanks ahead of time for any insight.
 
 Dotan Cohen
 http://lyricslist.com/lyrics/artist_albums/183/etheridge_melissa.php
 Etheridge,Melissa Song Lyrics
 
 --
 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 \n and \r to the screen

2005-08-25 Thread Dotan Cohen
On 8/25/05, Richard Lynch [EMAIL PROTECTED] wrote:
 
 Windows uses \r\n
 Linux uses \n
 Mac uses \r
 
 Depending on what tools you use to read/write/create the files, and
 where the data comes from, it's possible that you have any of those
 formats.
 
 This is especially true of FORM data from a TEXTAREA.
 
 I frequently do this:
 
 $text = $_POST['text'];
 $text = str_replace(\r\n, \n, $text);
 $text = str_replace(\r, \n, $text);
 //Now I *know* it's in Linux newline format.
 
 Like Music?
 http://l-i-e.com/artists.htm

Thanks, Richard. Jochem pointed that out earlier. I really should have
googled this first, but I was certain that what I _knew_ was right.
That happens sometimes. Now get that Uranus branch up!

Dotan
http://lyricslist.com/lyrics/artist_albums/395/papa_roach.php
Papa Roach Song Lyrics

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



RE: [PHP] Printing \n and \r to the screen

2005-08-24 Thread Jay Blanchard
[snip]
I seem to be having trouble with \n and \r in variables. I write my
code on a linux box, and the server is linux. So I should always have
\n\r, no? Is there a way the I could print $variable; and have it show
me the /n and /r 's ? I tried with a srt_replace() on /n and on /r, 
but they do not get replaced. I also tried escaping the backslash,
then double escaping that as was suggested somewhere in the
php.net/manual, then triple escaping!

Thanks ahead of time for any insight.
[/snip]

Print to the screen? You could enclose them in single quotes '\n\r'. Are
you tring to make these work in a web browser? Because if so it'll never
happen, they do not show up. (but you can see the result when you view
source) Anything output to the browser to represent this should have a
br or br /

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



RE: [PHP] Printing \n and \r to the screen

2005-08-24 Thread George Pitcher
 [snip]
 I seem to be having trouble with \n and \r in variables. I write my
 code on a linux box, and the server is linux. So I should always have
 \n\r, no? Is there a way the I could print $variable; and have it show
 me the /n and /r 's ? I tried with a srt_replace() on /n and on /r,
 but they do not get replaced. I also tried escaping the backslash,
 then double escaping that as was suggested somewhere in the
 php.net/manual, then triple escaping!

 Thanks ahead of time for any insight.
 [/snip]

I use \r\n on my winbox but maybe it doen't matter, though I though I had a
problem a few years back when I inadvertently used \n\r by mistake.

George

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



Re: [PHP] Printing \n and \r to the screen

2005-08-24 Thread Jochem Maas

Dotan Cohen wrote:

I seem to be having trouble with \n and \r in variables. I write my
code on a linux box, and the server is linux. So I should always have


you are mixing /n and \n etc etc - stop it :-)

\n  is a new line in linux
\r  is a new line in (older?) version of MacOS
\r\nis a new line in Windoze

try something along the lines of:

?php
$string = \nthis is a test\r\nthis is a test\rthis is a test\nthis is a test;
$finds = array(\n, \r);
$repls = array( ***\\n*** , ***\\r*** );
echo str_replace($finds, $repls, $string);


\n\r, no? Is there a way the I could print $variable; and have it show
me the /n and /r 's ? I tried with a srt_replace() on /n and on /r, 
but they do not get replaced. I also tried escaping the backslash,

then double escaping that as was suggested somewhere in the
php.net/manual, then triple escaping!


I get the impression you need to find out what the difference is between
single and double quotes strings and how escape sequences differ/behave
within them



Thanks ahead of time for any insight.


outsight, downsight, upsight, insideoutsight, roundaboutsight ...
ignore me now - I'm feeling bored.



Dotan Cohen
http://lyricslist.com/lyrics/artist_albums/183/etheridge_melissa.php
Etheridge,Melissa Song Lyrics



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



Re: [PHP] Printing \n and \r to the screen

2005-08-24 Thread Dotan Cohen
On 8/24/05, Jay Blanchard [EMAIL PROTECTED] wrote:
 [snip]
 I seem to be having trouble with \n and \r in variables. I write my
 code on a linux box, and the server is linux. So I should always have
 \n\r, no? Is there a way the I could print $variable; and have it show
 me the /n and /r 's ? I tried with a srt_replace() on /n and on /r,
 but they do not get replaced. I also tried escaping the backslash,
 then double escaping that as was suggested somewhere in the
 php.net/manual, then triple escaping!
 
 Thanks ahead of time for any insight.
 [/snip]
 
 Print to the screen? You could enclose them in single quotes '\n\r'. Are
 you tring to make these work in a web browser? Because if so it'll never
 happen, they do not show up. (but you can see the result when you view
 source) Anything output to the browser to represent this should have a
 br or br /
 

I want to explode on newline in a text file, but explode(\n\r,
$ducks) wasn't doing it, so I thought that it would be good if I could
see where these ascaped characters are. I thought that Kate has a see
[tab|space|newline|carrage return] checkbox, but that must have been
in a different program.

In Jochem's post I see the mistake that I made. I should have googled
for that before I asked. The str_replace in that post worked, and now
I see where I erred. Thanks.

Dotan
http://lyricslist.com/lyrics/artist_albums/106/cantrell_jerry.php
Cantrell, Jerry Song Lyrics

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



Re: [PHP] Printing

2005-04-05 Thread Richard Lynch
On Sat, April 2, 2005 9:03 am, Niels Riis Kristensen said:
 I am using a Unix machine (Mac) but can't find ways to print to my
 local printer. Plenty of information about printing from a PC, but none
 from a mac. Can that be, that you can't print from php to mac?

First, get printing to work AT ALL on the machine.  If your text editor or
browser can't print, PHP ain't gonna be able to either, most likely.

Next, see if you can figure out what command line is being used to make
things print...  Sometimes you can force an error (turn off the printer as
you print) and get something to puke out on the screen or into
/var/log/messages or...

Finally, whatever that command line is, use http://php.net/exec to make it
happen in PHP.  You'll also need to be aware of the PHP User and what
their permissions are -- Try to 'su' to that user in a terminal window and
do the command to print from the command line.

Oh yeah:  Start with a dirt simple text file:
 test.txt --
Hello World


If you can't get that to print, it's unlikely you'll get fancy stuff like
PostScript to work...  Though sometimes it goes the other way, and PS
prints fine, but text refuses.  Go figure.

In all OSes, I find printer setup the most painful experience for
something that virtually every normal user is supposed to be able to do
this...  WHY?!

-- 
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

2005-04-02 Thread Warren Vail
That is because Windoz, for all it's faults, provides a bit of an
interface for applications to exercise some control over printed output,
and even attempts to make it device independent.  Don't know if Gnome,
or other GUI's provide something, but if you write the output intended
for a printer to a physical file and then post that file to your print
spooler using a exec() function that should do the trick.

http://us4.php.net/manual/en/function.exec.php

I suspect you would use the unix command to cause the file to be spooled
to the printer as you would manually (I seem to recall an lpr command
being involved, but don't trust my memory).

This carries with it all the caviates about whether or not you know who
your website visitors are, and what happens when multiple users try to
trigger printing (who loads paper in the printer?).  Another potential
snag is, will you website user (usually nobody) have permission to
print (execute the lpr command)?

Unless gnome or kde is involved, don't know how you could detect your
printer types, since your program will need to know which pcl (printer
control language) is required.

Good luck,
Anyone have other solutions?

Warren Vail


 -Original Message-
 From: Niels Riis Kristensen [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, April 02, 2005 8:03 AM
 To: php-general@lists.php.net
 Subject: [PHP] Printing
 
 
 Hi
 
 I am using a Unix machine (Mac) but can't find ways to print to my 
 local printer. Plenty of information about printing from a 
 PC, but none 
 from a mac. Can that be, that you can't print from php to mac?
 
 
 Niels Riis Kristensen
 ([EMAIL PROTECTED])
 
 NRK Group
 - Electronic Music Engraving
 - Webhosting
 - Dynamic Web design
 - E-Lists hosting
 

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



Re: [PHP] Printing using php script CRON

2004-07-28 Thread Burhan Khalid
Vern wrote:
I get:
# wget -O -q http://www.comp-wiz.com/index.html | lpr -P hp1300n
What I wrote was
wget -O -q - http://www.domain.com/file.php | lpr -P hp1300n
You forgot -
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Printing using php script CRON

2004-07-27 Thread Jay Blanchard
[snip]
I hate to keep beating a dead horse, but this horse is not quite dead
yet.

I need to print a php script from a web site using CRON. I'm thinking
something like this should work but I don't know enough about it to say
that
it would. I know that I can run a php script using CRON as such:

lynx --dump http://yoursite.com/cronjob.php /dev/null

Can I not output this data to a printer?
[/snip]

If you have a printer attached to the server from where the cron is
running you might try

lynx --dump http://yoursite.com/cronjob.php lpt1

or something similar. Not tested.

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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Vern
 If you have a printer attached to the server from where the cron is
 running you might try
 lynx --dump http://yoursite.com/cronjob.php lpt1
or something similar. Not tested.

Actually it's a netwotl printer and in order to print the job I need to type
the following on the box:

lpr -P hp1300n myfilename.txt

So I'm not exctaly sure how I can do that.


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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Jason Wong
On Tuesday 27 July 2004 20:33, Vern wrote:
  If you have a printer attached to the server from where the cron is
  running you might try
  lynx --dump http://yoursite.com/cronjob.php lpt1
 or something similar. Not tested.

 Actually it's a netwotl printer and in order to print the job I need to
 type the following on the box:

 lpr -P hp1300n myfilename.txt

 So I'm not exctaly sure how I can do that.

Try:

  lynx --dump http://yoursite.com/cronjob.php | lpr -P hp1300n

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Mene, mene, tekel, upharsen.
*/

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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread James E Hicks III
On Tuesday 27 July 2004 08:33 am, Vern wrote:
 Actually it's a netwotl printer and in order to print the job I need to
 type the following on the box:

     lpr -P hp1300n myfilename.txt

 So I'm not exctaly sure how I can do that

This works great for me. Except that I use lp -d printername filename.txt 
instead of the command you're using. I can print to any printer that I set up 
in CUPS on the webserver. I do this from webpages so I'm sure you can get it 
to work with CRON.

$filename = uniqid()..txt;
$filehandle = fopen($filename,w);
fwrite($filehandle, Hello World);
fclose($filehandle);
system(lpr -P hp1300n .$filename);

James

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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Vern
One would think this should be really simple but it's not.

I need to retrieve the file somewhere on the internet. I read somewhere in
order to read a php script's output you need to add the php command in
front, as such:

php http://yoursite.com/cronjob.php | lpr -P hp1300n

however I am getting the following error:

Status: 404 suggesting that the page doesn't exist, however it does. Is
there something I am missing here?

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



RE: [PHP] Printing using php script CRON

2004-07-27 Thread Jay Blanchard
[snip]
One would think this should be really simple but it's not.

I need to retrieve the file somewhere on the internet. I read somewhere
in
order to read a php script's output you need to add the php command in
front, as such:

php http://yoursite.com/cronjob.php | lpr -P hp1300n

however I am getting the following error:

Status: 404 suggesting that the page doesn't exist, however it does. Is
there something I am missing here?
[/snip]

You are trying to run a PHP script on a remote site? Have a look at cURL
http://www.php.net/curl

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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Vern
I feel like I taking a hammer and well I'm sure you all know the
feeling.

cURL does help me to get the file and save the file somewhere locally,
however printing a page like this gives me all the html code (i.e. html,
etc) and I need the report that is being displayed to the browser in all
it's glory (color, graphs and so forth). So somehow I need to simply have
the output of this file converted to an image file of some some. You would
think that there is and easy command from the command prompt that would
allow you to do this. Am I incorrect? Do I have to rewrite this whole page
to output to an image or pdf?

Seems there should be an easier way.

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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Ed Curtis

You could try this:

http://marginalhacks.com/Hacks/html2jpg/

Save the page as an image, and then run it through the printer. It does
have some overhead though to get it done.

Hope it helps,

Ed

On Tue, 27 Jul 2004, Vern wrote:

 I feel like I taking a hammer and well I'm sure you all know the
 feeling.

 cURL does help me to get the file and save the file somewhere locally,
 however printing a page like this gives me all the html code (i.e. html,
 etc) and I need the report that is being displayed to the browser in all
 it's glory (color, graphs and so forth). So somehow I need to simply have
 the output of this file converted to an image file of some some. You would
 think that there is and easy command from the command prompt that would
 allow you to do this. Am I incorrect? Do I have to rewrite this whole page
 to output to an image or pdf?

 Seems there should be an easier way.

 --
 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 using php script CRON

2004-07-27 Thread Vern
Seems to me that this needs XWindows or something install, am I incorrect?

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



Re: [PHP] Printing using php script CRON

2004-07-27 Thread Burhan Khalid
Vern wrote:
One would think this should be really simple but it's not.
wget -O -q - http://www.domain.com/file.php | lpr -P hp1300n
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Printing using php script CRON

2004-07-27 Thread Vern
I get:

# wget -O -q http://www.comp-wiz.com/index.html | lpr -P hp1300n
--16:49:59--  http://www.comp-wiz.com/index.html
   = `-q'
Resolving www.comp-wiz.com... done.
Connecting to www.comp-wiz.com[207.234.154.95]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22,011 [text/html]

100%[==
] 22,011   139.58K/sETA 00:00

16:49:59 (139.58 KB/s) - `-q' saved [22011/22011]

lpr: stdin is empty, so no job has been sent.

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



  1   2   3   >