php-general Digest 18 Nov 2009 08:33:11 -0000 Issue 6448
Topics (messages 299896 through 299900):
Re: Pear include path problem
299896 by: Jim Lucas
299897 by: Al
How to call a vc++ dll from a HTML form
299898 by: Peter
299899 by: James McLean
tracking forwarded emails using PHP
299900 by: Angelo Zanetti
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Al wrote:
> I've got script that uses the pear Mail class and have had problems on
> some shared hosts with the include path to Mail. E.g., Blue Host insists
> the site owner must change the php.ini file. I'd rather not expect them
> to do that.
>
> Can you folks critique this approach for me.
>
> if(EMAIL_MODE=='smtp'){
> $basePath = str_ireplace('public_html', '', $_SERVER['DOCUMENT_ROOT']);
> set_include_path(get_include_path() . PATH_SEPARATOR . basePath);
> require_once "$basePath/php" . '/Mail.php';
> $smtpStatus=(class_exists('Mail'))?true:false;
> }
>
> Thanks....
>
How about this
# Check to see if the constant is defined BEFORE you try to use it.
if ( defined('EMAIL_MODE') && EMAIL_MODE == 'smtp' ) {
# You might want to do more checking on the path. Checking to see if it
# has double forward slashes at the end would be the first place to start
$basePath = str_ireplace('public_html', '', $_SERVER['DOCUMENT_ROOT']);
# IMO, no improvement needed here
set_include_path(get_include_path() . PATH_SEPARATOR . $basePath);
# Well, it is what it is
$filename = "{$basePath}/php/Mail.php";
# Check to see if file exists and is readable BEFORE you try including it
if ( is_file($filename) && is_readable($filename) ) {
require_once $filename;
$smtpStatus=(class_exists('Mail'))?true:false;
} else {
$smtpStatus = false;
}
}
Jim Lucas
--- End Message ---
--- Begin Message ---
Jim Lucas wrote:
Al wrote:
I've got script that uses the pear Mail class and have had problems on
some shared hosts with the include path to Mail. E.g., Blue Host insists
the site owner must change the php.ini file. I'd rather not expect them
to do that.
Can you folks critique this approach for me.
if(EMAIL_MODE=='smtp'){
$basePath = str_ireplace('public_html', '', $_SERVER['DOCUMENT_ROOT']);
set_include_path(get_include_path() . PATH_SEPARATOR . basePath);
require_once "$basePath/php" . '/Mail.php';
$smtpStatus=(class_exists('Mail'))?true:false;
}
Thanks....
How about this
# Check to see if the constant is defined BEFORE you try to use it.
if ( defined('EMAIL_MODE') && EMAIL_MODE == 'smtp' ) {
# You might want to do more checking on the path. Checking to see if it
# has double forward slashes at the end would be the first place to start
$basePath = str_ireplace('public_html', '', $_SERVER['DOCUMENT_ROOT']);
# IMO, no improvement needed here
set_include_path(get_include_path() . PATH_SEPARATOR . $basePath);
# Well, it is what it is
$filename = "{$basePath}/php/Mail.php";
# Check to see if file exists and is readable BEFORE you try including it
if ( is_file($filename) && is_readable($filename) ) {
require_once $filename;
$smtpStatus=(class_exists('Mail'))?true:false;
} else {
$smtpStatus = false;
}
}
Jim Lucas
Thanks for the feedback. That's big help. I'm sending this revised code to my
client to install on his Bluehost server.
Actually, I do check if EMAIL_MODE is defined; just didn't show it here.
And, I have debug mode that provides a more detailed error report. But, it
doesn't help if it can't even find Mail
if (PEAR::isError($result))
{
$mode = EMAIL_MODE;
throw new Exception("The email mode \"$mode\" does not work. Check the
Applic email address and password in config file. <br />
Tech support required, use DISABLE_MAIL_SEND to debug. Error found in
pearEmailSend().<br />" .
$result->getMessage());
}
--- End Message ---
--- Begin Message ---
Thanks to All.
I want to call a vc++ dll from a HTML form. The dll need to be triggered
on a button click in the HTML form.
I want to access the dll from the client end(javascrript) without using
the server.
Tell me whether its possible to call dll directly or through any interface ?
Please provide me your valuable inputs to solve this issue.
Regards
Peter
Nathan Rixham wrote:
Peter wrote:
Hi All,
I want to call dll in javascript
I tried the following script, but i got the error message 'ActiveXObject
is undefined'
(Note : i have the feedback.dll in the same path only)
<HTML>
<HEAD>
<script type='text/javascript' language='javascript'>
function comEventOccured()
{
try{
var myobject;
myobject = new ActiveXObject("feedback.dll");
}catch(e){
alert(e.description);
return false;
}
}
</script></head>
<body>
<input type=button value="Call the DLL" onClick="comEventOccured()">
</body>
</html>
Regards
Peter.
usually .dll should be running client side not server side
jscript and javascript are two different beasts based on ecmascript;
you'll be wanting to get some JScript (microsofts own version) help for
this.. http://msdn.microsoft.com/en-us/library/7sw4ddf8%28VS.85%29.aspx
but as somebody else mentioned, you won't get it working on all browsers
AFAIK.. so running DLL on server side and calling wrapper functions via
ajax is more appropriate.
an asp.net forum or suchlike will probably yield a more useful response
regards
--- End Message ---
--- Begin Message ---
On Wed, Nov 18, 2009 at 3:21 PM, Peter <pet...@egrabber.com> wrote:
> Thanks to All.
>
> I want to call a vc++ dll from a HTML form. The dll need to be triggered on
> a button click in the HTML form.
>
> I want to access the dll from the client end(javascrript) without using the
> server.
>
> Tell me whether its possible to call dll directly or through any interface ?
>
> Please provide me your valuable inputs to solve this issue.
What does this have to do with PHP?
Oh, and it's a bad idea. Don't do it...
--- End Message ---
--- Begin Message ---
Hi all,
I want to develop a newsletter system, where by users can create newsletters
and send them to recipients, that's not a problem.
I want to be able to track certain things:
1. When an email is opened. I think this can be done with an img tag where
the src is a php script. We can then track when that script is called and
from whom.
2. Track if the email was forwarded, not sure how this is done but it should
be possible any ideas?
I basically need advice on the second point and to know that the first point
I am heading in the correct direction.
Please send any links if you wish, that will help.
Thanks in advance.
http://www.elemental.co.za
http://www.wapit.co.za
http://www.chaperonsa.co.za
http://www.tour2africa.com
--- End Message ---