php-windows Digest 28 May 2003 20:19:49 -0000 Issue 1751

Topics (messages 20114 through 20121):

Re: Subject: FOpen problems
        20114 by: Sven Schnitzke

Re: Fatal Error???
        20115 by: Svensson, B.A.T. (HKG)
        20119 by: Alejandro C. Garrammone
        20120 by: Cristian MARIN

Re: header problem with IIS
        20116 by: Peter Misun

query infinitely stuck ......
        20117 by: toby z

Checking Client's Cipher Strength with IIS
        20118 by: Ed Gorski

Read all the webmonkey tutorials, still need guidance
        20121 by: Stephen Rivas Jr

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi Will,

you might want to take a look at

http://www.php.net/register_globals

There has been a change in default behaviour concerning this option:
Prior to this option the default was like having this option ON.
Early Versions of PHP4 equally defaulted this option to ON.
Newer PHP versions for security reasons default this option to OFF
and strongly recommend keeping it OFF and changing the scripts instead.

Maybe the two environments you use differ at this point.

As to your implicit question:

PHP always initializes variables upon first use to some appropriate 
kind of emptiness:  0, "", ... and issues the complaint you see.
Good programming practice just always has the first occurrence of
a variable to the left hand side of an assignment, so to have an 
_explicitly_ defined start value.

Hope this helps...
-- 
Sven

> -----Ursprüngliche Nachricht-----
> Von:  WL [SMTP:[EMAIL PROTECTED]
> Gesendet am:  Dienstag, 27. Mai 2003 20:44
> An:   [EMAIL PROTECTED]
> Betreff:      [PHP-WIN] Re: Subject: FOpen problems
> 
> Neil Smith <[EMAIL PROTECTED]> said:
> > Have you put a line into the top of your code like :
> >
> > error_reporting(E_ALL)
> >
> > ? And if so, where are your errors being logged on the new server -
> > some log to stdout (the apache logfiles) some to the console (the web
> > browser) so if case (1) you may be getting error messages but not
> > seeing them.
> 
> Thanks Neil.  Here's my reply to another group that I posted.  If you have
> any ideas, they'd be very welcome:
> 
> OK here's what I'm getting:
> 
> Undefined variabled on line seven ($q which one of you mentioned) - this is
> before the form is submitted, and I can get round this probably
> 
> Undefined variable "num" on line 47:
> 
> 
> PHP:
> $num = ($num) ? $num+1 : "16";
> 
> 
> 
> 
> Another undefined:
> 
> 
> PHP:
> $data = strstr($data,"Sorted by date</b></font></td></tr></table>");
> 
> 
> 
> 
> And another:
> 
> 
> PHP:
> $output .= "<?xml version="1.0\" encoding=\"UTF-8\" ?>\n";
> 
> 
> 
> 
> Well I suppose this is good news, isn't it?! At least we can see what to do
> (or you guys can anyway). In CF, variables generally have to be stated using
> <cfparam> - but no idea how to do this in PHP...
> 
> Will
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Yiour error message suggest that you have ended up
in an infinit loop.


> > IF ($len<=41):
> >   WHILE ($i<>0):
> >    IF ($asunto[$i]==" "):    *************This is line 116
> >     $corte1=$i;
> >     $i=0;
> >    ENDIF;
>    $i=$i + 1;
>   ENDWHILE;

It seams like this IF statement control weather you
can break the WHILE loop or not. So the question is:

Have you tried to put a space at the end of the
line to guarantee that you can break the loop in
case a line just happens to contain no spaces at
all?

Instead of the above construction, you can add some
extra "sanity check" code to make sure that you always
can break the loop in a controlled manner.

   $LoopCnt = 0 ;
   $MAX_ITTERATIONS = <SOME SENCIBLE VALUE>;

    WHILE ($i<>0 && $LoopCnt < $MAX_ITTERATIONS):
    $LoopCnt++;
 
       IF ($asunto[$i]==" "):    *************This is line 116
         $corte1=$i;
         $i=0;
      ENDIF;

     $i=$i + 1;
    ENDWHILE;
    
    IF ($i <> 0 )
        /* code for handle this kind of exception */
    ENDIF;


I would also like to suggest that you initiate $i to a
know value before you enter the loop construction.

By the way, it is always a good programming habit to initiate
variables to a know value before using them; that way one
will avoid a lot of annoying behavior with the code.


--- End Message ---
--- Begin Message ---
But cristian...the problem is that in the first line of the code I set the
$i=20; so $i has an initial value of 20.
So...i'm still stuck.
If u can still help me...I apreciate.

Thxs for all,

Alex

----- Original Message -----
From: "Cristian MARIN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 28, 2003 4:27 AM
Subject: [PHP-WIN] Re: Fatal Error???


All the loops you are doing are infinite loops because as for example
the first loop:
                                              // $i do not have a
initial value which is a bug
WHILE ($i<>0):                // The loop exit when $i = 0
    IF ($asunto[$i]==" "):   // we verify if the position $i of the
$assunto is " " but $i doesn't have a value so ... we verify $assunto[]
             $corte1=$i;       //  save the $i value into $corte1
             $i=0;               //   reset $i (it's not right you have
to put it -1)
    ENDIF;
    $i=$i + 1;                  // increase $i with 1 so even if we have
putted $i = 0 $i will have minimum value 1 so the loop is infinite.
                                            // $i is now, after the
first loop. 21 on my computer :) you have omitted 20 positions of
$assunto
ENDWHILE;


All the loops are the same, please verify them yourself.

Cristic

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
[EMAIL PROTECTED]

  "Alejandro C. Garrammone" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

  > Hi guys...I'm in trouble again...see if you can help me...
  > I get the following error when I run the following script.
  > Let me try to explain the code. I'm writing some code for an
intranet web
  > page, I'm want to print to a printer some text but I'm wanted to be
  printed
  > centered. If the text exceed the 20 characters the line need to be
splited
  > up in 2 lines...an so on...
  >
  > The error that I get is the following:
  >
  > Fatal error: Maximum execution time of 60 seconds exceeded in
c:\archivos
  de
  > programa\apache group\apache\htdocs\printer.php on line 116
  >
  > The line error is marked with ******
  >
  > Here is the code:
  >
  > <?
  >
  > $i=20;
  > $handle = printer_open();
  > print printer_get_option($handle, PRINTER_PAPER_FORMAT);
  > $vardumped= printer_get_option($handle, PRINTER_PAPER_WIDTH);
  > $vardumped1= printer_get_option($handle, PRINTER_PAPER_LENGTH);
  > printer_set_option($handle, PRINTER_PAPER_FORMAT,
PRINTER_FORMAT_LEGAL);
  > PRINT "$vardumped<BR>";
  > PRINT "$vardumped1<BR>";
  > $var1= printer_get_option($handle, PRINTER_PAPER_FORMAT);
  > $var2= printer_get_option($handle, PRINTER_PAPER_WIDTH);
  > $var3= printer_get_option($handle, PRINTER_PAPER_LENGTH);
  > PRINT "$var1<BR>";
  > PRINT "$var2<BR>";
  > PRINT "$var3<BR>";
  > printer_start_doc($handle, "My Document");
  > printer_start_page($handle);
  >
  > $pen = printer_create_pen(PRINTER_PEN_SOLID, 30, "000000");
  > printer_select_pen($handle, $pen);
  >
  >
  > $text_asunto="ASUNTO N°: ";
  >
  > $asunto="ALEJANDRO CESAR GARRAMMONE SUPUESTO"; /*max 20*/
  > $len=strlen($asunto);
  > IF ($len<=20):
  >  SWITCH($len):
  >   case 20:
  >    printer_select_font($handle, $font5); /*50*/
  >    printer_draw_text($handle, "$asunto", 500, 2800);
  >    break;
  >   case 19:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 500, 2800);
  >    break;
  >   case 18:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 750, 2800);
  >    break;
  >   case 17:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 750, 2800);
  >    break;
  >   case 16:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 850, 2800);
  >    break;
  >   case 15:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 950, 2800);
  >    break;
  >   case 14:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 950, 2800);
  >    break;
  >   case 13:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1050, 2800);
  >    break;
  >   case 12:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1250, 2800);
  >    break;
  >   case 11:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1350, 2800);
  >    break;
  >   case 10:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1400, 2800);
  >    break;
  >   case 9:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1400, 2800);
  >    break;
  >   case 8:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1500, 2800);
  >    break; /*100*/
  >   case 7:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1700, 2800);
  >    break;
  >   case 6:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 1800, 2800);
  >    break;
  >   case 5:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 2000, 2800);
  >    break;
  >   case 4:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 2100, 2800);
  >    break;
  >   case 3:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 2200, 2800);
  >    break;
  >   case 2:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 2300, 2800);
  >    break;
  >   case 1:
  >    printer_select_font($handle, $font5);
  >    printer_draw_text($handle, "$asunto", 2300, 2800);
  >    break;
  >   ENDSWITCH;
  > /*130*/
  > ENDIF;
  >
  > IF ($len<=41):
  >   WHILE ($i<>0):
  >    IF ($asunto[$i]==" "):    *************This is line 116
  >     $corte1=$i;
  >     $i=0;
  >    ENDIF;
  >    $i=$i + 1;
  >   ENDWHILE;
  >   $i=$corte1 + 20;
  >   IF ($i>=$len):
  >    $i=$len;
  >    ENDIF;
  >
  >   WHILE ($i<>$corte1):
  >    IF($asunto[$i]==" "):
  >     $corte2=$i;
  >     $i=$corte1;
  >    ENDIF;
  >    $i= $i + 1;
  >   ENDWHILE;
  >
  > ENDIF;
  > $j=0;
  > WHILE ($j==$corte1):
  >  $asunto_p1="$asunto_p1" . $asunto[$j];
  >  $j = $j + 1;
  >  ENDWHILE;
  > $j=$corte1;
  > WHILE ($j==$corte2):
  >  $asunto_p2="$asunto_p2" . $asunto[$j];
  >  $j = $j + 1;
  >  ENDWHILE;
  >
  >
  >
  >
  >
  >
  >
  > $font = printer_create_font("Times New Roman", 110, 55,
PRINTER_FW_BOLD,
  > TRUE, FALSE, FALSE, 0);
  > printer_select_font($handle, $font);
  > printer_draw_text($handle, "Ministerio Público", 1850, 1500);
  > printer_draw_text($handle, "Unidad Fiscal de Investigación de
Delitos
  > Tributarios y Contrabando", 650, 1650);
  > printer_draw_text($handle, "UFITCO", 2050, 1800);
  > $font1=printer_create_font("Times New Roman", 143, 76,
PRINTER_FW_BOLD,
  > FALSE, TRUE, FALSE, 0);
  > printer_select_font($handle, $font1);
  > printer_draw_text($handle, "$text_asunto", 500, 2100);
  > $font2=printer_create_font("Times New Roman", 143, 76,
PRINTER_FW_BOLD,
  > FALSE, FALSE, FALSE, 0);
  > printer_select_font($handle, $font2);
  > printer_draw_text($handle, "$junta", 1400, 2100);
  > $font3=printer_create_font("Times New Roman", 138, 70,
PRINTER_FW_BOLD,
  > FALSE, TRUE, FALSE, 0);
  > $font4=printer_create_font("Times New Roman", 138, 70,
PRINTER_FW_BOLD,
  > FALSE, FALSE, FALSE, 0);
  > printer_select_font($handle, $font3);
  > printer_draw_text($handle, "INVESTIGACIÓN PRELIMINAR N°: ", 500,
2400);
  > printer_select_font($handle, $font4);
  > printer_draw_text($handle, "$inv_prel1", 2850, 2350);
  > $font5=printer_create_font("Times New Roman", 220, 83,
PRINTER_FW_NORMAL,
  > FALSE, FALSE, FALSE,0);
  > $font6=printer_create_font("Times New Roman", 120, 62,
PRINTER_FW_BOLD,
  > FALSE, FALSE, FALSE,0);
  >
  > printer_select_font($handle, $font5);
  > printer_draw_text($handle, "$asunto_p1", 1050, 2800);
  > printer_draw_text($handle, "$asunto_p2", 1050, 3100);
  > printer_draw_text($handle, "$corte3", 1050, 3400);
  >
  >
  > printer_select_font($handle, $font6);
  > printer_draw_text($handle, "Fecha de Recepción en la UFITCO:
$fecha_as1",
  > 500, 4000);
  > printer_draw_text($handle, "Secretaria: $sec_a_cargo1", 500, 4300);
  > printer_draw_text($handle, "Responsable: $responsable1", 500, 4600);
  > printer_draw_text($handle, "Observaciones:", 500, 4900);
  > printer_draw_line($handle, 1600, 5000, 4500, 5000);
  > printer_draw_line($handle, 500, 5300, 4500, 5300);
  > printer_draw_line($handle, 500, 5600, 4500, 5600);
  > printer_draw_line($handle, 500, 5900, 4500, 5900);
  > printer_draw_line($handle, 500, 6200, 4500, 6200);
  > printer_draw_text($handle, "Juzgado N°: 5", 2850, 6500);
  > printer_draw_text($handle, "Secretaría N°: 10", 2850, 6800);
  > printer_draw_text($handle, "Fiscalía N°: 6", 2850, 7100);
  >
  >
  >
  > printer_draw_bmp($handle, "c:\\escudo.bmp", 2000, 540);
  >
  >
  >
  > printer_delete_pen($pen);
  >
  > printer_end_page($handle);
  > printer_end_doc($handle);
  > printer_close($handle);
  >
  >
  > ?>
  >
  > <HTML>
  > <HEAD>
  > <meta name="Microsoft Theme" content="indust 011">
  > </head>
  > <BODY background="indtextb.jpg" bgcolor="#FFFFFF" text="#000000"
  > link="#3366CC" vlink="#666666" alink="#996600">
  > <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
  > <CENTER><P><i><b><font color="#0000FF"></center>
  > <center> <font size="3">
  > </font><br>
  > <FORM ACTION="as_insercion.php" METHOD="POST">
  > <? $submit="True"; ?>
  > <INPUT TYPE="hidden" NAME="submit" VALUE="<? echo $submit ?>">
  > <P>
  > <INPUT TYPE="hidden" NAME="usuario" VALUE="<? echo $usuario ?>">
  > <P>
  > <INPUT TYPE="hidden" NAME="passwrd" VALUE="<? echo $passwrd ?>">
  > <P>
  >
  > <CENTER><INPUT TYPE="submit" name="submit" VALUE="Insertar otra
  > Denuncia"></CENTER>
  >
  > </FORM></CENTER>
  >
  > </TD></TR></TABLE>
  > <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
  > <br>
  > <center> <font size="3">
  > </font><br>
  > <a href="asunto.html">Salir y volver a la pagina principal de
  > Asuntos.</a><BR>
  > <a href="index.html">Salir y volver a la pagina principal.</a>
  > </center>
  >
  > <!--mstheme--></font>
  >
  > </BODY>
  > </HTML>
  >



--- End Message ---
--- Begin Message ---
Not the initial $i is the big problem but the fact you are incrementing the $i even if 
$i is 0 so you are never getting out from the while loop and the server expire your 
script ...

Read your mail and reply me if you haven't understood.

Cristic

-- 
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610 
[EMAIL PROTECTED]

  "Alejandro C. Garrammone" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
  But cristian...the problem is that in the first line of the code I set the
  $i=20; so $i has an initial value of 20.
  So...i'm still stuck.
  If u can still help me...I apreciate.

  Thxs for all,

  Alex

  ----- Original Message -----
  From: "Cristian MARIN" <[EMAIL PROTECTED]>
  To: <[EMAIL PROTECTED]>
  Sent: Wednesday, May 28, 2003 4:27 AM
  Subject: [PHP-WIN] Re: Fatal Error???


  All the loops you are doing are infinite loops because as for example
  the first loop:
                                                // $i do not have a
  initial value which is a bug
  WHILE ($i<>0):                // The loop exit when $i = 0
      IF ($asunto[$i]==" "):   // we verify if the position $i of the
  $assunto is " " but $i doesn't have a value so ... we verify $assunto[]
               $corte1=$i;       //  save the $i value into $corte1
               $i=0;               //   reset $i (it's not right you have
  to put it -1)
      ENDIF;
      $i=$i + 1;                  // increase $i with 1 so even if we have
  putted $i = 0 $i will have minimum value 1 so the loop is infinite.
                                              // $i is now, after the
  first loop. 21 on my computer :) you have omitted 20 positions of
  $assunto
  ENDWHILE;


  All the loops are the same, please verify them yourself.

  Cristic

  --
  -------------------------------------------------
  Cristian MARIN
  InterAKT Online (www.interakt.ro)
  [EMAIL PROTECTED]

    "Alejandro C. Garrammone" <[EMAIL PROTECTED]> wrote in message
  news:[EMAIL PROTECTED]

    > Hi guys...I'm in trouble again...see if you can help me...
    > I get the following error when I run the following script.
    > Let me try to explain the code. I'm writing some code for an
  intranet web
    > page, I'm want to print to a printer some text but I'm wanted to be
    printed
    > centered. If the text exceed the 20 characters the line need to be
  splited
    > up in 2 lines...an so on...
    >
    > The error that I get is the following:
    >
    > Fatal error: Maximum execution time of 60 seconds exceeded in
  c:\archivos
    de
    > programa\apache group\apache\htdocs\printer.php on line 116
    >
    > The line error is marked with ******
    >
    > Here is the code:
    >
    > <?
    >
    > $i=20;
    > $handle = printer_open();
    > print printer_get_option($handle, PRINTER_PAPER_FORMAT);
    > $vardumped= printer_get_option($handle, PRINTER_PAPER_WIDTH);
    > $vardumped1= printer_get_option($handle, PRINTER_PAPER_LENGTH);
    > printer_set_option($handle, PRINTER_PAPER_FORMAT,
  PRINTER_FORMAT_LEGAL);
    > PRINT "$vardumped<BR>";
    > PRINT "$vardumped1<BR>";
    > $var1= printer_get_option($handle, PRINTER_PAPER_FORMAT);
    > $var2= printer_get_option($handle, PRINTER_PAPER_WIDTH);
    > $var3= printer_get_option($handle, PRINTER_PAPER_LENGTH);
    > PRINT "$var1<BR>";
    > PRINT "$var2<BR>";
    > PRINT "$var3<BR>";
    > printer_start_doc($handle, "My Document");
    > printer_start_page($handle);
    >
    > $pen = printer_create_pen(PRINTER_PEN_SOLID, 30, "000000");
    > printer_select_pen($handle, $pen);
    >
    >
    > $text_asunto="ASUNTO N°: ";
    >
    > $asunto="ALEJANDRO CESAR GARRAMMONE SUPUESTO"; /*max 20*/
    > $len=strlen($asunto);
    > IF ($len<=20):
    >  SWITCH($len):
    >   case 20:
    >    printer_select_font($handle, $font5); /*50*/
    >    printer_draw_text($handle, "$asunto", 500, 2800);
    >    break;
    >   case 19:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 500, 2800);
    >    break;
    >   case 18:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 750, 2800);
    >    break;
    >   case 17:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 750, 2800);
    >    break;
    >   case 16:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 850, 2800);
    >    break;
    >   case 15:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 950, 2800);
    >    break;
    >   case 14:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 950, 2800);
    >    break;
    >   case 13:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1050, 2800);
    >    break;
    >   case 12:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1250, 2800);
    >    break;
    >   case 11:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1350, 2800);
    >    break;
    >   case 10:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1400, 2800);
    >    break;
    >   case 9:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1400, 2800);
    >    break;
    >   case 8:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1500, 2800);
    >    break; /*100*/
    >   case 7:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1700, 2800);
    >    break;
    >   case 6:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 1800, 2800);
    >    break;
    >   case 5:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 2000, 2800);
    >    break;
    >   case 4:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 2100, 2800);
    >    break;
    >   case 3:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 2200, 2800);
    >    break;
    >   case 2:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 2300, 2800);
    >    break;
    >   case 1:
    >    printer_select_font($handle, $font5);
    >    printer_draw_text($handle, "$asunto", 2300, 2800);
    >    break;
    >   ENDSWITCH;
    > /*130*/
    > ENDIF;
    >
    > IF ($len<=41):
    >   WHILE ($i<>0):
    >    IF ($asunto[$i]==" "):    *************This is line 116
    >     $corte1=$i;
    >     $i=0;
    >    ENDIF;
    >    $i=$i + 1;
    >   ENDWHILE;
    >   $i=$corte1 + 20;
    >   IF ($i>=$len):
    >    $i=$len;
    >    ENDIF;
    >
    >   WHILE ($i<>$corte1):
    >    IF($asunto[$i]==" "):
    >     $corte2=$i;
    >     $i=$corte1;
    >    ENDIF;
    >    $i= $i + 1;
    >   ENDWHILE;
    >
    > ENDIF;
    > $j=0;
    > WHILE ($j==$corte1):
    >  $asunto_p1="$asunto_p1" . $asunto[$j];
    >  $j = $j + 1;
    >  ENDWHILE;
    > $j=$corte1;
    > WHILE ($j==$corte2):
    >  $asunto_p2="$asunto_p2" . $asunto[$j];
    >  $j = $j + 1;
    >  ENDWHILE;
    >
    >
    >
    >
    >
    >
    >
    > $font = printer_create_font("Times New Roman", 110, 55,
  PRINTER_FW_BOLD,
    > TRUE, FALSE, FALSE, 0);
    > printer_select_font($handle, $font);
    > printer_draw_text($handle, "Ministerio Público", 1850, 1500);
    > printer_draw_text($handle, "Unidad Fiscal de Investigación de
  Delitos
    > Tributarios y Contrabando", 650, 1650);
    > printer_draw_text($handle, "UFITCO", 2050, 1800);
    > $font1=printer_create_font("Times New Roman", 143, 76,
  PRINTER_FW_BOLD,
    > FALSE, TRUE, FALSE, 0);
    > printer_select_font($handle, $font1);
    > printer_draw_text($handle, "$text_asunto", 500, 2100);
    > $font2=printer_create_font("Times New Roman", 143, 76,
  PRINTER_FW_BOLD,
    > FALSE, FALSE, FALSE, 0);
    > printer_select_font($handle, $font2);
    > printer_draw_text($handle, "$junta", 1400, 2100);
    > $font3=printer_create_font("Times New Roman", 138, 70,
  PRINTER_FW_BOLD,
    > FALSE, TRUE, FALSE, 0);
    > $font4=printer_create_font("Times New Roman", 138, 70,
  PRINTER_FW_BOLD,
    > FALSE, FALSE, FALSE, 0);
    > printer_select_font($handle, $font3);
    > printer_draw_text($handle, "INVESTIGACIÓN PRELIMINAR N°: ", 500,
  2400);
    > printer_select_font($handle, $font4);
    > printer_draw_text($handle, "$inv_prel1", 2850, 2350);
    > $font5=printer_create_font("Times New Roman", 220, 83,
  PRINTER_FW_NORMAL,
    > FALSE, FALSE, FALSE,0);
    > $font6=printer_create_font("Times New Roman", 120, 62,
  PRINTER_FW_BOLD,
    > FALSE, FALSE, FALSE,0);
    >
    > printer_select_font($handle, $font5);
    > printer_draw_text($handle, "$asunto_p1", 1050, 2800);
    > printer_draw_text($handle, "$asunto_p2", 1050, 3100);
    > printer_draw_text($handle, "$corte3", 1050, 3400);
    >
    >
    > printer_select_font($handle, $font6);
    > printer_draw_text($handle, "Fecha de Recepción en la UFITCO:
  $fecha_as1",
    > 500, 4000);
    > printer_draw_text($handle, "Secretaria: $sec_a_cargo1", 500, 4300);
    > printer_draw_text($handle, "Responsable: $responsable1", 500, 4600);
    > printer_draw_text($handle, "Observaciones:", 500, 4900);
    > printer_draw_line($handle, 1600, 5000, 4500, 5000);
    > printer_draw_line($handle, 500, 5300, 4500, 5300);
    > printer_draw_line($handle, 500, 5600, 4500, 5600);
    > printer_draw_line($handle, 500, 5900, 4500, 5900);
    > printer_draw_line($handle, 500, 6200, 4500, 6200);
    > printer_draw_text($handle, "Juzgado N°: 5", 2850, 6500);
    > printer_draw_text($handle, "Secretaría N°: 10", 2850, 6800);
    > printer_draw_text($handle, "Fiscalía N°: 6", 2850, 7100);
    >
    >
    >
    > printer_draw_bmp($handle, "c:\\escudo.bmp", 2000, 540);
    >
    >
    >
    > printer_delete_pen($pen);
    >
    > printer_end_page($handle);
    > printer_end_doc($handle);
    > printer_close($handle);
    >
    >
    > ?>
    >
    > <HTML>
    > <HEAD>
    > <meta name="Microsoft Theme" content="indust 011">
    > </head>
    > <BODY background="indtextb.jpg" bgcolor="#FFFFFF" text="#000000"
    > link="#3366CC" vlink="#666666" alink="#996600">
    > <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
    > <CENTER><P><i><b><font color="#0000FF"></center>
    > <center> <font size="3">
    > </font><br>
    > <FORM ACTION="as_insercion.php" METHOD="POST">
    > <? $submit="True"; ?>
    > <INPUT TYPE="hidden" NAME="submit" VALUE="<? echo $submit ?>">
    > <P>
    > <INPUT TYPE="hidden" NAME="usuario" VALUE="<? echo $usuario ?>">
    > <P>
    > <INPUT TYPE="hidden" NAME="passwrd" VALUE="<? echo $passwrd ?>">
    > <P>
    >
    > <CENTER><INPUT TYPE="submit" name="submit" VALUE="Insertar otra
    > Denuncia"></CENTER>
    >
    > </FORM></CENTER>
    >
    > </TD></TR></TABLE>
    > <!--mstheme--><font face="Trebuchet MS, Arial, Helvetica">
    > <br>
    > <center> <font size="3">
    > </font><br>
    > <a href="asunto.html">Salir y volver a la pagina principal de
    > Asuntos.</a><BR>
    > <a href="index.html">Salir y volver a la pagina principal.</a>
    > </center>
    >
    > <!--mstheme--></font>
    >
    > </BODY>
    > </HTML>
    >



--- End Message ---
--- Begin Message ---
problem was with switch in W2k server
there is -  Performance Options -> Application response   - and it can be switched to 
"Applications" or "Background services"
after switching from second one to first one (app...), everything works fine now  
(without CGI Error)

5o


Peter Misun wrote:

> running PHP4.1.3 on IIS 5 and everything work's fine
>
> I have only problem with using header() function
> problem is, after submiting form in first.php:
>     echo "<form name=form_abc method=post action=second.php>\n";
> and having in second.php:
>   header('location:third.php');
>
> it produces error in browser like this:
>   CGI Error
>   The specified CGI application misbehaved by not returning a complete set of
>   HTTP headers. The headers it did return are:
>
> what headers?!?
> after reloading/refreshing page by user, everything is ok
>
> in logfiles of IIS I found out, that
>   first.php has protocol code 200
>   second.php has protocol code 302
>   third.php has protocol code 502  (what leads to that error)
>   third.php after refreshing/reloading has protocol code 200
>
> please, help
>
> 5o

--

Mgr. Peter Misun
MicroStep-MIS, Ilkovicova 3, 841 04 Bratislava, Slovakia
tel: +421/ 2/ 602 00 127, 111,  fax: +421/ 2/ 602 00 180



--- End Message ---
--- Begin Message ---
hay guyz

im stuck in an infinite loop
ill try to explain what im actually tryin to do

im letting a user of the application take a backup of a mysql db 
he selects a path n types in a file name for the backup to be dumped
as

two files 
1. tk_bkp.php(take_backup)
2. gen_qry_bkp.php(generate_backup_query)


take backup file:
gets the dir path and file name 
includes 2 files 1st to generate the insert into query 2nd to write a
file on user's disk



generate backup query file :

1. fetchs all table names from a table tbl_ztbl 
(i dont want it to fetch all table namez as ive got 17 lookup tables
in the db)
2. after it has fetched the table names it calls the ReedDta() funct
passing it the table names fetched 
3. ReedDta() funct :
    i. fetches all the data inserted in the tables where nu_bkp=0
       (the watch-dgo field for new || backup data; 0==new)
    ii. fetches all the field names from the table names fetched in
#1
    iii. make an insert into query




problem: 
a. the ReedDta() funct gets stuck in the query #i
   where it has to fetch the data inserted into the db tables :|
   the query goes nuttz ......
  or perhapps i ve screwed somethin else in the code :|

b. the data fetched from the tables include a primary key
auto-incrementor 
the backup is to be restored on the server where the application will
be hosted and i most definately dont want the backup-auto-incremented
values to get inserted in to the server db as im generating reports
on distinct primarykeys 
what the hell do i do now ?
:| :S


i guess i ve done it for myslf to get sacked after this proj is
through :)

the code goes here

===========================================================
tk_bkp.php
=====================================

$bkp_fl = $_GET['bkp_fl'];


echo("1st &nbsp; $bkp_fl<br>");



$dirPth="";
$rpos = strrpos($bkp_fl, '\\');
$dirPth = substr($bkp_fl, 0, $rpos+1);
$FileStr = substr($bkp_fl, $rpos+1, strlen($bkp_fl));

                
        

str_replace("\\", "/", $bkp_fl);



if(is_dir($dirPth)){

echo("<br> da dammed dir xixtz ! continue savin da file ! ! ! !
<br>"); 

//$fp=fopen("$FileStr", "wb");
        
include"gen_qry_bkp.php";
include"gen_bkp_fl.php";
                
}

else{

echo("<br> da dammed dir duzn xixtz ! mk dir here ! ! ! !  <br>");      
                
if (mkdir($dirPth)){
        
        echo("<br> da dammed dir created ! save da file now ! ! ! ! <br>");
        //$fp=fopen("$FileStr", "wb");
        
        include"gen_qry_bkp.php";
        include"gen_bkp_fl.php";
        
}

else {

        echo("<br> da dammed dir cudn b created ! :S now vat  :S :| :[ ! ! !
!  <br>");      

}


}



======================================================================
//$pg  = 'gen_qry_bkp.php';
======================================================================
                
        $ftch_tbl_nmx_qry = "select tbl_nme from tbl_ztbl";
        $ftch_tbl_nmx_qry_rzlt_hndlr = mysql_query($ftch_tbl_nmx_qry)
        or die("qry $ftch_tbl_nmx_qry failed ! da tbl must xixt in da db 2 b
played vid ! ! ! !");

                
        for($count=0; $count <=
mysql_num_rows($ftch_tbl_nmx_qry_rzlt_hndlr); ++$count){
                
        $ftch_tbl_nme = mysql_fetch_row($ftch_tbl_nmx_qry_rzlt_hndlr);
        $tbl_nme = $ftch_tbl_nme[0];
        
                
                $tbl_nme_cmt = "/* <br> Table data for planDb_Bkp.$tbl_nme <br> */ 
 <br> ";

                echo("$tbl_nme<br>");
                
                ReedDta($tbl_nme);
        
                echo($tbl_nme_cmt);
        
                }
                

                
function ReedDta($tbl_nme){

        
                
        // xz2
        $ftch_dta_qry = "select * from $tbl_nme";
        $ftch_dta_qry_rzlt_hndlr = mysql_query($ftch_dta_qry)
                or die("qry $ftch_dta_qry  failed ! da tbl must xixtin da db 2 b
played vid ! ! ! !");
        
        echo($ftch_dta_qry);
        
        for($cnt=0; $cnt = mysql_num_rows($ftch_dta_qry_rzlt_hndlr);
++$cnt){
                $ftch_dta = mysql_fetch_row($ftch_dta_qry_rzlt_hndlr);
                $inzrtn_dta[] = $ftch_dta[$cnt];
                echo("<br> inzrtn dta gozz : &nbsp; $inzrtn_dta <br> ");
        }
        
        
        $inzrt_qry_1st_hlf = "insert into $tbl_nme (";
        
                
        // xz1
        $result_q = "select * from $tbl_nme limit 0,1";
        $result = mysql_query($result_q)
        or die("qry $ftch_fld_nmz_qry failed ! da tbl must xixt in da db 2 b
played vid ! ! ! !");           


$num_fldz = mysql_num_fields($result);

for($i = 0; $i < $num_fldz; $i++)
{
        $fldxx[] = mysql_fetch_field($result);
   
}
        echo($inzrt_qry_1st_hlf);
for($i = 0; $i < $num_fldz; $i++)
{
        
        printf("%s,\n", $fldxx[$i]->name);
}

        $inzrt_qry_2nd_hlf = ") values ($valz)";
        echo($inzrt_qry_2nd_hlf);
        
}       

======================================================================





thnx a million guyz

toby



__________________________________________________
Yahoo! Plus - For a better Internet experience
http://uk.promotions.yahoo.com/yplus/yoffer.html

--- End Message ---
--- Begin Message ---
Hello, 

I have a question who's answer has been bugging me for a while.  What I need
to do is write a script that detects if a browser is using 128-bit
encryption when connecting to our website.  While this is easy for most (I
have the script working for them), a real problem for me has come up with
clients that run IE on Windows 2K without 128-bit support (ie 40-bit or 56
instead).  Do any of you fine ladies and gentlemen know how to detect a
browser's cipher strength using PHP (or any other web language)?  I am
running PHP 4.3.1 on IIS 5.0 on a Windows 2000 server.  I have tried using
some server vars (namely HTTPS_KEYSIZE) but that reports incorrect data with
the win2k/IE/56-bit configuration I mentioned above.

Any help is appreciated and thanks in advance,

Ed  


--- End Message ---
--- Begin Message ---
I have read and re read all of the webmonkey Installation of Apache/PHP4 and
finally got the phpinfo() function working. I'm sad to say, I can't believe
it took me that long.

now I'm looking at forms and swapping variables - read stuff on that. it is
NOT working. I've made code, copied code, read, reread...etc. My forms swap
the info properly - if I use method=get then the correct info is passed and
visible in the address.

But, when I echo the variables (like $rider_name) they don't show up. And I
know that my INPUTs are named properly - is there something I'm missing?

Thanks.

Stephen Rivas Jr
[EMAIL PROTECTED]
http://www.throttlehead.com



--- End Message ---

Reply via email to