php-general Digest 26 Mar 2011 10:20:27 -0000 Issue 7244

2011-03-26 Thread php-general-digest-help

php-general Digest 26 Mar 2011 10:20:27 - Issue 7244

Topics (messages 312063 through 312068):

Re: [PHP-WIN] Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??
312063 by: Tommy Pham
312066 by: Sharl.Jimh.Tsin
312068 by: Pierre Joye

Re: opening a new window from php script
312064 by: Tommy Pham
312067 by: Geoff Lane

Re: putting variables in a variable
312065 by: David Robley

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


--
---BeginMessage---
On Fri, Mar 25, 2011 at 1:44 PM, Pierre Joye pierre@gmail.com wrote:
 On Fri, Mar 25, 2011 at 8:12 PM, Tommy Pham tommy...@gmail.com wrote:

 There used to be a VC6 binary release for PHP v5.3.3 at
 windows.php.net but I don't see a VC6 build for v5.3 now.  Any way,
 since you're using using Windows, why not just run it as FastCGI?  It
 runs fine on Win2003 (x86), Win7 x64, Win08 (x86  x64), and Win08r2.

 Apache module works just fine and is in many situations much faster than fcgi.

I've never tested the difference for performance.  If that's the case,
any particular reason to stop support ISAPI for IIS then? or is
FastCGI faster than ISAPI for IIS?  Prior to upgrading to PHP v5.3 and
Windows 64bit, I had faster initial response time from ISAPI.  Now
with FastCGI, the initial response takes longer.  As for performance
difference through repeated requests, I don't notice the difference
between ISAPI v5.2 and FastCGI v5.3.


 Are using a specific Apache module that's why you need to use httpd?
 If so, you could use the (non official) Apache Lounge's binary.

 There are no official builds of Apache, but convenience builds.

 Cheers,
 --
 Pierre

 @pierrejoye | http://blog.thepimp.net | http://www.libgd.org


I've meant official in the sense that one could download from the
official/mirror site.  Thus it's more trust worthy, in terms of non
malicious code.
---End Message---
---BeginMessage---
Try third binary instead of official one.

Best regards,
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)



2011/3/26 Tommy Pham tommy...@gmail.com:
 On Fri, Mar 25, 2011 at 1:44 PM, Pierre Joye pierre@gmail.com wrote:
 On Fri, Mar 25, 2011 at 8:12 PM, Tommy Pham tommy...@gmail.com wrote:

 There used to be a VC6 binary release for PHP v5.3.3 at
 windows.php.net but I don't see a VC6 build for v5.3 now.  Any way,
 since you're using using Windows, why not just run it as FastCGI?  It
 runs fine on Win2003 (x86), Win7 x64, Win08 (x86  x64), and Win08r2.

 Apache module works just fine and is in many situations much faster than 
 fcgi.

 I've never tested the difference for performance.  If that's the case,
 any particular reason to stop support ISAPI for IIS then? or is
 FastCGI faster than ISAPI for IIS?  Prior to upgrading to PHP v5.3 and
 Windows 64bit, I had faster initial response time from ISAPI.  Now
 with FastCGI, the initial response takes longer.  As for performance
 difference through repeated requests, I don't notice the difference
 between ISAPI v5.2 and FastCGI v5.3.


 Are using a specific Apache module that's why you need to use httpd?
 If so, you could use the (non official) Apache Lounge's binary.

 There are no official builds of Apache, but convenience builds.

 Cheers,
 --
 Pierre

 @pierrejoye | http://blog.thepimp.net | http://www.libgd.org


 I've meant official in the sense that one could download from the
 official/mirror site.  Thus it's more trust worthy, in terms of non
 malicious code.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


---End Message---
---BeginMessage---
On Sat, Mar 26, 2011 at 1:47 AM, Tommy Pham tommy...@gmail.com wrote:

 I've never tested the difference for performance.  If that's the case,
 any particular reason to stop support ISAPI for IIS then? or is
 FastCGI faster than ISAPI for IIS?

It is faster, however the ISAPI was not maintained and has issues. But
what is the relation with Apache?


 I've meant official in the sense that one could download from the
 official/mirror site.  Thus it's more trust worthy, in terms of non
 malicious code.

The developers at apachelounge.com work with th Apache project. We
would not recommend to use it if we do not trust this project.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
---End Message---
---BeginMessage---
On Fri, Mar 25, 2011 at 2:59 PM, Grega Leskovšek legr...@gmail.com wrote:
 I am working on CMS designed to those who are unfamiliar  with a
 computer world and I want to offer a task where on a push of a button
 it will save current working page in textarea/s and open this page in
 a new tab or in a new window.

PHP is server 

php-general Digest 27 Mar 2011 01:51:04 -0000 Issue 7245

2011-03-26 Thread php-general-digest-help

php-general Digest 27 Mar 2011 01:51:04 - Issue 7245

Topics (messages 312069 through 312074):

Re: opening a new window from php script
312069 by: Ashley Sheridan

Re: putting variables in a variable
312070 by: Al
312071 by: Daniel Brown
312072 by: Al

Re: Slow sessions.
312073 by: Bostjan Skufca

Re: Array Search - Solved
312074 by: Ethan Rosenberg

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


--
---BeginMessage---
On Fri, 2011-03-25 at 18:05 -0700, Tommy Pham wrote:

 On Fri, Mar 25, 2011 at 2:59 PM, Grega Leskovšek legr...@gmail.com wrote:
  I am working on CMS designed to those who are unfamiliar  with a
  computer world and I want to offer a task where on a push of a button
  it will save current working page in textarea/s and open this page in
  a new tab or in a new window.
 
 PHP is server side.  push of a button is client side.  Google
 javascript+onClick.
 
  I googled some, but am still not sure how can I do it.
 
  Do I have to use target=_new - I can not do this - I am working this
  for my University seminar and it has to be valid HTML5.
 
  Please help me improve my plan
  1. I check wheter the user is using windows, linux, mac and then show
  appropriate possibility of all browsers for the targeted platform
  (WIN:IE,SA,FF,CH,OP, LINUX:FF.CHROMIUM and I need help for the mac
  also besides SA and FF what does it have among browsers?)
 
 Have you tried to google for browser versions and platform?  While
 searching for the same thing long time ago, I found a site that lists
 them.  Also, note that since you'll be using onClick for push of a
 button, beware of Javascript version difference among the browsers.
 IIRC, IE is supports 1.3 and FF supports 1.9.  Haven't tested the
 others so couldn't tell you.
 
  2. When the browser clicks button with the image of browsers inside
  anchor I target _new and location of the current file
 
  ?1 How can I offer option to open a new window not a new tab?
  ?2 How can I avoid the target attribute?
  ?3 How can I make a click on an image to produce action - or what do
  You suggest me to use - I would prefer img element not  button with an
  image - how can I do this?
 
  Once I will finish it I will offer here software to everybody so I
  will be able to get some response and improve it and this is one of
  the major problems otherwise it is already functional.
 
  Please help me, thanks in advance - or ? You think I could do this better 
  in JS?
  -- When the sun rises I receive and when it sets I forgive -
  http://moj.skavt.net/gleskovs/
  Always in Heart, Grega Leskovšek
 
 
 I don't know if you have Flash in your tool belt but have you
 considering using it?  It may simply your life with various browsers
 and their versions across different platforms.  Note: Flash does tend
 to be sluggish in terms of loading time and how much of what you need
 the Flash to do.
 
 Regards,
 Tommy
 


I'd avoid trying to guess the browser entirely. There are always loads
of fringe browsers that are in use, and things like Wine that allows
people to run IE on Linux, as well as other Windows-based browsers too.
As soon as you're trying to write a script that detects a specific
browser and does something then you're already doing it wrong. Don't
test for the browser, test for the feature that you're using. Javascript
has a useful function called hasFeature which may help here.

The main reason why it's bad to try and detect a browser and act on it
is because you can get many browsers that work across a wide variety of
operating systems such as Fx  Opera, which vary from version to version
and OS to OS.

Thanks,
Ash
http://www.ashleysheridan.co.uk


---End Message---
---BeginMessage---



On 3/25/2011 10:01 PM, David Robley wrote:

Hulf wrote:


Hi,

I am making and HTML email. I have 3 images to put in. Currently I have

$body .=
table
   tr
 tdimg src=\image1.jpg\/td
   /tr

   tr
 td/td
   /tr
/table
;


ideally I would like to have

$myimage1 = image1.jpg;
$myimage2 = image2.jpg;
$myimage3 = image3.jpg;


and put them into the HTML body variable. I have tried escaping them in
every way i can think of, dots and slashes and the rest. Any ideas?


Ross


Did you try

$body .=;
table
   tr
 tdimg src=\$myimage1\/td
   /tr

   tr
 td/td
   /tr
/table
;

It helps us help you if you can give examples of what you have tried and how
it didn't work as you expected.


Cheers


I'd use:

$imgArray= array(image1.jpg,image2.jpg,image3.jpg);

$body.= table\n;

foreach($imgArray as $image){
 $body .= trtdimg src=\$myimage1\ //td/tr\n;
}
$body .= /table\n\n;

Watch the img src=\$myimage1\ /. img is an open tag; so end it with  / 

[PHP] Re: [PHP-WIN] Re: [PHP] Which versions of Apache will PHP 5.3.6 work with??

2011-03-26 Thread Pierre Joye
On Sat, Mar 26, 2011 at 1:47 AM, Tommy Pham tommy...@gmail.com wrote:

 I've never tested the difference for performance.  If that's the case,
 any particular reason to stop support ISAPI for IIS then? or is
 FastCGI faster than ISAPI for IIS?

It is faster, however the ISAPI was not maintained and has issues. But
what is the relation with Apache?


 I've meant official in the sense that one could download from the
 official/mirror site.  Thus it's more trust worthy, in terms of non
 malicious code.

The developers at apachelounge.com work with th Apache project. We
would not recommend to use it if we do not trust this project.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] opening a new window from php script

2011-03-26 Thread Ashley Sheridan
On Fri, 2011-03-25 at 18:05 -0700, Tommy Pham wrote:

 On Fri, Mar 25, 2011 at 2:59 PM, Grega Leskovšek legr...@gmail.com wrote:
  I am working on CMS designed to those who are unfamiliar  with a
  computer world and I want to offer a task where on a push of a button
  it will save current working page in textarea/s and open this page in
  a new tab or in a new window.
 
 PHP is server side.  push of a button is client side.  Google
 javascript+onClick.
 
  I googled some, but am still not sure how can I do it.
 
  Do I have to use target=_new - I can not do this - I am working this
  for my University seminar and it has to be valid HTML5.
 
  Please help me improve my plan
  1. I check wheter the user is using windows, linux, mac and then show
  appropriate possibility of all browsers for the targeted platform
  (WIN:IE,SA,FF,CH,OP, LINUX:FF.CHROMIUM and I need help for the mac
  also besides SA and FF what does it have among browsers?)
 
 Have you tried to google for browser versions and platform?  While
 searching for the same thing long time ago, I found a site that lists
 them.  Also, note that since you'll be using onClick for push of a
 button, beware of Javascript version difference among the browsers.
 IIRC, IE is supports 1.3 and FF supports 1.9.  Haven't tested the
 others so couldn't tell you.
 
  2. When the browser clicks button with the image of browsers inside
  anchor I target _new and location of the current file
 
  ?1 How can I offer option to open a new window not a new tab?
  ?2 How can I avoid the target attribute?
  ?3 How can I make a click on an image to produce action - or what do
  You suggest me to use - I would prefer img element not  button with an
  image - how can I do this?
 
  Once I will finish it I will offer here software to everybody so I
  will be able to get some response and improve it and this is one of
  the major problems otherwise it is already functional.
 
  Please help me, thanks in advance - or ? You think I could do this better 
  in JS?
  -- When the sun rises I receive and when it sets I forgive -
  http://moj.skavt.net/gleskovs/
  Always in Heart, Grega Leskovšek
 
 
 I don't know if you have Flash in your tool belt but have you
 considering using it?  It may simply your life with various browsers
 and their versions across different platforms.  Note: Flash does tend
 to be sluggish in terms of loading time and how much of what you need
 the Flash to do.
 
 Regards,
 Tommy
 


I'd avoid trying to guess the browser entirely. There are always loads
of fringe browsers that are in use, and things like Wine that allows
people to run IE on Linux, as well as other Windows-based browsers too.
As soon as you're trying to write a script that detects a specific
browser and does something then you're already doing it wrong. Don't
test for the browser, test for the feature that you're using. Javascript
has a useful function called hasFeature which may help here.

The main reason why it's bad to try and detect a browser and act on it
is because you can get many browsers that work across a wide variety of
operating systems such as Fx  Opera, which vary from version to version
and OS to OS.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] Re: putting variables in a variable

2011-03-26 Thread Al



On 3/25/2011 10:01 PM, David Robley wrote:

Hulf wrote:


Hi,

I am making and HTML email. I have 3 images to put in. Currently I have

$body .=
table
   tr
 tdimg src=\image1.jpg\/td
   /tr

   tr
 td/td
   /tr
/table
;


ideally I would like to have

$myimage1 = image1.jpg;
$myimage2 = image2.jpg;
$myimage3 = image3.jpg;


and put them into the HTML body variable. I have tried escaping them in
every way i can think of, dots and slashes and the rest. Any ideas?


Ross


Did you try

$body .=;
table
   tr
 tdimg src=\$myimage1\/td
   /tr

   tr
 td/td
   /tr
/table
;

It helps us help you if you can give examples of what you have tried and how
it didn't work as you expected.


Cheers


I'd use:

$imgArray= array(image1.jpg,image2.jpg,image3.jpg);

$body.= table\n;

foreach($imgArray as $image){
 $body .= trtdimg src=\$myimage1\ //td/tr\n;
}
$body .= /table\n\n;

Watch the img src=\$myimage1\ /. img is an open tag; so end it with  / 
and it'll be XHTML ready.






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: putting variables in a variable

2011-03-26 Thread Daniel Brown
On Sat, Mar 26, 2011 at 11:46, Al n...@ridersite.org wrote:

You guys know this thread will be three years old on Monday,
right?  Interestingly enough, it looks like Ross ('Hulf') had his
client, OS, or mailserver improperly configured, because it shows that
the message to which we've all replied won't even exist until Monday
evening.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: putting variables in a variable

2011-03-26 Thread Al



On 3/26/2011 11:57 AM, Daniel Brown wrote:

On Sat, Mar 26, 2011 at 11:46, Aln...@ridersite.org  wrote:

 You guys know this thread will be three years old on Monday,
right?  Interestingly enough, it looks like Ross ('Hulf') had his
client, OS, or mailserver improperly configured, because it shows that
the message to which we've all replied won't even exist until Monday
evening.



Hey, Daniel...

You know the old saying: Better late than never.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Slow sessions.

2011-03-26 Thread Bostjan Skufca
Can you strace it's execution and see where your delay is comming from? If
you are using apache, make it create just one child and strace that one when
you generate a request.

b.


On 25 March 2011 19:01, Rob Adams rad...@circlepix.com wrote:

 I decided to try changing the session.save_path, and I've had some
 interesting results.

 First I changed it to a local directory.  Originally it was on a mounted
 directory on our main file server.  When I switched to a local directory,
 everything started working fast again on the php 5.2.17 server.

 So then I tried switching it to a different server mount.  I set the
 session.save_path to a directory mounted on our backup file server. Once
 again, everything ran super fast.

 So then I tried switching it to a different mount on the main file server
 again.  And it was back to taking at least 30 seconds to load.

 So, here's where I'm at:

 4 other php 5.1.6 servers are using \\server1\mnt\phpsess as their
 session.save_path and are working just fine.

 My new installation of php 5.2.17 takes 30 seconds to start a session when
 mounting \\server1\mnt\phpsess.  It also takes 30 seconds to start a session
 when mounting \\server1\mnt\testSess (a newly created dir).

 The php 5.2.17 server loads a session instantly when mounting
 \\server2\mnt\phpsess.

 I suppose I could just change the other four servers to use server2, and I
 might end up doing that, but it'd be like claiming defeat.  I'd really like
 to figure out why this is happening.  Any suggestions?

 Thanks.

  -- Rob


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Array Search - Solved

2011-03-26 Thread Ethan Rosenberg

At 01:31 PM 3/25/2011, João Cândido de Souza Neto wrote:

It´s a job to array_key_exists  function.

--
João Cândido de Souza Neto

Ethan Rosenberg eth...@earthlink.net escreveu na mensagem
news:0lim00hi3ihny...@mta4.srv.hcvlny.cv.net...
 Dear List -

 Here is a code snippet:

 $bla = array(g1 = $results[7][6],
h1  = $results[7][7]);
 print_r($bla);
 $value = h1;
$locate1 = array_search($value, $bla);
echo This is locate ; print_r($locate1);
if(in_array($value, $bla)) print_r($bla);

 Neither the array_search or the in_array functions give any results. I
 have tried it with both h1 and h1;

 $results[7][6]  = Wn;
 $results[7][7]  =  Wr;

 This is a chess board  where g1 and h1 are the coordinates and the results
 array contains the pieces at that coordinate.

 What am I doing wrong?

 Advice and comments please.

 Thanks.

 Ethan Rosenberg




Thank you.  It works!!

Ethan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php