php-windows Digest 24 May 2004 21:12:52 -0000 Issue 2260
Topics (messages 23817 through 23825):
Re: tgz files
23817 by: Svensson, B.A.T. (HKG)
23818 by: Mazhar Bilen
windows mail problem
23819 by: Andy Tawse
23820 by: David Felton
23823 by: Andy Tawse
Re: updating from xls -> [filter] -> mysql
23821 by: Gryffyn, Trevor
Re: Prevent error output from shell_exec
23822 by: Gryffyn, Trevor
Re: PHP and FLASH Remoting - can it be done?
23824 by: Andy Tawse
23825 by: Dunn, Michael O.
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 ---
.tgz, is an abbrevation of ".tar.gz", and is unix specific. On unix system
one traditional; first tar (Tape Archive) directories and files, and then
compress them with gunzip (gzip) - tar does not compress. The file you have
is borth tared and gziped, but instead of naming the file filkename.tar.gz,
it has been (as is common) named filename.tgz.
WinZip should be able to handle gzip (and tar I think).
-----Original Message-----
From: Ross Honniball
To: [EMAIL PROTECTED]
Sent: 24-5-2004 9:20
Subject: [PHP-WIN] tgz files
Hi all,
I'm hoping to install phpdocumentor which I have down-loaded as a 'tgz'
file to my windows machine. I'm not actually familiar with tgz files and
have no idea what I'm actually meant to do with it.
What does one do with a tgz file?
Ross
.
. Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You can open it with a compress program like WinZip.
After opening, you can trace the contents of files.
Mazhar Bilen
----- Original Message -----
From: "Ross Honniball" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 24, 2004 10:20 AM
Subject: [PHP-WIN] tgz files
> Hi all,
>
> I'm hoping to install phpdocumentor which I have down-loaded as a 'tgz'
> file to my windows machine. I'm not actually familiar with tgz files and
> have no idea what I'm actually meant to do with it.
>
> What does one do with a tgz file?
>
> Ross
> .
> . Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
> .
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi there,
I've been having difficulty sending emails from Windows machines. I've
seen this problem in a few places before but I can't seem to fix it on
my machine. When I try to use mail() I get :
mail(): "sendmail_from" not set in php.ini or custom "From:" header missing
The code I'm using is :
$headers = "From: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: My Application";
$ok = @mail($friendMail, $CHALLENGE_MAIL_SUBJECT, $mailText, $headers);
This has worked on my linux server before. It is saying I haven't set a
From header but as you can see I have and my php.ini looks like this :
[mail function]
; For Win32 only.
SMTP = localhost
sendmail_from = [EMAIL PROTECTED]
The mail server is running and should be accepting connections. I've
tried the IIS SMTP server and also Argosoft, set both of them to accept
connections but it doesn't seem to get as far as the SMTP server.
I've tried it on my local machine (XP Pro, IIS 5, PHP 4.3.6) and on the
production server (Win 2003, IIS 6, PHP 4.3.6). I've restarted and done
all the things I've found suggested for this problem but no joy.
Can anyone help?
Thanks for your time,
Andy Tawse.
--- End Message ---
--- Begin Message ---
The Win32 implementation of mail() is notoriously flaky. the approach I take
is to write the raw email directly out to the pickup folder in mailroot. A
function along these lines should help you out:
function sendMail($mailto, $mailfrom, $subject, $text, $format)
{
$maildrop="c:\\inetpub\\mailroot\\pickup\\";//change this to the
location of your mailroot
$filename=<work out some random filename here>;
$fp=fopen($maildrop.$filename, "w");
//different headers for different mail types
if($format=="plain")
fwrite($fp,"Content-Type: text/plain\r\nFrom:
$mailfrom\r\n");
else if($format=="html")
fwrite($fp,"Content-Type: text/html;
charset=iso-8859-1\r\nFrom: $mailfrom\r\n");
//write the email out to the file
fwrite($fp,"To: <$mailto>\r\n");
fwrite($fp,"Subject: $subject\r\n");
fwrite($fp,"\r\n");
fwrite($fp,"$text\r\n\r\n");
fclose($fp);
}
hope that helps.
-----Original Message-----
From: Andy Tawse [mailto:[EMAIL PROTECTED]
Sent: 24 May 2004 10:14
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] windows mail problem
Hi there,
I've been having difficulty sending emails from Windows machines. I've
seen this problem in a few places before but I can't seem to fix it on
my machine. When I try to use mail() I get :
mail(): "sendmail_from" not set in php.ini or custom "From:" header missing
The code I'm using is :
$headers = "From: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: My Application";
$ok = @mail($friendMail, $CHALLENGE_MAIL_SUBJECT, $mailText,
$headers);
This has worked on my linux server before. It is saying I haven't set a
From header but as you can see I have and my php.ini looks like this :
[mail function]
; For Win32 only.
SMTP = localhost
sendmail_from = [EMAIL PROTECTED]
The mail server is running and should be accepting connections. I've
tried the IIS SMTP server and also Argosoft, set both of them to accept
connections but it doesn't seem to get as far as the SMTP server.
I've tried it on my local machine (XP Pro, IIS 5, PHP 4.3.6) and on the
production server (Win 2003, IIS 6, PHP 4.3.6). I've restarted and done
all the things I've found suggested for this problem but no joy.
Can anyone help?
Thanks for your time,
Andy Tawse.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************
--- End Message ---
--- Begin Message ---
That works great, thanks a lot.
David Felton wrote:
The Win32 implementation of mail() is notoriously flaky. the approach I take
is to write the raw email directly out to the pickup folder in mailroot. A
function along these lines should help you out:
function sendMail($mailto, $mailfrom, $subject, $text, $format)
{
$maildrop="c:\\inetpub\\mailroot\\pickup\\";//change this to the
location of your mailroot
$filename=<work out some random filename here>;
$fp=fopen($maildrop.$filename, "w");
//different headers for different mail types
if($format=="plain")
fwrite($fp,"Content-Type: text/plain\r\nFrom:
$mailfrom\r\n");
else if($format=="html")
fwrite($fp,"Content-Type: text/html;
charset=iso-8859-1\r\nFrom: $mailfrom\r\n");
//write the email out to the file
fwrite($fp,"To: <$mailto>\r\n");
fwrite($fp,"Subject: $subject\r\n");
fwrite($fp,"\r\n");
fwrite($fp,"$text\r\n\r\n");
fclose($fp);
}
hope that helps.
-----Original Message-----
From: Andy Tawse [mailto:[EMAIL PROTECTED]
Sent: 24 May 2004 10:14
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] windows mail problem
Hi there,
I've been having difficulty sending emails from Windows machines. I've
seen this problem in a few places before but I can't seem to fix it on
my machine. When I try to use mail() I get :
mail(): "sendmail_from" not set in php.ini or custom "From:" header missing
The code I'm using is :
$headers = "From: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: My Application";
$ok = @mail($friendMail, $CHALLENGE_MAIL_SUBJECT, $mailText,
$headers);
This has worked on my linux server before. It is saying I haven't set a
From header but as you can see I have and my php.ini looks like this :
[mail function]
; For Win32 only.
SMTP = localhost
sendmail_from = [EMAIL PROTECTED]
The mail server is running and should be accepting connections. I've
tried the IIS SMTP server and also Argosoft, set both of them to accept
connections but it doesn't seem to get as far as the SMTP server.
I've tried it on my local machine (XP Pro, IIS 5, PHP 4.3.6) and on the
production server (Win 2003, IIS 6, PHP 4.3.6). I've restarted and done
all the things I've found suggested for this problem but no joy.
Can anyone help?
Thanks for your time,
Andy Tawse.
--
Andy Tawse | Head Programmer
New Media Collective | www.newmediacollective.com
[EMAIL PROTECTED]
0870 4202313 | 07958 578399
--- End Message ---
--- Begin Message ---
You might try putting a "UserControl = False" in there. The application should
automatically end when it's called from COM (unless "UserControl = True") is set. But
you could also try making sure to explicity "Quit()" the the application too. If
you interrupted the script in the middle of running, it might leave the application
running if UserControl is TRUE or it for some reason assumes that it's TRUE (something
wrong with the "COM call = UserControl = FALSE" mechanism or something).
Just some thoughts.
-TG
> -----Original Message-----
> From: Jesper Palmqvist [Talarforum i Skandinavien AB]
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 21, 2004 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: SV: [PHP-WIN] updating from xls -> [filter] -> mysql
>
>
> I have been using PHP with COM
>
> On my Win2000 platform running PHP as a module on Apache2 the excel
> application doesn't end after the script ends
>
> The script ends:
>
> $exapp->Quit();
> unset($exapp);
> ?>
>
> What could be the problem?
>
> /Jesper
>
>
> -----Ursprungligt meddelande-----
> Fr�n: Sven Schnitzke [mailto:[EMAIL PROTECTED]
> Skickat: den 21 maj 2004 14:14
> Till: '[PHP-WIN]'
> �mne: AW: [PHP-WIN] updating from xls -> [filter] -> mysql
>
>
> Hi George,
> are you familiar with COM? If so, consider:
>
> // select range to $r , then do
> if($r->NumberFormat()="a format") { ... }
>
> where "a format" can be "Standard" or something like
> "#,##0.00; -###0.00" or so as used in the "Format - Cells" dialog of
> Excel.
>
> With Excel 8 there seems to be a glitch as it returns localized colour
> names and does not accept english ones (At least my German version
> behaves this way; didn't scrutinize too deeply though).
>
> If you are interested I will send you a basic PHP COM script
> doing EXCEL
> I/O to start from.
>
> HTH
> --
> Sven Schnitzke
>
>
> > -----Urspr�ngliche Nachricht-----
> > Von: George Pitcher [SMTP:[EMAIL PROTECTED]
> > Gesendet am: Freitag, 21. Mai 2004 12:08
> > An: [EMAIL PROTECTED]
> > Betreff: [PHP-WIN] updating from xls -> [filter] -> mysql
> >
> > Hi,
> >
> > I'm thinking ahead to something I'll need to tackle in the future.
> >
> > My current system is Filemaker based and I can import straight from
> > Excel spreadsheets - but with no checking available. Now that I'm
> > re-writing into php/mysql(pear:dB)/smarty, If I can, I'd
> like the user
>
> > to be able to select the file (I can do that bit), check that the
> > column positions match a predefined format (?), and then update
> > records in my db table.
> >
> > Does this look doable? Any hints on how? I don't want to
> use ODBC as
> > the filename will be constantly changing so there'll be no
> dsn set up.
> >
> > George in Oxford
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
You can also put an "@" before the actual DOS command to suppress it's
output ("@dir *.txt"). Between that, using the "@" on you PHP command
and "> NUL", I'd think you could get it to be quiet. Sorry, don't have
time to test this for your ight now. Let us know what you find.
-TG
> -----Original Message-----
> From: Paul J. Smith [mailto:[EMAIL PROTECTED]
> Sent: Saturday, May 22, 2004 6:16 PM
> To: Svensson, B.A.T. (HKG)
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Prevent error output from shell_exec
>
>
> I'm calling ps_exec.
>
> $handle = popen($cmd);
> $read = fread($handle, 2096);
> echo $read;
> pclose($handle);
>
> Does nothing whereas system($cmd) or shel_exec($cmd) works fine, apart
> from the output. $read outputs nothing when I tested it.
> When calling
> popen, can you pass program parameters such as "dir *.tmp /p" ? Maybe
> this is why it's not working. The $cmd I call has rather a lot of
> command line parameters to go with it.
>
>
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> Sent: 22 May 2004 22:59
> To: '[EMAIL PROTECTED] '
> Subject: RE: [PHP-WIN] Prevent error output from shell_exec
>
> I can guarante you that popen() does work - I use it myself
> on a win2003
> server. Since you can use shell_exec() I assume this has nothing to do
> with
> safe_mode being switched on.
>
> How do you call popen() ands what kind of dos program are you calling?
>
>
> -----Original Message-----
> From: Paul J. Smith
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Our company has done quite a few projects with Flash and PHP and they
work great together. There's a number of ways to make them communicate.
Remoting (though I've haven't done much of this myself) is when you use
Flash to call objects in PHP directly. The other ways to do it are by
passing XML or name-value pairs between the Flash and PHP using (I
think) LoadVars and XML objects in Flash. You request a URL (a PHP
script) and it returns either XML or name-value pairs to Flash.
Andy.
--- End Message ---
--- Begin Message ---
Certainly you don't have to (abandon PHP that is :)). I have just set up a
module for a site that we are working on right now that uses amfphp
(ActionScript Message Format for php). They are still in beta (it's open
source code), currently in the 0.9 version and from what I have seen is
fully functional. You'll also need to download flash remoting from
Macromedia to ensure getting things to work.
Another option if you wanted is to use SOAP with the WebServiceConnector; we
did this for another site although I will say that the speed difference
between the two is amazing. The only way that I'd use SOAP (as it does still
have it's uses) would be for connecting to data from say Amazon, but from
here on out for our site's internal needs we will be using amfphp for Flash
Remoting. You can get amfphp a the following URL: http://www.amfphp.org/
<http://www.amfphp.org/> . I'm not sure if you are using a CMS or not but
we've set ours up as a Xaraya module and we can not use Flash and Xaraya
seamlessly. Let me know if you have any questions on set up or usage within
Flash.
Michael Dunn
Web Development
INHS/IRM
(509) 232-8258
[EMAIL PROTECTED]
--- End Message ---