$handle = printer_open("EPSON TM-T88IV Receipt");
echo "connected";
echo "not connected";

this s not displaying anything

It could be an error that is causing the script to stop. Do you have error reporting on?

<?php  error_reporting(E_ALL);
 	 $tab = "profile";
  	 $nav = "profile";
$handle = printer_open("EPSON TM-T88IV Receipt");
for($j=0;$j<10;$j++) {
$mydata = "This is count number ".$j;
printer_write($handle,$mydata); }

this is the complete page
the header is being loaded
but nothing else

One by one, comment out each line of code after the last point where it works. You will find your problem.

i tried to even tat
but it seems as if php is not reading those statements also
see my first code
even the else part was not being executed
do i need to make ny changes in the settings?

is display_errors on?

Anyway, start with a blank file. Add tiny bits of code at a time. This will help you see what part doesn’t work. Part of debugging is isolating the problem as much as possible. For example, you think you have a problem with printer_open(). So, why have all this other code in the file? Get it all out of there.

<?php  error_reporting(E_ALL);
$handle = printer_open("EPSON TM-T88IV Receipt");
echo "xyz";

this is giving me a blank page

that means you have display_errors off

how do i on it?

you can set it in php.ini, or you can use ini_set() in the script. You can often set it in .htaccess too(if php is being run as an apache module). For development, you definately should set it in php.ini, because ini_set() may not work when you have parse errors.

there was no option of setting it in php.ini
i mean i did not know how to do that
so i used ini_set()
code is

<?php  ini_set('display_errors', 'on');
$handle = printer_open("EPSON TM-T88IV Receipt");
echo "connected";

error now is
Fatal error: Call to undefined function printer_open() in C:\www\webroot\guru\home
ew_print.php on line 3