php-windows Digest 29 May 2003 10:50:36 -0000 Issue 1752

Topics (messages 20122 through 20128):

Join Char Strings
        20122 by: Stephen Rivas Jr
        20123 by: DvDmanDT
        20124 by: George Nicolae

vb to write server which supports php
        20125 by: cmkpl

Re: Fatal Error???
        20126 by: Cristian MARIN

Re: query infinitely stuck ...... solved
        20127 by: toby z

Installation problems...
        20128 by: Bobo Wieland

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 ---
Again, looking in PHP.net for help - unable to proceed.

I'm trying to add a variable string, to another literal string and store it
in that variable again. I know it  can be done, simply. However, I always
get "0" when I add them...

$rider_name += "<br>";

I want to take the information from my form, add some html, put in an
array - then write it to a file that looks good for printing.

How can I make a long string of HTML and then write in a variable, then
continue adding to my HTML string...like this:

$html_page_string = "<html><head><title>" + $page_title +
"</title></head><body>";

etc...And then later add to it after I've inserted my other variables and
HTML code:

$html_page_string += "</body></html>";

I think this can be done in JavaScript but ah....Can it in PHP? Thanks a ba
jillion.

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



--- End Message ---
--- Begin Message ---
Change your + against . everywhere...
"Stephen Rivas Jr" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Again, looking in PHP.net for help - unable to proceed.
>
> I'm trying to add a variable string, to another literal string and store
it
> in that variable again. I know it  can be done, simply. However, I always
> get "0" when I add them...
>
> $rider_name += "<br>";
>
> I want to take the information from my form, add some html, put in an
> array - then write it to a file that looks good for printing.
>
> How can I make a long string of HTML and then write in a variable, then
> continue adding to my HTML string...like this:
>
> $html_page_string = "<html><head><title>" + $page_title +
> "</title></head><body>";
>
> etc...And then later add to it after I've inserted my other variables and
> HTML code:
>
> $html_page_string += "</body></html>";
>
> I think this can be done in JavaScript but ah....Can it in PHP? Thanks a
ba
> jillion.
>
> Stephen Rivas Jr
> [EMAIL PROTECTED]
> http://www.throttlehead.com
>
>



--- End Message ---
--- Begin Message ---
Try to use "."
$var1="test";
$var2="join";
$var3=$var1." ".$var2;
echo $var3; //will print "test join"
--


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"Stephen Rivas Jr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Again, looking in PHP.net for help - unable to proceed.
>
> I'm trying to add a variable string, to another literal string and store
it
> in that variable again. I know it  can be done, simply. However, I always
> get "0" when I add them...
>
> $rider_name += "<br>";
>
> I want to take the information from my form, add some html, put in an
> array - then write it to a file that looks good for printing.
>
> How can I make a long string of HTML and then write in a variable, then
> continue adding to my HTML string...like this:
>
> $html_page_string = "<html><head><title>" + $page_title +
> "</title></head><body>";
>
> etc...And then later add to it after I've inserted my other variables and
> HTML code:
>
> $html_page_string += "</body></html>";
>
> I think this can be done in JavaScript but ah....Can it in PHP? Thanks a
ba
> jillion.
>
> Stephen Rivas Jr
> [EMAIL PROTECTED]
> http://www.throttlehead.com
>
>



--- End Message ---
--- Begin Message ---
any one know(use dll of php to link with php)?
thanks


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 19/5/2003



--- End Message ---
--- Begin Message ---
Here is your script debugged but I don't know if is doing what is supposed to do ....
From now you have to see if the logical part is all right.
I don't have a printer on my computer right now so I cannot teste him very well.
 

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
[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="" 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="" 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="">Salir y volver a la pagina principal de
> Asuntos.</a><BR>
> <a href="">Salir y volver a la pagina principal.</a>
> </center>
>
> <!--mstheme--></font>
>
> </BODY>
> </HTML>
>

--- End Message ---
--- Begin Message ---
thnx guyz
the dammed query aint stuck any more

:$
me n my blunders ......


 --- toby z <[EMAIL PROTECTED]> wrote: > 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
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

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

--- End Message ---
--- Begin Message ---
Trying to reinstall PHP/MySQL/Apache on my WinXP setup...

Ran in to some trouble though, that I hope you can help me with... First, I'm getting 
the following warning message:

"Warning: session_start() [function.session-start]: 
open(/tmp\sess_a0b08aae778010e958503bfde26c0ab5, O_RDWR) failed: No such file or 
directory (2) in E:\plantis\sida_1.php on line 1"

I have PHP installed in D:\PHP and in php.ini I've the session save path set to: 
"D:/PHP/tmp". The directory "tmp" is in my PHP directory.



Second problem. I can't connect to mysql. The message says the following;

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: '[EMAIL 
PROTECTED]' (Using password: YES) in E:\pingstkyrkan\data\common_db.inc on line 12
0: Connection faild to the host localhost.

I don't even know if I've installed MySQL correctly... WinMySQLAdmin says MyODBC; Not 
Found, Driver 3.51 Not Found....

Why should it be so hard to install and configure these things?!? Is it because it's 
free software?



Please help me!



thanks!




.bobo


--- End Message ---

Reply via email to