php-general Digest 28 Jun 2010 12:44:14 -0000 Issue 6820
Topics (messages 306470 through 306474):
Re: mysql case statement
306470 by: Brandon Rampersad
Re: Attachment to email from form.
306471 by: Richard Quadling
306473 by: Gary
306474 by: Brandon Rampersad
Re: Problem with SOAP and authentication? SoapFault exception: [HTTP]
Unauthorized
306472 by: Richard Quadling
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 ---
no
On Sun, Jun 27, 2010 at 8:29 PM, David McGlone <da...@dmcentral.net> wrote:
> On Sunday 27 June 2010 04:08:24 Tanel Tammik wrote:
> > Hello,
> >
> > how to select only if value is present?
> >
> > $query = $db->query("select menus.id, menus.name,
> > case
> > when panels.id is not null then '1'
> > end as hiddenpanel
> >
> > from " . \DB_MENUS . " as menus
> > left join " . \DB_HIDDENPANELS . " as panels on (menus.id =
> > panels.menu_id)
> > where menus.id='" . (int)$id . "'
> > ");
> >
> > i would like to select hiddenpanel only if there is a corresponding value
> > in DB_HIDDENPANELS. At the moment i get NULL if there is no
> corresponding
> > value in HIDDENPANELS table!
>
> I would use an if statement since you only need to determine true or false.
> Something like:
>
> $query = $db->query("select menus.id, menus.name,
> from " . \DB_MENUS . " as menus
> left join " . \DB_HIDDENPANELS . " as panels on (menus.id =
> panels.menu_id)
> where menus.id='" . (int)$id . "'
> ");
>
> if (empty(DB_HIDDENPANELS)) {
> echo "";
>
> }
>
> else {
> echo "hiddenpanel";
>
> }
>
> But I would wait for others to chime in on this one, because I'm very far
> from
> an expert, there's also got to be a much better efficient way to write the
> if
> statement above, but it's what I would do in a case like this until I found
> a
> better way.
>
> --
> Blessings,
> David M.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
A Brandon_R Production
--- End Message ---
--- Begin Message ---
On 26 June 2010 13:14, Gary <gp...@paulgdesigns.com> wrote:
> Richard
>
> Please accept my apology in that my response was sent directly to you and
> not the group, I hit 'Reply" instead of 'Reply to Group'.
>
> Gary
No problem.
Here is an example of my code using the RMail script from phpguru.org.
It was previously known as html_mime_mail5.
<?php
// Create a new message.
$o_Mail = new RMail();
// As we are going to use SMTP to send the email, we need to know
where to send it.
// On my setup, the SMTP ini setting is what I'll be using.
// You can also supply any SMTP AUTH settings needed here.
$o_Mail->setSMTPParams
(
ini_get('SMTP'),
25,
Null,
registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_LOGIN_REQUIRED),
registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_LOGIN),
registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_PASSWORD)
);
// Set the From header
$o_Mail->setHeader('From', '"Richard Quadling" <r...@nowhere.co.uk>');
// Some other useful headers.
// $o_Mail->setHeader('Return-Path', '"Return to me"
<returnt...@nowhere.co.uk>');
// $o_Mail->setHeader('Return-Receipt-To', '"Delivery Receipt"
<deliveryconfirmati...@nowhere.co.uk>');
// $o_Mail->setHeader('Disposition-Notification-To', '"Read or Delete
Notification" <disposit...@nowhere.co.uk>');
// Add the subject.
$o_Mail->setSubject($s_Subject);
// Add the HTML with a location of the images to be added to the email
automatically, rather than relying on internet to provide images
// which is blocked by various security levels of Outlook.
$o_Mail->setHTML($s_HTMLMessage, 'D:/Global Web Documents/images/');
// Let's add an attachment.
// The filename, the mime type, the encoding and the file name to show
the attachment as.
$o_Mail->addAttachment(new fileAttachment('D:/Uploaded/content.zip',
'application/zip', new Base64Encoding(), 'YourContent.zip'));
// If you want to keep copies of your emails, then setCc is the method to use.
$o_Mail->setCc('r...@nowhere.co.uk');
// Finally, send the email to the recipients (held in an array to
allow for multiple addresses) using SMTP.
$o_Mail->send(array('"Your recipient\'s name"
<your_recipient_em...@domain.com>'), 'smtp');
?>
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---
--- Begin Message ---
Richard
Thank you again for your kind help.
Gary
"Richard Quadling" <rquadl...@gmail.com> wrote in message
news:aanlktikwujmpbqijd_ee9mbfpxa92ssexjddng2fg...@mail.gmail.com...
> On 26 June 2010 13:14, Gary <gp...@paulgdesigns.com> wrote:
>> Richard
>>
>> Please accept my apology in that my response was sent directly to you and
>> not the group, I hit 'Reply" instead of 'Reply to Group'.
>>
>> Gary
>
> No problem.
>
> Here is an example of my code using the RMail script from phpguru.org.
> It was previously known as html_mime_mail5.
>
> <?php
> // Create a new message.
> $o_Mail = new RMail();
>
> // As we are going to use SMTP to send the email, we need to know
> where to send it.
> // On my setup, the SMTP ini setting is what I'll be using.
> // You can also supply any SMTP AUTH settings needed here.
> $o_Mail->setSMTPParams
> (
> ini_get('SMTP'),
> 25,
> Null,
> registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_LOGIN_REQUIRED),
> registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_LOGIN),
> registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_PASSWORD)
> );
>
>
> // Set the From header
> $o_Mail->setHeader('From', '"Richard Quadling" <r...@nowhere.co.uk>');
>
> // Some other useful headers.
> // $o_Mail->setHeader('Return-Path', '"Return to me"
> <returnt...@nowhere.co.uk>');
> // $o_Mail->setHeader('Return-Receipt-To', '"Delivery Receipt"
> <deliveryconfirmati...@nowhere.co.uk>');
> // $o_Mail->setHeader('Disposition-Notification-To', '"Read or Delete
> Notification" <disposit...@nowhere.co.uk>');
>
> // Add the subject.
> $o_Mail->setSubject($s_Subject);
>
> // Add the HTML with a location of the images to be added to the email
> automatically, rather than relying on internet to provide images
> // which is blocked by various security levels of Outlook.
> $o_Mail->setHTML($s_HTMLMessage, 'D:/Global Web Documents/images/');
>
> // Let's add an attachment.
> // The filename, the mime type, the encoding and the file name to show
> the attachment as.
> $o_Mail->addAttachment(new fileAttachment('D:/Uploaded/content.zip',
> 'application/zip', new Base64Encoding(), 'YourContent.zip'));
>
> // If you want to keep copies of your emails, then setCc is the method to
> use.
> $o_Mail->setCc('r...@nowhere.co.uk');
>
> // Finally, send the email to the recipients (held in an array to
> allow for multiple addresses) using SMTP.
> $o_Mail->send(array('"Your recipient\'s name"
> <your_recipient_em...@domain.com>'), 'smtp');
> ?>
>
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
> __________ Information from ESET Smart Security, version of virus
> signature database 5233 (20100628) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
__________ Information from ESET Smart Security, version of virus signature
database 5233 (20100628) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
fuck no
On Mon, Jun 28, 2010 at 8:23 AM, Gary <gp...@paulgdesigns.com> wrote:
> Richard
>
> Thank you again for your kind help.
>
> Gary
>
>
> "Richard Quadling" <rquadl...@gmail.com> wrote in message
> news:aanlktikwujmpbqijd_ee9mbfpxa92ssexjddng2fg...@mail.gmail.com...
> > On 26 June 2010 13:14, Gary <gp...@paulgdesigns.com> wrote:
> >> Richard
> >>
> >> Please accept my apology in that my response was sent directly to you
> and
> >> not the group, I hit 'Reply" instead of 'Reply to Group'.
> >>
> >> Gary
> >
> > No problem.
> >
> > Here is an example of my code using the RMail script from phpguru.org.
> > It was previously known as html_mime_mail5.
> >
> > <?php
> > // Create a new message.
> > $o_Mail = new RMail();
> >
> > // As we are going to use SMTP to send the email, we need to know
> > where to send it.
> > // On my setup, the SMTP ini setting is what I'll be using.
> > // You can also supply any SMTP AUTH settings needed here.
> > $o_Mail->setSMTPParams
> > (
> > ini_get('SMTP'),
> > 25,
> > Null,
> >
> registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_LOGIN_REQUIRED),
> > registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_LOGIN),
> > registrySettings_V2::read(registrySettings_V2::REG_SMTP_AUTH_PASSWORD)
> > );
> >
> >
> > // Set the From header
> > $o_Mail->setHeader('From', '"Richard Quadling" <r...@nowhere.co.uk>');
> >
> > // Some other useful headers.
> > // $o_Mail->setHeader('Return-Path', '"Return to me"
> > <returnt...@nowhere.co.uk>');
> > // $o_Mail->setHeader('Return-Receipt-To', '"Delivery Receipt"
> > <deliveryconfirmati...@nowhere.co.uk>');
> > // $o_Mail->setHeader('Disposition-Notification-To', '"Read or Delete
> > Notification" <disposit...@nowhere.co.uk>');
> >
> > // Add the subject.
> > $o_Mail->setSubject($s_Subject);
> >
> > // Add the HTML with a location of the images to be added to the email
> > automatically, rather than relying on internet to provide images
> > // which is blocked by various security levels of Outlook.
> > $o_Mail->setHTML($s_HTMLMessage, 'D:/Global Web Documents/images/');
> >
> > // Let's add an attachment.
> > // The filename, the mime type, the encoding and the file name to show
> > the attachment as.
> > $o_Mail->addAttachment(new fileAttachment('D:/Uploaded/content.zip',
> > 'application/zip', new Base64Encoding(), 'YourContent.zip'));
> >
> > // If you want to keep copies of your emails, then setCc is the method to
> > use.
> > $o_Mail->setCc('r...@nowhere.co.uk');
> >
> > // Finally, send the email to the recipients (held in an array to
> > allow for multiple addresses) using SMTP.
> > $o_Mail->send(array('"Your recipient\'s name"
> > <your_recipient_em...@domain.com>'), 'smtp');
> > ?>
> >
> >
> > --
> > -----
> > Richard Quadling
> > "Standing on the shoulders of some very clever giants!"
> > EE : http://www.experts-exchange.com/M_248814.html
> > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> > Zend Certified Engineer :
> http://zend.com/zce.php?c=ZEND002498&r=213474731
> > ZOPA : http://uk.zopa.com/member/RQuadling
> >
> > __________ Information from ESET Smart Security, version of virus
> > signature database 5233 (20100628) __________
> >
> > The message was checked by ESET Smart Security.
> >
> > http://www.eset.com
> >
> >
> >
>
>
>
> __________ Information from ESET Smart Security, version of virus signature
> database 5233 (20100628) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
A Brandon_R Production
--- End Message ---
--- Begin Message ---
On 26 June 2010 23:46, robert mena <robert.m...@gmail.com> wrote:
> Hi,
>
> I am trying to access a webservice using php's soapclient but I keep getting
> the error SoapFault exception: [HTTP] Unauthorized
>
> If I try using a web browser I can authenticate using the same credentials
> used by the php code.
>
> I've searched but the only mention that I found led to a 'won't fix' bug
> registered to php 5.1.6. I am using 5.2.10.
>
> Any ideas of what may be causing this? Is there a workaround?
>
> Regards.
>
Can you show the SoapClient construction you are using?
The documentation says that you can supply HTTP authentication [1] ...
"For HTTP authentication, the login and password options can be used
to supply credentials. For making an HTTP connection through a proxy
server, the options proxy_host, proxy_port, proxy_login and
proxy_password are also available. For HTTPS client certificate
authentication use local_cert and passphrase options. An
authentication may be supplied in the authentication option. The
authentication method may be either SOAP_AUTHENTICATION_BASIC
(default) or SOAP_AUTHENTICATION_DIGEST."
There was recent activity on a Soap Authorisation Header bug [2].
If this issue is appropriate, you can try a building your code code
from SVN (no win32 snapshots for a LONG time now).
Regards,
Richard.
[1] http://docs.php.net/manual/en/soapclient.soapclient.php
[2] http://bugs.php.net/bug.php?id=50976
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---