php-windows Digest 2 Jul 2003 03:34:14 -0000 Issue 1804
Topics (messages 20640 through 20644):
Re: SQL Server - 255 field size limit in PHP ?
20640 by: Flint Doungchak
PDF Attahcment in MIMe message
20641 by: PHodd (Peter)
20642 by: Manuel Lemos
Noobie SMTP Questions
20643 by: Mark McCarthy
20644 by: Manuel Lemos
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 ---
Dessie,
The deal is that the default microsoft libraries that are used as a part of the module
(the mssql module) doesn't support varchar beyond 255 chars. Although SQL Server does,
since the library doesn't, you're kinda screwed. You could use ADO. I know that the
person who works on the SQL server module is working on a fix, but that fix entails
not use the microsoft sql server library. I think the play is to use Free DTS at some
point. Don't recall. That could be a while.
That's the deal. Sorry.
-Flint
-----Original Message-----
From: DessieD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 01, 2003 2:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] SQL Server - 255 field size limit in PHP ?
Hi
Im new to PHP so may be an obvious workaround to this. Not sure if it could
be a bug in PHP..
I have a SQLServer table that contains a large nvarchar field (size: 2000).
My php code to retireve and display this field is something like (dont have
code to hand right now):
$quote = mssql_fetch_array($query);
echo $quote[0];
The problem is that only the first 255 characters are getting returned by
PHP !? The mssql_fetch_array function creates the returned array so its not
something I can manually size etc.
Anyone seen this before, or offer any comments ??
Thanks
D
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I cannot get a pdf attachment to a multi-part MIME email message working.
The pdf document ends up not being able to be read by Acrobat reader, and
when inspected with notepad, the file appears to be shorter than the
original. My code is:
$file_url = "//asb-intranet/c$/tempuserfiles/PO-phodd-105457.pdf";
SendAttachment($file_url);
function SendAttachment($file_url) {
//header
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"MIME_BOUNDRY\"\n";
$headers .= "This is a multi-part message in MIME format.\n";
//message
$message = "--MIME_BOUNDRY\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "\n\nYour purchase order is attached.\n";
$message .= "\n";
$message .= "--MIME_BOUNDRY\n";
$message .= "Content-Type: application/pdf; name=\"PO.pdf\"\n";
$message .= "Content-disposition: attachment\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "\n";
$fp = fopen($file_url,"r");
$str = fread($fp, filesize($file_url));
$str = chunk_split(base64_encode($str));
$message .= "$str\n";
$message .= "\n";
//message ends
$message .= "--MIME_BOUNDRY--\n";
mail("[EMAIL PROTECTED]","Purchase Order",$message,$headers);
}
Any ideas to help me?
Regards,
Peter Hodd
Watercare Services Limited uses the Microsoft Office 2000 suite of
applications. It is recommended that any files sent to us are
compatible with these applications.
######################################################################
Disclaimer:
This e-mail message and any attachments is privileged and confidential.
It may contain information that is subject to statutory restrictions on
its use.
If you are not the intended recipient, you must not peruse, use, pass
on or copy this message or its attachments. If you have received this
message in error, please advise us by return e-mail, and delete the
message and attachments from your system.
This e-mail has been scanned and cleared by MailMarshal
www.marshalsoftware.com
######################################################################
--- End Message ---
--- Begin Message ---
Hello,
On 07/01/2003 04:08 PM, Phodd wrote:
I cannot get a pdf attachment to a multi-part MIME email message working.
The pdf document ends up not being able to be read by Acrobat reader, and
when inspected with notepad, the file appears to be shorter than the
original. My code is:
I don't know what that could be. Maybe you would like to try this class
for composing and sending messages that supports attachments and see if
it works for you:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Hi Folks,
Thanks in advance to whomever takes this on. :)
I'm realtively new to php and have begun using an opensource product as the
CMS for my website. I like the product so much that I would like to run
multiple installs on the same server. However, with the mail settings being
defined in php.ini I can only have one smtp amd mailfrom defined.
This is fine if I only want one of the domains to send mail, however each
domain will need to send mail.
Is there a way to set up the php.ini file so that each site can have it's
own smtp?
The code from the product that grabs all the variables is below. Maybe I
could modify this to get the results I'm looking for?
----------------------------------------------------------------------------
--------------------------------------------
if (!ini_get('register_globals')) {
session_start();
$raw = phpversion();
list($v_Upper,$v_Major,$v_Minor) = explode(".",$raw);
if(($v_Upper > 4 && $v_major < 1) || $v_Upper < 4){
$_FILES = $HTTP_POST_FILES;
$_ENV = $HTTP_ENV_VARS;
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_COOKIE = $HTTP_COOKIE_VARS;
$_SERVER = $HTTP_SERVER_VARS;
$_SESSION = $HTTP_SESSION_VARS;
$_FILES = $HTTP_POST_FILES;
}
while(list($key,$value)=each($_FILES)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_ENV)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_GET)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_POST)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_COOKIE)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_SERVER)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_SESSION)) $GLOBALS[$key]=$value;
foreach($_FILES as $key => $value) {
$GLOBALS[$key]=$_FILES[$key]['tmp_name'];
foreach($value as $ext => $value2) {
$key2 = $key."_".$ext;
$GLOBALS[$key2]=$value2;
}
}
}
----------------------------------------------------------------------------
--------------------------------------------
thanks again.
--- End Message ---
--- Begin Message ---
Hello,
On 07/01/2003 10:03 PM, Mark McCarthy wrote:
Thanks in advance to whomever takes this on. :)
I'm realtively new to php and have begun using an opensource product as the
CMS for my website. I like the product so much that I would like to run
multiple installs on the same server. However, with the mail settings being
defined in php.ini I can only have one smtp amd mailfrom defined.
This is fine if I only want one of the domains to send mail, however each
domain will need to send mail.
Is there a way to set up the php.ini file so that each site can have it's
own smtp?
No, you can't. You may want to try this class that comes with a
sub-class for sending e-mail messages with SMTP. It also comes with a
wrapper function named smtp_mail() that emulates the mail() function but
sends the message via the class so you do not have to change much your
code and still have configuration flexibility:
http://www.phpclasses.org/mimemessage
You also need this:
http://www.phpclasses.org/smtpclass
The code from the product that grabs all the variables is below. Maybe I
could modify this to get the results I'm looking for?
Global variables have nothing to do with php.ini settings.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---