php-general Digest 18 Jun 2012 13:41:13 -0000 Issue 7860
Topics (messages 318271 through 318275):
Re: else if vs switch
318271 by: James
318275 by: April Mains
IE9 Large Post Hangs for 5 Minutes Plus
318272 by: Christopher Cowan
318274 by: Mihamina Rakotomandimby
Re: Missing something simple
318273 by: Lester Caine
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 ---
Same logical check with my personal preference ;)
$toaddress = $mapping['default'];
if ( isset($city) && isset($mapping[$city]) ) { ... }
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Jim Lucas <li...@cmsws.com> wrote:
On 6/15/2012 3:29 PM, Joshua Kehn wrote:
> Way easier to just use a map.
>
> $mapping = array(
> 'Calgary' => "abc@emailaddress",
> 'Brooks' => "def@emailaddress",
> // etc
> );
> $toaddress = $mapping[$city];
I would use this, but add a check to it.
$mapping = array(
'default' => 'defa...@domain.tld',
...
);
...
if ( isset($mapping[$city]) ) {
$toaddress = $mapping[$city];
} else {
$toaddress = $mapping['default'];
}
Jim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
This is what I had been using as the check based on the code that had been
there previously and along with an email validator that sets $email to ""
if the address isn't valid. The purpose of the form is lead generation. The
last bit is to prevent spammers from entering urls in the class text box.
iif (($name == "") || ($email == "") || ($phone =="") || ($city=="Select
your city") || ($class=="") ||
preg_match("/[^A-Za-z0-9-\\s\\(\\)\\?\\:\\;@\\.™\\,\\–\\&'\\t]/uis",
$class))
{...}
Does this do the same thing as isset? Would isset be better?
April
On Sun, Jun 17, 2012 at 7:41 PM, James <ja...@nixsecurity.org> wrote:
> Same logical check with my personal preference ;)
>
> $toaddress = $mapping['default'];
>
> if ( isset($city) && isset($mapping[$city]) ) { ... }
>
> --
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> Jim Lucas <li...@cmsws.com> wrote:
>>
>> On 6/15/2012 3:29 PM, Joshua Kehn wrote:
>> > Way easier to just use a map.
>> >
>> > $mapping = array(
>>
>> > 'Calgary' => "abc@emailaddress",
>> > 'Brooks' => "def@emailaddress",
>> > // etc
>> > );
>> > $toaddress = $mapping[$city];
>>
>> I would use this, but add a check to it.
>>
>> $mapping = array(
>> 'default' => 'defa...@domain.tld',
>> ...
>> );
>>
>> ...
>>
>> if ( isset($mapping[$city]) ) {
>> $toaddress = $mapping[$city];
>>
>> } else {
>> $toaddress = $mapping['default'];
>>
>> }
>>
>> Jim
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
--- End Message ---
--- Begin Message ---
I'm working on an issue with IE9. I have a web app that posts a multipart form
via Ajax. The content-length is about 1MB often larger (uploading GPS tracks).
Chrome, Safari and Firefox all make the POST request then immediately (after
the POST completes receives the response). IE on the other hand seems to hold
on to the connection for up to five minutes (sometimes more). On Apache, the
request eventually completes; on Nginx, the request never makes it to the
php-fpm process.
ON Nginx I have the keep alives set to 65 seconds. Apache the keep alives are
turned off (since I'm running mod_php under mpm-prefork).
Any suggestions on how to fix this issue?
Chris Cowan
--- End Message ---
--- Begin Message ---
On 06/18/2012 08:21 AM, Christopher Cowan wrote:
Any suggestions on how to fix this issue?
If IE9 has a specific problem, I think one very good place is
http://goo.gl/Eug3a
--
RMA.
--- End Message ---
--- Begin Message ---
Lester Caine wrote:
Normally I'd just assume that PHP was not starting up, but since PHP is running
from command line and the .dll is in the right place I'm now a little confused
as to what I'm missing ...
OK switched to FastCGI, but that is complaining about 'can't load windows
library' which I suspect is the same problem as the Apache Module has.
I suspect this has something to do with VC10 since the runtime library has to be
updated to that to get FastCGI to load.
I do have a working setup using PHP5.4.0 with Apache 2.4.0, which seems to be
the last version that installs out of the box on Xp32bit ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---