php-windows Digest 13 Sep 2004 10:36:08 -0000 Issue 2393
Topics (messages 24559 through 24560):
Problem with mapped drive on XP - PHP5
24559 by: George Pitcher
eregi
24560 by: George Pitcher
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,
Having sorted most of my upgrade issues, one remains (that worked previously
with v4).
My code:
01 <?php
02 $filename ="c:\\deliveries\\upload\\jphp.bat";
03 if($filename){unlink($filename);}
04 $howmany = $_POST['howmany'];
05 $sourcepath="G:\\";
06 $targetpath="C:\\deliveries\\upload\\";
07 $counter=1;
08 $cmd = "";
09 while ($counter <= $howmany) {
10 $source = 'source'.$counter;
11 $source = $_POST[$source];
12 $target = 'target'.$counter;
13 $target = $_POST[$target];
14 $counter++;
15 $_source = $sourcepath.ltrim(rtrim($source)).".pdf";
16 $_target = $targetpath."f".ltrim(rtrim($target)).".pdf";
17 $copied = copy($_source, $_target);
18 $cmd.="java -cp C:\\j2sdk1.4.2_05\\jre\\lib\\itext.jar
com.lowagie.tools.concat_pdf c".$target.".pdf f".$target.".pdf
d".$target.".pdf\r\n";
19 $cmd.="java -cp C:\\j2sdk1.4.2_05\\jre\\lib\\itext.jar
com.lowagie.tools.encrypt_pdf d".$target.".pdf ".$target.".pdf \"\" ********
10100100 128\r\n";
20 $cmd.="del ".$targetpath."d".$target.".pdf\r\n";
21 $cmd.="del ".$targetpath."c".$target.".pdf\r\n";
22 $cmd.="del ".$targetpath."f".$target.".pdf\r\n";
23 }
24 if (!$handle = fopen($filename, 'w')) {exit;}
25 if (!fwrite($handle, $cmd)) {exit;}
26 fclose($handle);
27 header("Location: [show the ftp folder]");
28 ?>
By the way, the java stuff is a set of tools that allow me to put two PDFs
together and then encrypt the final file. Tha batch file then deletes the
temp files leaving me with the 'locked' final file to ftp to my server.
I get no errors but the file that should have been copied from the mapped
'G' drive just isn't being copied. This worked before the upgrade to PHP 5.
Any ideas?
George
--- End Message ---
--- Begin Message ---
Hi,
I'm trying to validate page range data. This can be entered as (example)
i-ix,1,23-45. I am trying to ensure that, where the user is pasting data
from a web page, for instance, that uses an 'n-dash' rather than a hyphen
(but could use something else), that the user is alerted to re-type the
data.
my function is:
function validate_pr($pr){
$regexp = "([ilmvxcd0-9-]+)";
$valid = 0;
if (eregi($regexp, $pr)){
$valid = 1;
} else {
$valid = 0;
}
return $valid;
}
but when tested, it just ignores the n-dash and accepts it.
Am I doing something wrong, or is there another test I could use?
MTIA
George
--- End Message ---