[PHP] Re: Windows CLI and task scheduler

2005-01-19 Thread Dominic Schanen
I changed the scheduled task to use php.exe instead of php-win.exe and 
that cleared up the errors with unloading the profile that were 
appearing in the application log. Could this possibly be a bug with 
php-win.exe and not cleaning up properly?

Thanks,
Dominic
Dominic Schanen wrote:
I've written several command line scripts to run as scheduled tasks on a 
Windows 2000 Server machine. They run fine, no problems. However, the 
application log is filling up with errors stating that windows was 
unable to unload my registry profile. I know the PHP scripts are at 
fault because the errors are being recorded at the same intervals as my 
scheduled tasks.

I installed UPHClean to cleanup the unloaded profiles but that simply 
doubles the number of log entries created.

I was wondering if anyone else has run into this problem? Is this a task 
scheduler problem or a PHP problem? If it is a task scheduler problem, 
is there something I can do by exiting or closing differently in PHP?

I have PHP 5.0.3 and am using php-win.exe
Thanks,
Dominic
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Windows CLI and task scheduler

2005-01-18 Thread Dominic Schanen
I've written several command line scripts to run as scheduled tasks on a 
Windows 2000 Server machine. They run fine, no problems. However, the 
application log is filling up with errors stating that windows was 
unable to unload my registry profile. I know the PHP scripts are at 
fault because the errors are being recorded at the same intervals as my 
scheduled tasks.

I installed UPHClean to cleanup the unloaded profiles but that simply 
doubles the number of log entries created.

I was wondering if anyone else has run into this problem? Is this a task 
scheduler problem or a PHP problem? If it is a task scheduler problem, 
is there something I can do by exiting or closing differently in PHP?

I have PHP 5.0.3 and am using php-win.exe
Thanks,
Dominic
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Grammar for PHP

2004-11-28 Thread Dominic Fox
Hi,

I would like to parse some PHP files to extract some information about
them. Is there a formal grammar (EBNF or other) anywhere that I could
use as a reference?

I'd like to write the parser myself (in Haskell), so existing PHP
parsers (in PHP itself, for instance) aren't quite what I'm looking
for.

thanks,
Dominic
-- 
// Dream in black and white -
// model cities, shooting up in the air

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] CURL question, cutting off custom request

2004-08-16 Thread Dominic Schanen
Hello,
I'm sending a custom request to a server using CURL, which may contain 
some high-ascii characters. Are there certain characters that would 
cause CURL not to send the complete custom request? Are there some CURL 
options that can help make sure the request is sent in its entirity? 
Here is my code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec ($ch);
Sometimes it appears to cutoff my request with the existance of a NUL 
character.

Any ideas?
Thanks,
Dominic
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] LRC (longitudinal redundancy check) and Even Parity

2004-08-12 Thread Dominic Schanen
Hello,
I'm working on some code to authorize and settle directly with Vital. 
Some of the inspiration and code samples have come from the Perl module 
Business::OnlinePayment::VirtualNet.

Things are working good approximately 99% of the time. However, my 
communication is getting Nak'd on settlement before getting to Vital. 
When I reassign my batches, it comes down to one transaction that is 
causing the problem. I believe the problem is either in my LRC 
(longitudinal redundancy check) calculation or my conversion of the 
string to even parity.

I'm hoping there is someone out there that knows more about LRC and even 
parity than I do that can look over the below functions to see if they 
are calculating the LRC and even parity correctly. In the last 3 that 
have gotten Nak'd, it appears the commonality between the transactions 
is that my LRC value is a 'nul' character (000 binary) on the detail 
record. So I'm either thinking that I'm not converting the nul character 
to even parity correctly or my LRC is slightly off and it shouldn't be a 
nul character.

If there may be functions in PHP that I'm overlooking that could do this 
easier for me, please let me know as well. Thanks to anyone you might 
lend some advice.

Here are my functions:
/* LRC /
/*** taken from Perl module String::LRC ***/
function lrc($buffer)
{
$len = 0;
if (isset($buffer)  !empty($buffer)){
$len = strlen($buffer);
}
$check = substr($buffer, 0, 1);
for ($i = 1; $i  $len ; $i++) {
$check ^= substr($buffer, $i, 1);
}
return $check;
}
/* Set Even Parity ***/
function setEvenParity($str)
{
$chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
foreach ($chars as $key = $val){
$chars[$key] = evenParityChar($val);
}
return implode(, $chars);
}

function evenParityChar($char)
{
$bin = sprintf(%07b,ord($char));
$check = substr($bin, 0, 1);
for ($i = 1; $i  strlen($bin); $i++){
$check ^= substr($bin, $i, 1);
}
$dec = pack('C', bindec($check . $bin));
return $dec;
}
Thanks,
Dominic
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: LRC (longitudinal redundancy check) and Even Parity

2004-08-12 Thread Dominic Schanen
I was calculating the LRC before setting even parity. I'm hoping that 
was my problem. If so, this is the change that I made, in case anyone 
else can find use in these functions:

/* LRC /
/*** taken from Perl module String::LRC ***/
function lrc($buffer)
{
$len = 0;
$buffer = setEvenParity($buffer);
if (isset($buffer)  !empty($buffer)){
$len = strlen($buffer);
}
$check = substr($buffer, 0, 1);
for ($i = 1; $i  $len ; $i++) {
$check ^= substr($buffer, $i, 1);
}
return $check;
}
We'll see how this goes tomorrow.
Dominic
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] automatic credit card processing

2002-07-22 Thread Dominic

great! it works! thank you very much!
this is the code which does exactly what I wanted:
$ch = curl_init ();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POSTFIELDS, RESP_FORMAT=1);
$result= curl_exec ($ch);
curl_close ($ch);

cheerio



Martin Towell wrote:
 either use curl, and set to option to return the results to you to on
 or use ob_start(), ob_get_contents(), etc
 
 -Original Message-
 From: Dominic [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 22, 2002 4:11 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] automatic credit card processing
 
 
 Hi all
 I try to automatically process cc payment. I use online clearing via a 
 third party
 -- so what I have to do:
 1. SSL-TCP/IP connection to this third party-server
 2. perform basic http authentication
 3. send authorization request parameters to the software (via POST or GET)
 4. receive + parse authorization response
 
 1-3 is not a real problem, but how can I receive the response, before it 
 is printed out to the browser/screen? I know I should get the response 
 string into a variable so the whole procedure is silent, but how?
 
 thanks a lot for every little help!
 
 cheers
 
 dominic


-- 
dominic brander


dominic brander - snowflake productions gmbh - http://www.snowflake.ch
tel. 01 451 75 71 - fax. 01 451 63 80 - mobile 076 543 17 94


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] automatic credit card processing

2002-07-21 Thread Dominic

Hi all
I try to automatically process cc payment. I use online clearing via a 
third party
-- so what I have to do:
1. SSL-TCP/IP connection to this third party-server
2. perform basic http authentication
3. send authorization request parameters to the software (via POST or GET)
4. receive + parse authorization response

1-3 is not a real problem, but how can I receive the response, before it 
is printed out to the browser/screen? I know I should get the response 
string into a variable so the whole procedure is silent, but how?

thanks a lot for every little help!

cheers

dominic
-- 
dominic brander


dominic brander - snowflake productions gmbh - http://www.snowflake.ch
tel. 01 451 75 71 - fax. 01 451 63 80 - mobile 076 543 17 94


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PDF generation post vs get

2001-11-28 Thread Dominic Schanen

Hello,

I'm trying to generate address labels on a pdf sheet. If I use a method of
'GET' for my form, it works fine. However, if I use 'POST', I just get what
seems like a blank white pdf. It does the same in either Netscape 4.7 or IE
6.

Any ideas?

PHP v. 4.0.6
PDFLib 4.0.1

Thanks.

--
Dominic



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PayFlowPro and OpenSSL

2001-11-21 Thread Dominic Schanen

Hello,

I'm trying to install the Linux PayFlowPro SDK with OpenSSL. However, it
appears that the SDK is linked to OpenSSL v. 0.9.5a and the version we
currently have installed (and is recommended) is OpenSSL v 0.9.6b. Does
anyone have a solution to re-link the SDK with OpenSSL v 0.9.6b or any other
work arounds? Thanks.

--
Dominic Schanen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mcrypt trouble, still

2001-08-23 Thread Dominic Schanen

Well, in response to my previous post and its reply, the server
administrator tried reinstalling mcrypt and did the testing during the
install and it all seemed to work for him there. However, I still get the
error:

Warning: mcrypt module initialization failed

So, now my question is this. In the phpinfo file, all the ciphers and modes
are listed fine and it shows that mcrypt is enabled. However, for the
directives mcrypt.algorithms_dir and mcrypt.modes_dir, they have no local or
master value. Is this something that needs to be set in phpinfo to point at
the mcrypt installation? Thanks.

--
Dominic



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mcrypt trouble

2001-08-21 Thread Dominic Schanen

Hello,

I'm trying to do mcrypt encryption but I continue to get the following
error:

Warning: mcrypt module initialization failed

and this is the line of code that I get the error from:

$string = mcrypt_cbc(MCRYPT_DES, $key, $test, encrypt);

I've also tried several different version of using the function
mcrypt_encrypt as well but nothing seems to work. In my phpinfo file, this
is what I have for the mcrypt module:

Version: 2.4.x

Supported Ciphers:
cast-128 cast-256 enigma xtea arcfour panama safer-sk64 saferplus des
tripledes blowfish gost rc2 safer-sk128 threeway serpent wake loki97
rijndael-128 rijndael-192 rijndael-256 twofish blowfish-compat

Supported modes:
stream cbc cfb ecb ofb nofb

Does someone know if I am coding something wrong or if there is a problem
with the installation of php (v 4.0.6) on the server that I am on? Thanks
for the help.

--
Dominic



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Client Machine Name

2001-07-25 Thread Dominic

I think this only can get the machine name of vistors ISP...
It's there anyway to get visters OWN machine name?
Thanks!!!

Dominic

http://php.net/manual/en/language.variables.predefined.php
$REMOTE_HOST = gethostbyaddr($REMOTE_ADDR);


 It's there anyway to find out the client machine name by using php?
 Thanks!

 Dominic



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Machine name???

2001-07-25 Thread Dominic

I think this only can get the machine name of vistors ISP...
It's there anyway to get visters OWN machine name?
Thanks!!!

Dominic

http://php.net/manual/en/language.variables.predefined.php
$REMOTE_HOST = gethostbyaddr($REMOTE_ADDR);


 It's there anyway to find out the client machine name by using php?
 Thanks!

 Dominic



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Client Machine Name

2001-07-24 Thread Dominic

It's there anyway to find out the client machine name by using php?
Thanks!

Dominic



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP 4.0.5 Install problem and MySQL

2001-05-10 Thread Dominic Schanen

Hello,

I'm attempting to upgrade my version of PHP from 4.0.4pl1 to 4.0.5. My
configure command is the following for both versions:

---
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --with-zlib=
/usr/local --with-gd=/usr/local --with-jpeg-dir=/usr --with-png-dir=/usr/loc
al --with-tiff-dir=/usr/local --with-freetype --with-t1lib --with-pdflib=/us
r/local --enable-track-vars
---

With v4.0.4pl1, everything works great. With v4.0.5, everything builds and
compiles just fine. However, when I go to a page that try to access MySQL,
the page stops loading and the first instance of trying to access MySQL and
it outputs a only a colon as  if it were trying to output an error.

Does anyone know what may be going on here. The OS is Redhat 5.2, MySQL is
v. 3.23.37. Thanks.

--
Dominic




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] remotly include file

2001-05-08 Thread Dominic Brander

Hi
I'm trying to include some php3 files via http.
one part of the php files is on a regular server and the other part is
on an secure server.
Instead of duplicating all the files for both servers I would like to
include them via http.
How does it work?

thanx

domnic

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: AW: [PHP] remotly include file

2001-05-08 Thread Dominic Brander

exactly! this way (http...) it does not work!
I tried it a few times!
it is on the same server. so i did it with the /home/.. -path. but this
also does not work properly.
i think the proplem is, that within the included file there are other
files included (and so on...).
Error Message:
Warning: Failed opening 'inc/var_general.inc.php3' for inclusion
(include_path='') in /opt/...

May you know a solution?

thanx

dominic

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] pdflib: unable to generate on the fly, need to write to file

2001-01-26 Thread Dominic Schanen

On Thu, 25 Jan 2001 18:42:41 -0700 (MST), [EMAIL PROTECTED]
wrote:

I don't know, but I'd love to know the answer to this, too.  I currently have 
to do the same as you: output to file and then direct the browser to the disk-
based file.  (Then I have to bother about file cleanup.)

I had pdflib version 3.03 and found the patch that Uwe talked about and
that fixed my problem with the creating pdfs out of memory. However,
with IE, you will need to create it from file so you can get the
document length so that IE displays the document appropriately. What I
do to get around this is create the document in a tmp folder with the
time stamp and then unlink the same file after I have appropriately
fpassthru() the file to the browser with the appropriate headers for IE
(Content-length).

--
Dominic


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how to rename a database

2001-01-26 Thread Dominic

at a mysql prompt in the database where your table resides, type the
following:

alter table currentname rename newname;

That should take care of it.

--
Dominic

Fang Li wrote:
 
 Does anyone know how to rename a database in MySQL?
 Thanks!
 
 fang
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]