SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I want to send to printer

    I have this code:

    print "Archivos existentes <br />\n";
    print "<pre>\n";
    while (false !== ($entran = $d->read() )){
    if ($entran != '..' && $entran != '.' && file_exists($datadir.'/'.$entran)) {
    $medida = sprintf("%u" , filesize($datadir.'/'.$entran) )."<br />\n" ;
    printf ("%'.-22.15s%'.22.15s", $entran, $medida);
    }
    }
    print "</pre>\n";
    $d->close();

    // it works: shows on screen. ok,
    // how can I send it to printer. ?
    //
    thanks for your advice.

  2. #2
    SitePoint Wizard jimbo_dk's Avatar
    Join Date
    May 2005
    Location
    Singapore
    Posts
    1,261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you want has to be done from Javascript because PHP will only work in the server, and you need to print form the client. The javascript for it is:

    window.print();
    Winners Respond. Losers React.
    Singapore Web Designer

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jimbo dk,
    thanks very much for your help. (sorry, I am in the wrong forum).

  4. #4
    SitePoint Wizard jimbo_dk's Avatar
    Join Date
    May 2005
    Location
    Singapore
    Posts
    1,261
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anytime
    Winners Respond. Losers React.
    Singapore Web Designer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •