php-windows Digest 30 May 2007 09:16:44 -0000 Issue 3244
Topics (messages 27988 through 27999):
multipart/alternative email
27988 by: Bill Bolte
Printing via webapp
27989 by: Moore, Joshua
27990 by: Stut
27991 by: Moore, Joshua
27992 by: Stut
27993 by: Moore, Joshua
27994 by: Stut
27995 by: Niel Archer
wiki languages for file
27996 by: bedul
Configuring and send mails in winxp??
27997 by: Alejandro G.
27999 by: N.A.Morgan.bton.ac.uk
PHP Security Basics - web seminar
27998 by: Lasitha Alawatta
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 ---
OOPS, forgot to change the subject line! Should be multipart/alternative
email...
-----Original Message-----
From: Bill Bolte [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 3:10 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Re: WAMP Clustering
trying to send a multipart email (with text and html options). every so
often in the resulting email i see some spaces and an !. could be right
in the middle of a word or in between some words, doesn't matter. nor
can I really establish that's it's after so many characters. below is
the code, can anyone see if I'm missing something?
$mime_boundary = "----High Touch Inc----".md5(time());
$to = $email;
$subject = "2008 High Touch Users Conference Date Survey";
$headers = "From: Webmaster <[EMAIL PROTECTED]>\n";
$headers .= "Reply-To: Webmaster <[EMAIL PROTECTED]>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative;
boundary=\"$mime_boundary\"\n";
$message = "--$mime_boundary\n";
//$message .= "Content-Type: text/plain; charset=UTF-8\n";
//$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= $tmsg."\n";
$message .= "--$mime_boundary\n";
//$message .= "Content-Type: text/html; charset=UTF-8\n";
//$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "<html>\n";
$message .= "<body style=\"font-family:Verdana, Verdana, Geneva,
sans-serif; font-size:14px; color:#666666;\">\n";
$message .= $hmsg."\n";
$message .= "</body>\n";
$message .= "</html>\n";
$message .= "--$mime_boundary--\n\n";
$mail_sent = @mail( $to, $subject, $message, $headers );
echo $mail_sent ? "Mail sent<br />" : "Mail failed<br />";
Bill
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Im having a few odd issues with printing and im hoping someone can help me.
I can manually print to my barcode printer just fine (FILE<PRINT in a web
browser). However if I try and print using PHP printer_write it doesn't
print. Yes I have the php_printer.dll installed. My code:
<?
function getPrinter($SharedPrinterName) {
global $REMOTE_ADDR;
$host = getHostByAddr($REMOTE_ADDR);
return "\\\\".$host."\\".$SharedPrinterName;
}
$handle = printer_open(getPrinter("ZebraZ4M"));
printer_write($handle, "Text to print");
printer_close($handle);
?>
Gives the following error:
Warning: printer_write() [function.printer-write
<http://localhost/test/function.printer-write> ]: couldn't allocate the
printerjob [1804] in W:\www\test\print.php on line 19
And it doesn't print. I'm quite lost. Also, im using uniform server on
windows XP and I do have my printer drivers install since I can print
manually just fine...
Any ideas? Thanks
--- End Message ---
--- Begin Message ---
Moore, Joshua wrote:
Im having a few odd issues with printing and im hoping someone can help me.
I can manually print to my barcode printer just fine (FILE<PRINT in a web
browser). However if I try and print using PHP printer_write it doesn't
print. Yes I have the php_printer.dll installed. My code:
<?
function getPrinter($SharedPrinterName) {
global $REMOTE_ADDR;
$host = getHostByAddr($REMOTE_ADDR);
return "\\\\".$host."\\".$SharedPrinterName;
}
$handle = printer_open(getPrinter("ZebraZ4M"));
printer_write($handle, "Text to print");
printer_close($handle);
?>
Gives the following error:
Warning: printer_write() [function.printer-write
<http://localhost/test/function.printer-write> ]: couldn't allocate the
printerjob [1804] in W:\www\test\print.php on line 19
And it doesn't print. I'm quite lost. Also, im using uniform server on
windows XP and I do have my printer drivers install since I can print
manually just fine...
It's almost certainly permissions-related. The user that your web server
runs as needs to have access to the printer.
-Stut
--- End Message ---
--- Begin Message ---
But under printer permissions its set to allow "everyone" to print.
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 1:56 PM
To: Moore, Joshua
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Printing via webapp
Moore, Joshua wrote:
> Im having a few odd issues with printing and im hoping someone can help me.
>
> I can manually print to my barcode printer just fine (FILE<PRINT in a web
> browser). However if I try and print using PHP printer_write it doesn't
> print. Yes I have the php_printer.dll installed. My code:
>
> <?
> function getPrinter($SharedPrinterName) {
>
> global $REMOTE_ADDR;
>
> $host = getHostByAddr($REMOTE_ADDR);
>
> return "\\\\".$host."\\".$SharedPrinterName;
>
> }
>
> $handle = printer_open(getPrinter("ZebraZ4M"));
>
> printer_write($handle, "Text to print");
>
> printer_close($handle);
>
> ?>
>
> Gives the following error:
>
> Warning: printer_write() [function.printer-write
> <http://localhost/test/function.printer-write> ]: couldn't allocate the
> printerjob [1804] in W:\www\test\print.php on line 19
>
> And it doesn't print. I'm quite lost. Also, im using uniform server on
> windows XP and I do have my printer drivers install since I can print
> manually just fine...
It's almost certainly permissions-related. The user that your web server
runs as needs to have access to the printer.
-Stut
--- End Message ---
--- Begin Message ---
Moore, Joshua wrote:
But under printer permissions its set to allow "everyone" to print.
I don't know enough about Windows security to be much more help here,
but I will say that if you're using IIS then the IUSR_machine user is
'special' and lacks a lot of the permissions that normal users have.
Probably worth checking the result of printer_open - I'm guessing it's
failing. You may also want to search the archives of this list as
problems with printing come up fairly frequently.
-Stut
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 1:56 PM
To: Moore, Joshua
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Printing via webapp
Moore, Joshua wrote:
Im having a few odd issues with printing and im hoping someone can help me.
I can manually print to my barcode printer just fine (FILE<PRINT in a web
browser). However if I try and print using PHP printer_write it doesn't
print. Yes I have the php_printer.dll installed. My code:
<?
function getPrinter($SharedPrinterName) {
global $REMOTE_ADDR;
$host = getHostByAddr($REMOTE_ADDR);
return "\\\\".$host."\\".$SharedPrinterName;
}
$handle = printer_open(getPrinter("ZebraZ4M"));
printer_write($handle, "Text to print");
printer_close($handle);
?>
Gives the following error:
Warning: printer_write() [function.printer-write
<http://localhost/test/function.printer-write> ]: couldn't allocate the
printerjob [1804] in W:\www\test\print.php on line 19
And it doesn't print. I'm quite lost. Also, im using uniform server on
windows XP and I do have my printer drivers install since I can print
manually just fine...
It's almost certainly permissions-related. The user that your web server
runs as needs to have access to the printer.
-Stut
--- End Message ---
--- Begin Message ---
No, im not using IIS =\ since im using Uniform Server I thought it would just
use the same user that im logged in with running the service...
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 2:05 PM
To: Moore, Joshua
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Printing via webapp
Moore, Joshua wrote:
> But under printer permissions its set to allow "everyone" to print.
I don't know enough about Windows security to be much more help here,
but I will say that if you're using IIS then the IUSR_machine user is
'special' and lacks a lot of the permissions that normal users have.
Probably worth checking the result of printer_open - I'm guessing it's
failing. You may also want to search the archives of this list as
problems with printing come up fairly frequently.
-Stut
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 29, 2007 1:56 PM
> To: Moore, Joshua
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Printing via webapp
>
> Moore, Joshua wrote:
>> Im having a few odd issues with printing and im hoping someone can help
me.
>>
>> I can manually print to my barcode printer just fine (FILE<PRINT in a web
>> browser). However if I try and print using PHP printer_write it doesn't
>> print. Yes I have the php_printer.dll installed. My code:
>>
>> <?
>> function getPrinter($SharedPrinterName) {
>>
>> global $REMOTE_ADDR;
>>
>> $host = getHostByAddr($REMOTE_ADDR);
>>
>> return "\\\\".$host."\\".$SharedPrinterName;
>>
>> }
>>
>> $handle = printer_open(getPrinter("ZebraZ4M"));
>>
>> printer_write($handle, "Text to print");
>>
>> printer_close($handle);
>>
>> ?>
>>
>> Gives the following error:
>>
>> Warning: printer_write() [function.printer-write
>> <http://localhost/test/function.printer-write> ]: couldn't allocate the
>> printerjob [1804] in W:\www\test\print.php on line 19
>>
>> And it doesn't print. I'm quite lost. Also, im using uniform server on
>> windows XP and I do have my printer drivers install since I can print
>> manually just fine...
>
> It's almost certainly permissions-related. The user that your web server
> runs as needs to have access to the printer.
>
> -Stut
--- End Message ---
--- Begin Message ---
Moore, Joshua wrote:
No, im not using IIS =\ since im using Uniform Server I thought it would just
use the same user that im logged in with running the service...
In that case I really can't help you since I've never heard of Uniform
Server.
Check the task manager and see what user it's running as. Whatever the
outcome I would say it's worth asking on a mailing list for that
particular server as well as here.
-Stut
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 2:05 PM
To: Moore, Joshua
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Printing via webapp
Moore, Joshua wrote:
But under printer permissions its set to allow "everyone" to print.
I don't know enough about Windows security to be much more help here,
but I will say that if you're using IIS then the IUSR_machine user is
'special' and lacks a lot of the permissions that normal users have.
Probably worth checking the result of printer_open - I'm guessing it's
failing. You may also want to search the archives of this list as
problems with printing come up fairly frequently.
-Stut
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 29, 2007 1:56 PM
To: Moore, Joshua
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Printing via webapp
Moore, Joshua wrote:
Im having a few odd issues with printing and im hoping someone can help
me.
I can manually print to my barcode printer just fine (FILE<PRINT in a web
browser). However if I try and print using PHP printer_write it doesn't
print. Yes I have the php_printer.dll installed. My code:
<?
function getPrinter($SharedPrinterName) {
global $REMOTE_ADDR;
$host = getHostByAddr($REMOTE_ADDR);
return "\\\\".$host."\\".$SharedPrinterName;
}
$handle = printer_open(getPrinter("ZebraZ4M"));
printer_write($handle, "Text to print");
printer_close($handle);
?>
Gives the following error:
Warning: printer_write() [function.printer-write
<http://localhost/test/function.printer-write> ]: couldn't allocate the
printerjob [1804] in W:\www\test\print.php on line 19
And it doesn't print. I'm quite lost. Also, im using uniform server on
windows XP and I do have my printer drivers install since I can print
manually just fine...
It's almost certainly permissions-related. The user that your web server
runs as needs to have access to the printer.
-Stut
--- End Message ---
--- Begin Message ---
> In that case I really can't help you since I've never heard of Uniform
> Server.
Uniform Server is a WAMP package. It was mentioned on this or the Db
list recently. Presumably then, Apache's permissions would be the
determining factor?
http://www.uniformserver.com/
Niel
--- End Message ---
--- Begin Message ---
sry about my title.
i have a text like bellow
Bla bla bla [[file:indo.jpg]] bla bla bla [[file:none.jpg]]
i want to translate into:
Bla bla bla <img src=indo.jpg> bla bla bla <text color=red>none.jpg</text>
which is.. indo.jpg are exits but none.jpg is not. can u help to to parse the
text?
thx in advance.
actualy there were a lot languages i want to ask, but i want to ask above
first.. perhaps i can manage to create other like [[tes]] into <a
href=tes>tes</a>
--- End Message ---
--- Begin Message ---
Hi Everybody! I need to configure the mail option in PHP because I want to
use the function mail( ) with the smtp of my ISP.
My machine is the server of an Intranet and the mail had to go to the
Internet.
This server is using Apache 2.x
How can I configure php to do that??
I read the documentation and I write some code but the mail is sent but is
going nowhere because I send to another mail direction (mine, obviously) and
it never arrive.
HELP!!!
--- End Message ---
--- Begin Message ---
If you are using a Windows version of PHP, the mail facility is
pre-compiled. All you need to do is set the PHP.INI directives below.
[mail function]
; For Win32 only.
SMTP = [EMAIL PROTECTED]
smtp_port = 25
; For Win32 only.
sendmail_from = [EMAIL PROTECTED]
Regards,
Neil
-----Original Message-----
From: Alejandro G. [mailto:[EMAIL PROTECTED]
Sent: 30 May 2007 01:19
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Configuring and send mails in winxp??
Hi Everybody! I need to configure the mail option in PHP because I want
to use the function mail( ) with the smtp of my ISP.
My machine is the server of an Intranet and the mail had to go to the
Internet.
This server is using Apache 2.x
How can I configure php to do that??
I read the documentation and I write some code but the mail is sent but
is going nowhere because I send to another mail direction (mine,
obviously) and it never arrive.
HELP!!!
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi All,
"PHP Security Basics - Must-Knows for Everyone"
Presenter: John Coggeshall, Zend Solutions Consultant Target audience:
Anyone who believes Security is important in Web Application development
and deployment
Duration: 45 minutes, including Q&A
Security is not just important when you are doing financial transactions
- an insecure Web site can be used by others for malicious purposes to
launch attacks against other Web sites. There are a few must-knows for
anyone who ventures out into the world of PHP Web development. In this
webinar John Coggeshall will focus on the absolute necessities when
doing secure Web development.
REGISTER - PHP Security Basics
<http://cts.vresp.com/c/?ZendTechnologies/911c551250/d53224e5ba/292e9a4c
50>
Regards,
Lasitha
DOTW DISCLAIMER:
This e-mail and any attachments are strictly confidential and intended for the
addressee only. If you are not the named addressee you must not disclose, copy
or take
any action in reliance of this transmission and you should notify us as soon as
possible. If you have received it in error, please contact the message sender
immediately.
This e-mail and any attachments are believed to be free from viruses but it is
your responsibility to carry out all necessary virus checks and DOTW accepts no
liability
in connection therewith.
This e-mail and all other electronic (including voice) communications from the
sender's company are for informational purposes only. No such communication is
intended
by the sender to constitute either an electronic record or an electronic
signature or to constitute any agreement by the sender to conduct a transaction
by electronic means.
--- End Message ---