php-general Digest 14 Dec 2013 13:03:52 -0000 Issue 8448

2013-12-14 Thread php-general-digest-help

php-general Digest 14 Dec 2013 13:03:52 - Issue 8448

Topics (messages 322570 through 322570):

Re: Array + php
322570 by: marco.behnke.biz

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---
Maybe ask in english? Bigger target audience

 El Ale... alexissauc...@gmail.com hat am 14. Dezember 2013 um 01:01
 geschrieben:


 Gente una consulta bastante off topic. Quiero meter un array en una clase y
 no se como hacerlo se me ocurrio algo asi:

  ?
         class Listado_Completo
         {
             protected $datosArray =array(0= array( juan, perez,
 2352562),
                 1=array(Marina, Zafon, 32568952),
                 2= array(fulano, de tal, 32149856);


            public function Get_Listado_Completo(){
                return $this-datosArray;
            }


             }
 ?

 Pero no puedo llamar a ninguno, alguien sabe como hacerlo?

--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz
---End Message---


php-general Digest 28 Nov 2013 19:11:08 -0000 Issue 8440

2013-11-29 Thread php-general-digest-help

php-general Digest 28 Nov 2013 19:11:08 - Issue 8440

Topics (messages 322515 through 322527):

Re: echo count(false); == 1 ?!
322515 by: Camilo Sperberg
322516 by: Tsvetan Nikolov
322517 by: Aziz Saleh
322518 by: Tim Behrendsen
322519 by: Daevid Vincent
322521 by: Daevid Vincent
322522 by: David OBrien
322523 by: Tsvetan Nikolov
322524 by: Jim Lucas
322525 by: Sebastian Krebs
322526 by: Tsvetan Nikolov

Binded params and MySQL functions
322520 by: Camilo Sperberg

Processing the file as its being uploaded
322527 by: Marcelo Taube

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 27 nov. 2013, at 19:04, Daevid Vincent dae...@daevid.com wrote:

 Really? 1?? I would have expected 0 or false or something other than
 positive. *sigh*
 
 $ php -a
 php  echo count(false);
 1
 
 
 :-\


Same as with sizeof() btw (which is alias). I've did run into this issue a few 
years ago and decided that you should check whether the argument you're passing 
to count() or sizeof() is an array: problem solved.

So:

$a = $count = false;
if (is_array($a)) {
$count = count($a);
}

The 1 result is due to type conversion, well known and discussed within this 
same mailing list.

unreal4u-MBP:~ unreal4u$ php -a
Interactive shell

php  $a = false;
php  print_r((array)$a);
Array
(
[0] = 
)

Greetings.



Met vriendelijke groet,
Camilo Sperberg


W: http://unreal4u.com
T: http://twitter.com/unreal4u

---End Message---
---BeginMessage---
Just think about it. When was the last time you counted something and the
result was false? It makes no sense. Logically counting should return
negative, 0 or positive value.


On Wed, Nov 27, 2013 at 7:04 PM, Daevid Vincent dae...@daevid.com wrote:

 Really? 1?? I would have expected 0 or false or something other than
 positive. *sigh*

 $ php -a
 php  echo count(false);
 1


 :-\

---End Message---
---BeginMessage---
On Wed, Nov 27, 2013 at 1:04 PM, Daevid Vincent dae...@daevid.com wrote:

 Really? 1?? I would have expected 0 or false or something other than
 positive. *sigh*

 $ php -a
 php  echo count(false);
 1


 :-\

http://us3.php.net/count

The manual is a great place to figure out why things happen a certain way.

Aziz
---End Message---
---BeginMessage---
Why? count() counts the number of objects in an array. Since we're 
giving it a scalar value, then it's one value. Would you expect 
count(array(false)) to give a zero or a false? How about count(0) versus 
count(1)?


You might be confusing false and null, which are not the same thing. 
False is a boolean number, null is an empty set. You'll note that 
count(null) gives a zero.


This is actually one of the cases where php is doing something logical. :)

Tim


On 11/27/2013 10:04 AM, php-general-digest-h...@lists.php.net wrote:

Really? 1?? I would have expected 0 or false or something other than
positive.*sigh*
  
$ php -a

php  echo count(false);
1



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


 -Original Message-
 From: Aziz Saleh [mailto:azizsa...@gmail.com]
 Sent: Wednesday, November 27, 2013 10:15 AM
 To: Daevid Vincent
 Cc: php-gene...@lists.php.net
 Subject: Re: [PHP] echo count(false); == 1 ?!
 
 On Wed, Nov 27, 2013 at 1:04 PM, Daevid Vincent dae...@daevid.com wrote:
 
  Really? 1?? I would have expected 0 or false or something other than
  positive. *sigh*
 
  $ php -a
  php  echo count(false);
  1
 
 
  :-\
 
 http://us3.php.net/count
 
 The manual is a great place to figure out why things happen a certain way.

The manual page does not explain WHY that logic is used and even inconsistent 
since null returns 0. It only says that it does return 1. 

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


 -Original Message-
 From: Tsvetan Nikolov [mailto:live.websc...@gmail.com]
 Sent: Wednesday, November 27, 2013 10:15 AM
 To: Daevid Vincent
 Cc: PHP-General
 Subject: Re: [PHP] echo count(false); == 1 ?!
 
 Just think about it. When was the last time you counted something and the
 result was false? It makes no sense. Logically counting should return
 negative, 0 or positive value.

Well in my case I have a method that populates a property. The property
starts out as null (since it was never loaded). If there is an error, the
method returns false, otherwise it fills the array.

We could argue about flow/logic/etc. and how to fix my code. 

But logically, given how null/false/0 are usually treated, almost
interchangeably, such as 

$foo = false;
$foo = 0;
$foo = null;

If (!foo) 
All do the same thing

It would stand to reason that count() would return 0 for anything that isn't
an array

php-general Digest 24 Nov 2013 20:39:26 -0000 Issue 8435

2013-11-24 Thread php-general-digest-help

php-general Digest 24 Nov 2013 20:39:26 - Issue 8435

Topics (messages 322493 through 322495):

Re: DSN for MS SQL Server Express 2005
322493 by: marco.behnke.biz
322494 by: Tomás Corrales Lemoine

PHP tutorial
322495 by: Martin Christian

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---
Have you tried this

http://php.net/manual/de/ref.pdo-dblib.php#66917

 Tomás Corrales Lemoine to...@hog.ecasa.avianet.cu hat am 23. November 2013
 um 21:21 geschrieben:


 Greetings all,

 Please, I'm trying to connect to a MS SQL Server Express 2005 using PDO for
 ODBC, but I need the DSN string. I tried with:

 $dsn = 'odbc:DRIVER={SQL
 Server};HOSTNAME=CCTPV608\SQLEXPRESS;DATABASE=db_ibripos';

 but it doesn't work.

 Thanks!!!

 Tomas




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


--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz
---End Message---
---BeginMessage---
Thanks, Marco. I found it:

$dsn = 'odbc:Driver=SQL Server;Server= CCTPV608\SQLEXPRESS;Database=db_ibripos';

Tomas


-Mensaje original-
De: ma...@behnke.biz [mailto:ma...@behnke.biz] 
Enviado el: Sábado, 23 de Noviembre de 2013 5:36 pm
Para: php-gene...@lists.php.net; Tomás Corrales Lemoine
Asunto: Re: [PHP] DSN for MS SQL Server Express 2005

Have you tried this

http://php.net/manual/de/ref.pdo-dblib.php#66917

 Tomás Corrales Lemoine to...@hog.ecasa.avianet.cu hat am 23. 
 November 2013 um 21:21 geschrieben:


 Greetings all,

 Please, I'm trying to connect to a MS SQL Server Express 2005 using 
 PDO for ODBC, but I need the DSN string. I tried with:

 $dsn = 'odbc:DRIVER={SQL
 Server};HOSTNAME=CCTPV608\SQLEXPRESS;DATABASE=db_ibripos';

 but it doesn't work.

 Thanks!!!

 Tomas




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


--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 
5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

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


---End Message---
---BeginMessage---
Hi,

I've written a PHP DB/Template tutorial at:

http://christianix.de/php-tutor/index.html

I hope it will be useful to someone.

Regards,

Martin
---End Message---


php-general Digest 21 Nov 2013 07:23:33 -0000 Issue 8431

2013-11-21 Thread php-general-digest-help

php-general Digest 21 Nov 2013 07:23:33 - Issue 8431

Topics (messages 322475 through 322478):

Re: form submit send SMS
322475 by: Camilo Sperberg
322476 by: Bálint Horváth
322477 by: Jonathan Sundquist

An upload that was, but now isn't...
322478 by: PHP List

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 19 Nov 2013, at 16:15, Gregor Leskovšek legr...@gmail.com wrote:

 Is it possible and how can I send an  SMS with data from a submitted web
 form?
 Using Linux, Kubuntu LTS.
 Thanks in advance, Gregor
 
 ♥♥♥ When the sun rises I receive and when it sets I forgive! ♥♥♥
 http://gleskove.userworld.com/ http://moj.skavt.net/gleskovs/♥
 Always, Gregor Leskovšek

Yes, it is possible. It has a certain degree of difficulty, but if you 
outsource the service, it is very cheap and easy.

If you google on php send sms you can learn a lot more than what I'm able to 
write about the subject.

Greetings.---End Message---
---BeginMessage---
For example using [GW]ammu is a simple way on Linux, see http://wammu.eu/.
It has a web interface too.
It's easy to call from PHP using exec().
Pre-written classes also available:
http://www.phpclasses.org/package/3865-PHP-Send-and-receive-SMS-messages-using-Gammu.html

Or it's possible to make a Perl script handles the GSM device. I really
love this solution.
http://search.cpan.org/dist/Device-Gsm/Gsm.pm

Good ways for own GSM modem.

...but there are lots of SMS gateway APIs. Some of them with free test
period and even could be cheap in case of bulk SMS sending.



*--Bálint Horváth*


On Tue, Nov 19, 2013 at 4:54 PM, Camilo Sperberg unrea...@gmail.com wrote:


 On 19 Nov 2013, at 16:15, Gregor Leskovšek legr...@gmail.com wrote:

  Is it possible and how can I send an  SMS with data from a submitted web
  form?
  Using Linux, Kubuntu LTS.
  Thanks in advance, Gregor
 
  ♥♥♥ When the sun rises I receive and when it sets I forgive! ♥♥♥
  http://gleskove.userworld.com/ http://moj.skavt.net/gleskovs/♥
  Always, Gregor Leskovšek

 Yes, it is possible. It has a certain degree of difficulty, but if you
 outsource the service, it is very cheap and easy.

 If you google on php send sms you can learn a lot more than what I'm
 able to write about the subject.

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


---End Message---
---BeginMessage---
If you have the budget use a professional service such as Twilio. Their api
is very easy to use and quick to set up. I would also avoid using any type
of exec() function unless you are doing a very good job of checking to see
what is being executed. You would be opening yourself up the a number of
security attacks.


On Tue, Nov 19, 2013 at 10:44 AM, Bálint Horváth hbal...@gmail.com wrote:

 For example using [GW]ammu is a simple way on Linux, see http://wammu.eu/.
 It has a web interface too.
 It's easy to call from PHP using exec().
 Pre-written classes also available:

 http://www.phpclasses.org/package/3865-PHP-Send-and-receive-SMS-messages-using-Gammu.html

 Or it's possible to make a Perl script handles the GSM device. I really
 love this solution.
 http://search.cpan.org/dist/Device-Gsm/Gsm.pm

 Good ways for own GSM modem.

 ...but there are lots of SMS gateway APIs. Some of them with free test
 period and even could be cheap in case of bulk SMS sending.



 *--Bálint Horváth*


 On Tue, Nov 19, 2013 at 4:54 PM, Camilo Sperberg unrea...@gmail.com
 wrote:

 
  On 19 Nov 2013, at 16:15, Gregor Leskovšek legr...@gmail.com wrote:
 
   Is it possible and how can I send an  SMS with data from a submitted
 web
   form?
   Using Linux, Kubuntu LTS.
   Thanks in advance, Gregor
  
   ♥♥♥ When the sun rises I receive and when it sets I forgive! ♥♥♥
   http://gleskove.userworld.com/ http://moj.skavt.net/gleskovs/♥
   Always, Gregor Leskovšek
 
  Yes, it is possible. It has a certain degree of difficulty, but if you
  outsource the service, it is very cheap and easy.
 
  If you google on php send sms you can learn a lot more than what I'm
  able to write about the subject.
 
  Greetings.
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

---End Message---
---BeginMessage---
Hi,

Fair warning - not 100% PHP based question coming, but since it's almost
Friday, I thought I'd risk it.

My wife posed a question to me today for which I didn't have a very good
answer and thought I'd check the hive mind here.  At work, she uses a
certain service to upload PDF files, until about 3 days ago this worked
well enough.  However, in the past three days when she tries to upload

php-general Digest 17 Nov 2013 22:02:38 -0000 Issue 8428

2013-11-18 Thread php-general-digest-help

php-general Digest 17 Nov 2013 22:02:38 - Issue 8428

Topics (messages 322467 through 322468):

Re: save $_GLOBALS to a database field
322467 by: Robert Cummings
322468 by: marco.behnke.biz

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---
You have other problems if you think base64_encode is the solution to 
the hassle of escaping your query properly.


Cheers,
Rob.


On 13-11-15 08:52 PM, Tamara Temple wrote:

Or run it through base64_encode after json_encode, never have to worry about 
quotes and things.

On Nov 14, 2013, at 4:38 PM, Shawn McKenzie sh...@mckenzies.net wrote:


If you are for example saving the entire $_POST array in a text field of
your DB, then just serailize() it or json_encode() it and run it through
the appropriate real_escape_string() function if you're not using prepared
statements or other custom escaping.


On Thu, Nov 14, 2013 at 3:40 PM, Ramiro Barrantes 
ram...@precisionbioassay.com wrote:


Hello,

I would like to record, on a database, the global variables $_POST and
$_SERVER for each action that the user does that involves a modification of
the database.   I am just saving, say $_POST or $_SERVER (and others), as a
string and putting it in a field on the database.

However, when I try to get the info out of the database and access it as
an XML (using the DOMDocument library) it becomes a pain to handle due to
all the special characters (I think, as I haven't been able to get it to
work), for example:

Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0

(I seem to need to replace all the /s)

It's a pain, and I would like not to have to replace special characters
with preg_replace if possible.

Any suggestions?  I have been having a lot of trouble with this.

Thanks in advance,

Ramiro







--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
---End Message---
---BeginMessage---
There is no need for escaping if you use prepared statements, which everyone
should do.

 Tamara Temple tamouse.li...@gmail.com hat am 16. November 2013 um 02:52
 geschrieben:


 Or run it through base64_encode after json_encode, never have to worry about
 quotes and things.

 On Nov 14, 2013, at 4:38 PM, Shawn McKenzie sh...@mckenzies.net wrote:

  If you are for example saving the entire $_POST array in a text field of
  your DB, then just serailize() it or json_encode() it and run it through
  the appropriate real_escape_string() function if you're not using prepared
  statements or other custom escaping.
 
 
  On Thu, Nov 14, 2013 at 3:40 PM, Ramiro Barrantes 
  ram...@precisionbioassay.com wrote:
 
  Hello,
 
  I would like to record, on a database, the global variables $_POST and
  $_SERVER for each action that the user does that involves a modification of
  the database.   I am just saving, say $_POST or $_SERVER (and others), as a
  string and putting it in a field on the database.
 
  However, when I try to get the info out of the database and access it as
  an XML (using the DOMDocument library) it becomes a pain to handle due to
  all the special characters (I think, as I haven't been able to get it to
  work), for example:
 
  Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0
 
  (I seem to need to replace all the /s)
 
  It's a pain, and I would like not to have to replace special characters
  with preg_replace if possible.
 
  Any suggestions?  I have been having a lot of trouble with this.
 
  Thanks in advance,
 
  Ramiro
 
 


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


--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz
---End Message---


php-general Digest 14 Nov 2013 10:44:41 -0000 Issue 8425

2013-11-15 Thread php-general-digest-help

php-general Digest 14 Nov 2013 10:44:41 - Issue 8425

Topics (messages 322447 through 322454):

Re: regarding print_r()
322447 by: George Wilson
322448 by: Shawn McKenzie
322452 by: Tamara Temple
322453 by: Sachin Raut

Date sequence calculating
322449 by: Ron Piggott
322450 by: Jonathan Sundquist
322451 by: George Wilson

PHP 5.5.6 has been released
322454 by: Julien Pauli

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---
That is insanely awesome!

Thanks for passing that along.


On Tue, Nov 12, 2013 at 10:17 AM, Phred White phpl...@planetphred.comwrote:

 My fave:

 echo 'textarea . print_r($a,true) . '/textarea';

 - print_r's indents etc. maintained (as in pre)
 - default textarea is small and consistent size, doesn't disrupt layout
 even for massive arrays
 - you can resize at will (at least in Safari)
 - you can have multiples for complex problem solving and view them next to
 each other!

 On Nov 10, 2013, at 8:15 AM, Ken Robinson wrote:

  A nice application of the second parameter is to get the output of
 print_r formatted on your web page:
 
  echo 'pre' . print_r($ary, true) . '/pre';
 
  much easier to read...
 
  Ken
 
  At 08:26 AM 11/10/2013, Sachin Raut wrote:
  Thank you Mr.Sperberg for telling about 2nd parameter. Really appreciate
  your help.
 
  Thanks
  Sachin Raut
 
 
  On Sun, Nov 10, 2013 at 2:39 PM, Camilo Sperberg unrea...@gmail.com
 wrote:
 
  
   On 10 nov. 2013, at 06:24, Sachin Raut imsachinr...@gmail.com
 wrote:
  
Issue resolved. I didn't notice that i was passing print_r()
 function to
echo. Silly mistake.
   
Thanks
Sachin Raut
   
   
On Sun, Nov 10, 2013 at 10:39 AM, Sachin Raut 
 imsachinr...@gmail.com
   wrote:
   
Hello,
   
   
I am trying to print following array using print_r(), but it
 appends
number 1 to the output. Can someone pls tell me what is the issue
   here or
is there any setting i need to do in PHP.
   
   
Thanks
   
Sachin Raut
   
   
?php
   
$a[]=Paris;
   
$a[]=London;
   
echo print_r($a);
   
?
   
   
Output :
   
Array ( [0] = Paris [1] = London ) 1
   
  
   I think everyone on this list has made that same mistake once.
  
   Just as a sidenote, you can pass true as second parameter to have
 print_r
   return the contents instead of printing them directly. It comes in
 very
   handy in case you need to escape characters before printing or
 manipulate
   the string before you want to print.
  
   Greetings.
  
   Met vriendelijke groet,
   Camilo Sperberg
  
   
   W: http://unreal4u.com
   T: http://twitter.com/unreal4u
  
  
 
 
  --
  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


---End Message---
---BeginMessage---
FWIW, I use var_export() since it is valid PHP code and can be copy/pasted
etc.


On Sat, Nov 9, 2013 at 11:09 PM, Sachin Raut imsachinr...@gmail.com wrote:

 Hello,


 I am trying to print following array using print_r(), but it appends number
 1 to the output. Can someone pls tell me what is the issue here or is
 there any setting i need to do in PHP.


 Thanks

 Sachin Raut


 ?php

  $a[]=Paris;

 $a[]=London;

  echo print_r($a);

 ?


 Output :

 Array ( [0] = Paris [1] = London ) 1

---End Message---
---BeginMessage---
+ for var_export()!
+ for textarea!


On Nov 12, 2013, at 1:17 PM, Shawn McKenzie sh...@mckenzies.net wrote:

 FWIW, I use var_export() since it is valid PHP code and can be copy/pasted
 etc.
 
 
 On Sat, Nov 9, 2013 at 11:09 PM, Sachin Raut imsachinr...@gmail.com wrote:
 
 Hello,
 
 
 I am trying to print following array using print_r(), but it appends number
 1 to the output. Can someone pls tell me what is the issue here or is
 there any setting i need to do in PHP.
 
 
 Thanks
 
 Sachin Raut
 
 
 ?php
 
 $a[]=Paris;
 
 $a[]=London;
 
 echo print_r($a);
 
 ?
 
 
 Output :
 
 Array ( [0] = Paris [1] = London ) 1
 

---End Message---
---BeginMessage---
Wow...didn't know about textarea  var_export(). Really awesome.

thanks
Sachin Raut


On Wed, Nov 13, 2013 at 4:30 AM, Tamara Temple tamouse.li...@gmail.comwrote:

 + for var_export()!
 + for textarea!


 On Nov 12, 2013, at 1:17 PM, Shawn McKenzie sh...@mckenzies.net wrote:

  FWIW, I use var_export() since it is valid PHP code and can be
 copy/pasted
  etc.
 
 
  On Sat, Nov 9, 2013 at 11:09 PM, Sachin Raut imsachinr...@gmail.com
 wrote:
 
  Hello,
 
 
  I am trying to print following array using print_r(), but it appends
 number
  1

php-general Digest 31 Oct 2013 07:14:27 -0000 Issue 8414

2013-11-01 Thread php-general-digest-help

php-general Digest 31 Oct 2013 07:14:27 - Issue 8414

Topics (messages 322393 through 322396):

Re: Starting with XML
322393 by: Stuart Dallas

Re: Apache/PHP exploit
322394 by: Tamara Temple
322395 by: Joshua Kehn
322396 by: Camilo Sperberg

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 30 Oct 2013, at 13:43, leam hall leamh...@gmail.com wrote:

 I'm trying to work on an XML document and turn it into something I can put
 into a database or array. Am getting stuck as I try to learn the PHP stuff
 needed for XML.
 
 What I have so far is just:
 
 $xml = simplexml_load_file('my-file.xml');
 
 $status = $xml-status;
 echo status is $status.\n;
 
 $href = $xml-reference-href;
 echo href is $href.\n;
 
 Which gives:
 
 status is accepted.
 href is .
 
 
 If I do:
 
print_r($xml);
 
 It starts out with:
 
 SimpleXMLElement Object
 (
[@attributes] = Array
(
[id] = My_Info
)
 
[status] = accepted
[title] = Nice long string title
[reference] = SimpleXMLElement Object
(
[@attributes] = Array
(
[href] = http://www.example.com
)
 
)
 
 
 
 How do I reference the nested objects? The file is fairly long and seems
 deeply nested.

The value you’re trying to retrieve is an attribute, and can be accessed using 
the attributes method: http://php.net/simplexmlelement.attributes

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/---End Message---
---BeginMessage---
This info cruised by my screen from G+ today, thought I’d at least pass it 
along:

http://www.exploit-db.com/exploits/29290/


---End Message---
---BeginMessage---
Summary for those on phones?

Best,

-Josh
___
http://byjakt.com
Currently mobile

 On Oct 30, 2013, at 8:37 PM, Tamara Temple tamouse.li...@gmail.com wrote:
 
 This info cruised by my screen from G+ today, thought I’d at least pass it 
 along:
 
 http://www.exploit-db.com/exploits/29290/
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
---End Message---
---BeginMessage---


On 31 okt. 2013, at 01:55, Joshua Kehn j...@kehn.us wrote:

 Summary for those on phones?
 
 Best,
 
 -Josh
 ___
 http://byjakt.com
 Currently mobile
 
 On Oct 30, 2013, at 8:37 PM, Tamara Temple tamouse.li...@gmail.com wrote:
 
 This info cruised by my screen from G+ today, thought I’d at least pass it 
 along:
 
 http://www.exploit-db.com/exploits/29290/
 
 
 
 -- 
 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
 

It opens a shell on default ubuntu/debian lamp's, compromising several versions 
of php, including the 5.5 branch. 

Sent from my iPhone 6 Beta [Confidential use only]---End Message---


php-general Digest 26 Oct 2013 08:44:06 -0000 Issue 8410

2013-10-26 Thread php-general-digest-help

php-general Digest 26 Oct 2013 08:44:06 - Issue 8410

Topics (messages 322376 through 322384):

Re: framework or not
322376 by: Stuart Dallas
322378 by: Robert Cummings
322380 by: Stuart Dallas
322381 by: David Harkness

News Regard Attack; Announcing Official php.net Twitter Account
322377 by: Daniel Brown
322379 by: Tedd Sperling

I am puzzled. Error on one site, no error on the other
322382 by: Stephen
322383 by: Aziz Saleh

Does a call to trigger_error ever return?
322384 by: Peter West

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 25 Oct 2013, at 15:01, Robert Cummings rob...@interjinn.com wrote:

 On 13-10-24 09:41 PM, Larry Garfield wrote:
 On 10/23/2013 08:51 AM, Jay Blanchard wrote:
 [snip] a bitter rant[/snip]
 
 Dang Larry - bad night?
 
 That wasn't a bitter rant.  You haven't seen me bitter. :-)  That was
 tough love to the OP.  I don't see a reason to pussyfoot around the
 original question, which is one that comes up about once a month.  The
 answer is always the same: How much is your time worth?
 
 Basic math...
 
Life: finite
Time: infinite
 
finite / infinite = 0
 
 *sniffle*

Who's valuation of your time actually matters? Yours, and yours alone.

Therefore:

Life: n years
Time I can benefit from my life: n years

n years / n years = 1

*hoorah*

Your time is the most precious commodity you have.

Whether you use a framework or not you will (hopefully) reuse code between 
projects. If you choose to make part of that reused code one of the many 
frameworks that exist, you need only do one thing to ensure it continues to be 
worth using: how much of your time do you spend battling against the 
restrictions of the framework? If that's sufficiently low then using that 
framework is probably a good thing. If a significant portion of your time is 
spent battling the framework it's time to make a change.

Also remember that the only person who can truthfully judge whether you're 
wasting time is you, unless you earn money by selling your time to someone 
else in which case they have some right to decide what constitutes a waste of 
the time for which they're paying. I found the experience of writing my own 
framework to be hugely beneficial to my future productivity, but I might have 
struggled to justify spending the extra time it took to my employer at the time.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
---End Message---
---BeginMessage---

On 13-10-25 10:17 AM, Stuart Dallas wrote:

On 25 Oct 2013, at 15:01, Robert Cummings rob...@interjinn.com wrote:


On 13-10-24 09:41 PM, Larry Garfield wrote:

On 10/23/2013 08:51 AM, Jay Blanchard wrote:

[snip] a bitter rant[/snip]

Dang Larry - bad night?


That wasn't a bitter rant.  You haven't seen me bitter. :-)  That was
tough love to the OP.  I don't see a reason to pussyfoot around the
original question, which is one that comes up about once a month.  The
answer is always the same: How much is your time worth?


Basic math...

Life: finite
Time: infinite

finite / infinite = 0

*sniffle*


Who's valuation of your time actually matters? Yours, and yours alone.

Therefore:

Life: n years
Time I can benefit from my life: n years

n years / n years = 1

*hoorah*

Your time is the most precious commodity you have.

Whether you use a framework or not you will (hopefully) reuse code between 
projects. If you choose to make part of that reused code one of the many 
frameworks that exist, you need only do one thing to ensure it continues to be 
worth using: how much of your time do you spend battling against the 
restrictions of the framework? If that's sufficiently low then using that 
framework is probably a good thing. If a significant portion of your time is 
spent battling the framework it's time to make a change.

Also remember that the only person who can truthfully judge whether you're wasting 
time is you, unless you earn money by selling your time to someone else in which 
case they have some right to decide what constitutes a waste of the time for which 
they're paying. I found the experience of writing my own framework to be hugely 
beneficial to my future productivity, but I might have struggled to justify spending the 
extra time it took to my employer at the time.


You stripped away the context of my response. By removing the evil grin 
you made it look like I was serious. You should be a reporter ;)


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s

php-general Digest 25 Oct 2013 14:01:46 -0000 Issue 8409

2013-10-26 Thread php-general-digest-help

php-general Digest 25 Oct 2013 14:01:46 - Issue 8409

Topics (messages 322370 through 322375):

Persistent connections
322370 by: Nibin V M
322371 by: Stuart Dallas
322372 by: Nibin V M
322373 by: Stuart Dallas
322374 by: Nibin V M

Re: framework or not
322375 by: Robert Cummings

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---
Hello,

I have been reading docs and many are telling that persistent connections
are kept open indefinitely. But I found in PHP docs that it will not close
after script execution like requesting  a page; so should it close after
the request is over?

So when exactly a persistent connection should close?

Please advice.

-- 
Regards

Nibin.
---End Message---
---BeginMessage---
On 25 Oct 2013, at 11:10, Nibin V M nibi...@gmail.com wrote:

 I have been reading docs and many are telling that persistent connections
 are kept open indefinitely. But I found in PHP docs that it will not close
 after script execution like requesting  a page; so should it close after
 the request is over?
 
 So when exactly a persistent connection should close?
 
 Please advice.

A persistent connection is closed when the PHP process ends, or it gets 
disconnected by the server-side or due to a network error. Attempting to 
explicitly close a persistent connection will do nothing without complaining.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
---End Message---
---BeginMessage---
Thank you for the quick response Stuart...one more doubt..at
http://php.net/manual/en/features.persistent-connections.php they states

=
This means that when the same client makes a second request to the server,
it may be served by a different child process than the first time. When
opening a persistent connection, every following page requesting SQL
services can reuse the same established connection to the SQL server
=

Is the persistent connection pool is re-used between apache child
processes ?


On Fri, Oct 25, 2013 at 3:54 PM, Stuart Dallas stu...@3ft9.com wrote:

 On 25 Oct 2013, at 11:10, Nibin V M nibi...@gmail.com wrote:

  I have been reading docs and many are telling that persistent connections
  are kept open indefinitely. But I found in PHP docs that it will not
 close
  after script execution like requesting  a page; so should it close after
  the request is over?
 
  So when exactly a persistent connection should close?
 
  Please advice.

 A persistent connection is closed when the PHP process ends, or it gets
 disconnected by the server-side or due to a network error. Attempting to
 explicitly close a persistent connection will do nothing without
 complaining.

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/




-- 
Regards

Nibin.

http://TechsWare.in
---End Message---
---BeginMessage---
On 25 Oct 2013, at 12:51, Nibin V M nibi...@gmail.com wrote:

 Thank you for the quick response Stuart...one more doubt..at 
 http://php.net/manual/en/features.persistent-connections.php they states
 
 =
 This means that when the same client makes a second request to the server, it 
 may be served by a different child process than the first time. When opening 
 a persistent connection, every following page requesting SQL services can 
 reuse the same established connection to the SQL server
 =
 
 Is the persistent connection pool is re-used between apache child processes ? 

No, connections are not shared between PHP processes. Nothing is shared between 
PHP processes.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


 On Fri, Oct 25, 2013 at 3:54 PM, Stuart Dallas stu...@3ft9.com wrote:
 On 25 Oct 2013, at 11:10, Nibin V M nibi...@gmail.com wrote:
 
  I have been reading docs and many are telling that persistent connections
  are kept open indefinitely. But I found in PHP docs that it will not close
  after script execution like requesting  a page; so should it close after
  the request is over?
 
  So when exactly a persistent connection should close?
 
  Please advice.
 
 A persistent connection is closed when the PHP process ends, or it gets 
 disconnected by the server-side or due to a network error. Attempting to 
 explicitly close a persistent connection will do nothing without complaining.
 
 -Stuart
 
 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/
 
 
 
 -- 
 Regards
 
 Nibin.
 
 http://TechsWare.in

---End Message---
---BeginMessage---
ok..thank you very much Stuart :)


On Fri, Oct 25, 2013 at 6:02 PM, Stuart Dallas stu...@3ft9.com wrote:

 On 25 Oct 2013, at 12:51, Nibin V M nibi...@gmail.com wrote:

  Thank you for the quick response Stuart...one more doubt..at
 http://php.net/manual/en

php-general Digest 20 Oct 2013 15:50:29 -0000 Issue 8402

2013-10-20 Thread php-general-digest-help

php-general Digest 20 Oct 2013 15:50:29 - Issue 8402

Topics (messages 322325 through 322339):

Re: Best Secure practice for uploading a csv file to import
322325 by: Ashley Sheridan
322326 by: Joshua Kehn

Re: Algorithm Help
322327 by: German Geek
322334 by: German Geek
322335 by: German Geek
322337 by: Ayush Ladia
322338 by: German Geek

If date is greater than
322328 by: John Taylor-Johnston
322329 by: German Geek
322330 by: John Taylor-Johnston
322331 by: John Taylor-Johnston
322332 by: Bastien
322336 by: Ashley Sheridan
322339 by: Tedd Sperling

Re: Switch Statement
322333 by: German Geek

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 Sat, 2013-10-19 at 18:57 -0400, Joey J wrote:

 Hello All,
 
 I just wanted to see the best way to securely accomplish this task.
 when we want to update a DB we upload to a writable directory instead of
 writing it directly to MySQL, I don't like having writable directories if
 possible.
 Is there a right or better way to accomplish this?
 
 Thanks!
 


There's nothing inherently wrong with having a directory writeable on
your web server, but you should ensure it's running with the least
privileges it requires to complete your task.

So, make sure that the Apache user is also the owner of the directory,
then you only need to give it 755 permissions (it's always unwise to use
777 on a production server).

Another thing you can do is to place the upload directory outside your
web root so that it's not accessible via a browser.

I can see why you wouldn't want to import it directly into the database
though. I recently had to fix a script of mine because someone thought
it would be a good idea to change the order of a bunch of fields in a
CSV, and added a new field in the middle rather than at the end. Having
a script in between the CSV and the database can ensure some sort of
data quality check is in-place before importing bad data.

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


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

 On Oct 19, 2013, at 7:06 PM, Ashley Sheridan a...@ashleysheridan.co.uk 
 wrote:
 
 On Sat, 2013-10-19 at 18:57 -0400, Joey J wrote:
 
 Hello All,
 
 I just wanted to see the best way to securely accomplish this task.
 when we want to update a DB we upload to a writable directory instead of
 writing it directly to MySQL, I don't like having writable directories if
 possible.
 Is there a right or better way to accomplish this?
 
 Thanks!
 
 
 There's nothing inherently wrong with having a directory writeable on
 your web server, but you should ensure it's running with the least
 privileges it requires to complete your task.
 
 So, make sure that the Apache user is also the owner of the directory,
 then you only need to give it 755 permissions (it's always unwise to use
 777 on a production server).
 
 Another thing you can do is to place the upload directory outside your
 web root so that it's not accessible via a browser.
 
 I can see why you wouldn't want to import it directly into the database
 though. I recently had to fix a script of mine because someone thought
 it would be a good idea to change the order of a bunch of fields in a
 CSV, and added a new field in the middle rather than at the end. Having
 a script in between the CSV and the database can ensure some sort of
 data quality check is in-place before importing bad data.
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk

Good points by Ash above. 

I'd like to mention that because this is user input make sure any database 
access is escaped correctly (prepared statements are good) and when/if you 
output it should all be HTML escaped. 

Best,

-Josh
___
http://byjakt.com
Currently mobile---End Message---
---BeginMessage---
This is how I would approach/imagine it:

https://docs.google.com/drawings/d/111RISgcHyAg8NXem4H1NXnxByRUydL8GiYlGkobJwus/edit

Tom has been with Andrew 0 times.
Tom has been with Shelly 1 time.
Christine has been with Andrew 2 times.
...

So the Graph maintains who has been with who how often.

For 10 or even 20 kids you might be able to go through all links (brute
force).

The number of links (including the ones with 0 weight) is
#links = n*(n-1)/2
which is the number of links you have to maintain and then check when you
want to know who should go with whom.

So, if
n=10: #links = 10*9/2 = 45
n=20: #links = 20*19/2 = 190
n=30: #links = 30*29/2 = 435

I think even for reasonably large groups a computer can do the job easily.
I would find it quite hard to do it on paper though, so I think you should
program it.

You could simply

php-general Digest 7 Oct 2013 13:24:41 -0000 Issue 8388

2013-10-07 Thread php-general-digest-help

php-general Digest 7 Oct 2013 13:24:41 - Issue 8388

Topics (messages 322243 through 322257):

Re: date time problem
322243 by: Farzan Dalaee
322244 by: Jim Giner
322245 by: Farzan Dalaee
322247 by: Jim Giner
322248 by: Farzan Dalaee
322249 by: Jonathan Sundquist
322250 by: Aziz Saleh
322251 by: Jim Giner
322252 by: Aziz Saleh
322253 by: Ashley Sheridan
322254 by: Jim Giner
322255 by: Jim Giner
322256 by: Romain CIACCAFAVA

After a PHP script timeout, Apache logs the error but may not cleanly exit the 
script
322246 by: Meta Seller Admin

PHP Fatal error: Call to undefined function ()
322257 by: Michael Alaimo

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---
You should use  gmdate() if you want to how many hours left to expire
$time_left = gmdate(H:i:s,$diff);

Best Regards
Farzan Dalaee

 On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote:
 
 I always hate dealing with date/time stuff in php - never get it even close 
 until an hour or two goes by
 
 anyway
 
 I have this:
 
 // get two timestamp values
 $exp_time = $_COOKIE[$applid.expire];
 $curr_time = time();
 // get the difference
 $diff = $exp_time - $curr_time;
 // produce a display time of the diff
 $time_left = date(h:i:s,$diff);
 
 Currently the results are:
 exp_time is 06:55:07
 curr_time is 06:12:03
 the diff is 2584
 All of these are correct.
 
 BUT time_left is 07:43:04 when it should be only 00:43:04.
 
 So - where is the hour value of '07' coming from?? And how do I get this 
 right?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
---End Message---
---BeginMessage---

On 10/6/2013 6:36 PM, Farzan Dalaee wrote:

You should use  gmdate() if you want to how many hours left to expire
$time_left = gmdate(H:i:s,$diff);

Best Regards
Farzan Dalaee


On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote:

I always hate dealing with date/time stuff in php - never get it even close 
until an hour or two goes by

anyway

I have this:

// get two timestamp values
$exp_time = $_COOKIE[$applid.expire];
$curr_time = time();
// get the difference
$diff = $exp_time - $curr_time;
// produce a display time of the diff
$time_left = date(h:i:s,$diff);

Currently the results are:
exp_time is 06:55:07
curr_time is 06:12:03
the diff is 2584
All of these are correct.

BUT time_left is 07:43:04 when it should be only 00:43:04.

So - where is the hour value of '07' coming from?? And how do I get this right?

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



Thanks for the quick response, but why do I want to show the time in 
GMT?  However, I did try it, changing the 'time_left' calc to use 
gmdate.  Now instead of a 7 for hours I have a 12.


exp 07:34:52
curr 06:40:14
diff 3158
left is 12:52:38

The 52:38 is the correct value, but not the 12.
---End Message---
---BeginMessage---
Try this please

 gmdate(H:i:s, $diff%86400) 

Best Regards
Farzan Dalaee

 On Oct 7, 2013, at 2:12, Jim Giner jim.gi...@albanyhandball.com wrote:
 
 On 10/6/2013 6:36 PM, Farzan Dalaee wrote:
 You should use  gmdate() if you want to how many hours left to expire
 $time_left = gmdate(H:i:s,$diff);
 
 Best Regards
 Farzan Dalaee
 
 On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote:
 
 I always hate dealing with date/time stuff in php - never get it even close 
 until an hour or two goes by
 
 anyway
 
 I have this:
 
 // get two timestamp values
 $exp_time = $_COOKIE[$applid.expire];
 $curr_time = time();
 // get the difference
 $diff = $exp_time - $curr_time;
 // produce a display time of the diff
 $time_left = date(h:i:s,$diff);
 
 Currently the results are:
 exp_time is 06:55:07
 curr_time is 06:12:03
 the diff is 2584
 All of these are correct.
 
 BUT time_left is 07:43:04 when it should be only 00:43:04.
 
 So - where is the hour value of '07' coming from?? And how do I get this 
 right?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 Thanks for the quick response, but why do I want to show the time in GMT?  
 However, I did try it, changing the 'time_left' calc to use gmdate.  Now 
 instead of a 7 for hours I have a 12.
 
 exp 07:34:52
 curr 06:40:14
 diff 3158
 left is 12:52:38
 
 The 52:38 is the correct value, but not the 12.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
---End Message---
---BeginMessage---

On 10/6/2013 6:49 PM, Farzan Dalaee wrote:

Try

php-general Digest 3 Oct 2013 12:47:41 -0000 Issue 8386

2013-10-03 Thread php-general-digest-help

php-general Digest 3 Oct 2013 12:47:41 - Issue 8386

Topics (messages 322235 through 322240):

Re: Algorithm Help
322235 by: Stuart Dallas
322236 by: Serge Fonville
322237 by: Floyd Resler
322238 by: Marc Guay
322239 by: Tamara Temple
322240 by: Floyd Resler

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 1 Oct 2013, at 19:51, Floyd Resler fres...@adex-intl.com wrote:

 Here's my task: A group of kids is going to be staying with different host 
 families throughout the next 8 months.  The number of kids staying with a 
 host family can range from 2 to 10.  When deciding which kids should stay 
 together at a host family, the idea is for the system to put together kids 
 who have stayed with each other the least on past weekends.  So, if a host 
 family can keep 5 kids, then the group of 5 kids who have stayed together the 
 least will be chosen.
 
 I can't think of an easy, quick way to accomplish this.  I've tried various 
 approaches that have resulted in a lot of coding and being very slow.  My 
 idea was to give each group of kids a score and the lowest score is the group 
 that is selected.  However, this approach wound of iterating through several 
 arrays several times which was really slow.  Does anyone have any ideas on 
 this puzzle?

Sounds like a job for a directed graph data structure. I wish I had time to 
knock up a solution but I don't right now. This article should help you get 
started: 
http://www.codediesel.com/algorithms/building-a-graph-data-structure-in-php/

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/---End Message---
---BeginMessage---
It also depends on the amount of kids, families and stays.

If the numbers are low, by hand may be a lot easier and faster

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl


2013/10/2 Tamara Temple tamouse.li...@gmail.com


 On Oct 1, 2013, at 1:51 PM, Floyd Resler fres...@adex-intl.com wrote:

  Here's my task: A group of kids is going to be staying with different
 host families throughout the next 8 months.  The number of kids staying
 with a host family can range from 2 to 10.  When deciding which kids should
 stay together at a host family, the idea is for the system to put together
 kids who have stayed with each other the least on past weekends.  So, if a
 host family can keep 5 kids, then the group of 5 kids who have stayed
 together the least will be chosen.
 
  I can't think of an easy, quick way to accomplish this.  I've tried
 various approaches that have resulted in a lot of coding and being very
 slow.  My idea was to give each group of kids a score and the lowest score
 is the group that is selected.  However, this approach wound of iterating
 through several arrays several times which was really slow.  Does anyone
 have any ideas on this puzzle?
 
  Thanks!
  Floyd
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 While definitely a tempting coding exercise, I just want to say that if
 this is urgent in any way, shuffling cards with the kids' names on them by
 hand might just be faster and less frustrating :)

 OTOH, if this is something you're going to have to figure out week after
 week, then a software solution might be handy.

 This is also not an *easy* problem to solve; there isn't a simple approach
 to optimizing this sort of thing because you're building a net between all
 the various kids based on past stays, in addition to the constraints of
 host family  capacity. Thus your previous code attempts might in fact be
 the end result.

 Obviously, structuring the data is the key here.

 I'm thinking of 3 primary models: Kids, Hosts, and Stays.

 Kids and Hosts seem pretty obvious. Stays is the interesing model, and
 needs to have joining tables with Kids and Hosts.

 A Stay will have one Host, and have many Kids and a date.

 The algorithm then needs to make the graph where it can pull out the
 number of times any particular kid has stayed with another, looking
 something like this:

 Amy:
Ben: 10
Jill: 3
Carlos: 7
Chen: 2
 Ben:
Amy: 10
Jill: 5
Carlos: 8
Chen: 3
 Jill:
… and so on

 Then you be able to pull through that graph and find the smallest number
 of stays for each kid.

 Not simple, but I hope this helps.



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


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


On Oct 2, 2013, at 9:51 AM, Tamara Temple tamouse.li...@gmail.com wrote:

 
 On Oct 1, 2013, at 1:51 PM, Floyd Resler fres...@adex-intl.com wrote:
 
 Here's my task: A group

php-general Digest 2 Oct 2013 13:52:00 -0000 Issue 8385

2013-10-02 Thread php-general-digest-help

php-general Digest 2 Oct 2013 13:52:00 - Issue 8385

Topics (messages 38 through 322234):

Re: delete S3 bucket with AWS PHP SDK
38 by: Aziz Saleh

Re: Algorithm Help
39 by: John Meyer
322230 by: Aziz Saleh
322231 by: Ashley Sheridan
322232 by: Floyd Resler
322233 by: Serge Fonville
322234 by: Tamara Temple

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---
Hey Tim,

It seems that deleteObject takes in 2 params, and you are sending it 1
param. I would recommend you look at the documentation and make sure you
are sending the right params.

Aziz


On Sun, Sep 29, 2013 at 10:29 PM, Tim Dunphy bluethu...@gmail.com wrote:

 Hi Aziz,

  Thank you for getting back to me!

  I appreciate you spotting that error.

 So I corrected that

 ?php
   require_once 'sdk.class.php';
 if (isset($_POST['submit'])) {

 *  $bucket_name = $_POST['bucket_name'];*

  // Create the S3 Object from the SDK
   $s3 = new AmazonS3();
 *
   $result = $s3-deleteObject(array(
 'Bucket' = $bucket_name ));*


  // The response comes back as a Simple XML Object
 // In this case we just want to know if everything was okay.
 // If not, report the message from the XML response.
  if ((int) $response-isOK()) {
 echo 'centerDeleted Bucket';
 echo 'br /br /';
 echo 'a href=listbuckets.phpList Buckets/a/center';
   } else {
 echo (string) $response-body-Message;
   }
  //echo 'br /br /';
 }
 ?
 body
   centerh3Delete S3 Bucket/h3
form name=delete_bucket method=post action=delete_bucket.php
 label for=bucket_nameBucket Name:/labelbr /
* input type=text id=bucket_name name=bucket_name /br /br /
 *
 input type=submit name=submit value=Delete Bucket /
   /form/center
 script
 /body
 /html


 And this is the error I am currently getting:


 Warning: Missing argument 2 for AmazonS3::delete_object() in
 /var/www/awssdk/services/s3.class.php on line 1576 Notice: Undefined
 variable: filename in /var/www/awssdk/services/s3.class.php on line 1581
 Warning: preg_match() expects parameter 2 to be string, array given in
 /var/www/awssdk/services/s3.class.php on line 1042 Warning: preg_match()
 expects parameter 2 to be string, array given in
 /var/www/awssdk/services/s3.class.php on line 1043 Fatal error: Uncaught
 exception 'S3_Exception' with message 'S3 does not support Array as a
 valid bucket name. Review Bucket Restrictions and Limitations in the S3
 Developer Guide for more information.' in
 /var/www/awssdk/services/s3.class.php:548 Stack trace: #0
 /var/www/awssdk/services/s3.class.php(1594): AmazonS3-authenticate(Array,
 Array) #1 [internal function]: AmazonS3-delete_object(Array) #2
 /var/www/awssdk/sdk.class.php(436): call_user_func_array(Array, Array) #3
 /var/www/awssdk/delete_bucket.php(72): CFRuntime-__call('deleteObject',
 Array) #4 /var/www/awssdk/delete_bucket.php(72):
 AmazonS3-deleteObject(Array) #5 {main} thrown in
 /var/www/awssdk/services/s3.class.php on line 548

 Not sure if I'm getting closer here... but definitely appreciate any
 advice anyone may have.

 Thanks!
 Tim


 On Sun, Sep 29, 2013 at 5:04 PM, Aziz Saleh azizsa...@gmail.com wrote:

 No Problem, the issue is that you referring to the invalid post element
 $bucket_name as opposed to the correct on bucket_name.

 *$bucket_name = $_POST['$bucket_name'];*

 Should be

 *$bucket_name = $_POST['bucket_name'];*

 Aziz


 On Sun, Sep 29, 2013 at 3:28 PM, Tim Dunphy bluethu...@gmail.com wrote:

 Hey guys,

  Sorry about that i should have posted the full code to give you some
 idea of context. Anyway, here it is:

 ?php
   require_once 'sdk.class.php';
 if (isset($_POST['submit'])) {

 *  $bucket_name = $_POST['$bucket_name'];*
  // Create the S3 Object from the SDK
   *$s3 = new AmazonS3();*

 *  $result = $s3-deleteObject(array(*
 *'Bucket' = $bucket_name ));*


  // The response comes back as a Simple XML Object
  // In this case we just want to know if everything was okay.
 // If not, report the message from the XML response.
  if ((int) $response-isOK()) {
 echo 'centerDeleted Bucket';
 echo 'br /br /';
 echo 'a href=listbuckets.phpList Buckets/a/center';
   } else {
 echo (string) $response-body-Message;
   }
  //echo 'br /br /';
 }
 ?
 body
   centerh3Delete S3 Bucket/h3
form name=delete_bucket method=post action=delete_bucket.php
 label for=bucket_nameBucket Name:/labelbr /
   *  input type=text id=bucket_name name=bucket_name /br /br
 /*
 input type=submit name=submit value=Delete Bucket /
   /form/center

 So, as you can see I am taking the 'bucket_value' from $_POST and
 passing it into the call to S3.

 When the form comes up on the web

php-general Digest 1 Oct 2013 18:51:44 -0000 Issue 8384

2013-10-01 Thread php-general-digest-help

php-general Digest 1 Oct 2013 18:51:44 - Issue 8384

Topics (messages 37 through 37):

Algorithm Help
37 by: Floyd Resler

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---
Here's my task: A group of kids is going to be staying with different host 
families throughout the next 8 months.  The number of kids staying with a host 
family can range from 2 to 10.  When deciding which kids should stay together 
at a host family, the idea is for the system to put together kids who have 
stayed with each other the least on past weekends.  So, if a host family can 
keep 5 kids, then the group of 5 kids who have stayed together the least will 
be chosen.

I can't think of an easy, quick way to accomplish this.  I've tried various 
approaches that have resulted in a lot of coding and being very slow.  My idea 
was to give each group of kids a score and the lowest score is the group that 
is selected.  However, this approach wound of iterating through several arrays 
several times which was really slow.  Does anyone have any ideas on this puzzle?

Thanks!
Floyd

---End Message---


php-general Digest 30 Sep 2013 18:03:46 -0000 Issue 8383

2013-09-30 Thread php-general-digest-help

php-general Digest 30 Sep 2013 18:03:46 - Issue 8383

Topics (messages 322219 through 36):

Re: delete S3 bucket with AWS PHP SDK
322219 by: Ashley Sheridan
31 by: Aziz Saleh
32 by: Tim Dunphy
33 by: Aziz Saleh
35 by: Tim Dunphy

Re: Switch Statement
30 by: mrfroasty

Re: Sending PHP mail with Authentication
34 by: Paul M Foster

Re: Is correct to override XML standards?
36 by: buzon.alejandro.ceballos.info

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 Sun, 2013-09-29 at 12:30 -0400, Tim Dunphy wrote:

 Hi All,
 
  I am attempting to delete an empty S3 bucket using the AWS PHP SDK.
 
  Here's how they describe the process in the docs:
 
 $result = $client-deleteBucket(array(
 // Bucket is required
 'Bucket' = 'string',
 ));
 
  You can find the full entry here:
 
 AWS PHP SDK Delete Bucket
 Docshttp://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.S3.S3Client.html#_deleteBucket
 
 Here's how I approached it in my code:
 
  $s3 = new AmazonS3();
 
   $result = $s3-deleteObject(array(
 'Bucket' = $bucket_name ));
 
 But when I run it, this is the error I get:
 
 'Notice: Undefined index: $bucket_name in /var/www/awssdk/delete_bucket.php
 on line 5 Warning: Missing argument 2 for AmazonS3::delete_object() in
 /var/www/awssdk/services/s3.class.php on line 1576 Notice: Undefined
 variable: filename in /var/www/awssdk/services/s3.class.php on line 1581
 Warning: preg_match() expects parameter 2 to be string, array given in
 /var/www/awssdk/services/s3.class.php on line 1042 Warning: preg_match()
 expects parameter 2 to be string, array given in
 /var/www/awssdk/services/s3.class.php on line 1043 Fatal error: Uncaught
 exception 'S3_Exception' with message 'S3 does not support Array as a
 valid bucket name. Review Bucket Restrictions and Limitations in the S3
 Developer Guide for more information.' in
 /var/www/awssdk/services/s3.class.php:548 Stack trace: #0
 /var/www/awssdk/services/s3.class.php(1594): AmazonS3-authenticate(Array,
 Array) #1 [internal function]: AmazonS3-delete_object(Array) #2
 /var/www/awssdk/sdk.class.php(436): call_user_func_array(Array, Array) #3
 /var/www/awssdk/delete_bucket.php(10): CFRuntime-__call('deleteObject',
 Array) #4 /var/www/awssdk/delete_bucket.php(10):
 AmazonS3-deleteObject(Array) #5 {main} thrown in
 /var/www/awssdk/services/s3.class.php on line 548'
 
 
 This is line 548 in the above referenced file:
 
 // Validate the S3 bucket name
 if (!$this-validate_bucketname_support($bucket))
 {
 // @codeCoverageIgnoreStart
 throw new S3_Exception('S3 does not support ' .
 $bucket . ' as a valid bucket name. Review Bucket Restrictions and
 Limitations in the S3 Developer Guide for more information.');
 // @codeCoverageIgnoreEnd
 }
 
 
 
 
 Has anyone played around enough with the AWS SDK to know what I'm doing
 wrong here? Would anyone else be able to hazard a guess?
 
 Thanks
 Tim


Your code is failing because $bucket_name, I suspect, is null. Where do
you define this variable before you use it in this bit of code:

$result = $s3-deleteObject(array(
'Bucket' = $bucket_name ));

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


---End Message---
---BeginMessage---
Hi Tim,

Is the call working? Does it actually get deleted?

This could just be an issue (which I see alot) where developers do not
check for variables or preset them before usage, causing those notices to
come up (pretty harmless most of the times).

Aziz


On Sun, Sep 29, 2013 at 12:30 PM, Tim Dunphy bluethu...@gmail.com wrote:

 Hi All,

  I am attempting to delete an empty S3 bucket using the AWS PHP SDK.

  Here's how they describe the process in the docs:

 $result = $client-deleteBucket(array(
 // Bucket is required
 'Bucket' = 'string',
 ));

  You can find the full entry here:

 AWS PHP SDK Delete Bucket
 Docs
 http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.S3.S3Client.html#_deleteBucket
 

 Here's how I approached it in my code:

  $s3 = new AmazonS3();

   $result = $s3-deleteObject(array(
 'Bucket' = $bucket_name ));

 But when I run it, this is the error I get:

 'Notice: Undefined index: $bucket_name in /var/www/awssdk/delete_bucket.php
 on line 5 Warning: Missing argument 2 for AmazonS3::delete_object() in
 /var/www/awssdk/services/s3.class.php on line 1576 Notice: Undefined
 variable: filename in /var/www/awssdk/services/s3.class.php on line 1581
 Warning: preg_match() expects parameter 2 to be string, array given in
 /var/www/awssdk/services

php-general Digest 29 Sep 2013 16:30:23 -0000 Issue 8382

2013-09-29 Thread php-general-digest-help

php-general Digest 29 Sep 2013 16:30:23 - Issue 8382

Topics (messages 322207 through 322218):

Re: Switch Statement
322207 by: Aziz Saleh
322209 by: Jim Giner
322210 by: Jim Giner
322212 by: Ethan Rosenberg
322213 by: Ethan Rosenberg
322214 by: Jim Giner
322215 by: Jim Giner
322217 by: Aziz Saleh

Re: create a local temp table in local machine
322208 by: Bastien
322211 by: iccsi

Running a command without shell
322216 by: vitalif.yourcmc.ru

delete S3 bucket with AWS PHP SDK
322218 by: Tim Dunphy

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---
Ethan, can you do a var_dump instead of print_r. It might be that next_step
has spaces in it causing the switch to not match.

Aziz


On Sat, Sep 28, 2013 at 10:33 PM, Ethan Rosenberg 
erosenb...@hygeiabiomedical.com wrote:

 Dear List -

 I have a working program.  I made one change in a switch statement, and it
 does not work.  I'm probably missing something fundamental.

 Here are some code SNIPPETS...  [please note that all my debug statements
 are at the left margin]

 Setup...

 ?php
 session_start();
 session_name(STORE);
 set_time_limit(2400);
 ini_set('display_errors', 'on');
 ini_set('display_startup_**errors', 'on');
 error_reporting(-2);

 ini_set('error_reporting', 'E_ALL | E_STRICT');
 ini_set('html_errors', 'On');
 ini_set('log_errors', 'On');
 require '/home/ethan/P/wk.inc'; //password file
 $db = Store;
 $cxn =mysqli_connect($host,$user,$**password,$db);
 if (!$cxn)
 {
 die('Connect Error (' . mysqli_connect_errno() . ') '
 . mysqli_connect_error());
 }// no error
 if($_REQUEST['welcome_already_**seen']!= already_seen)

 show_welcome();

 //end setup
 function show_welcome() //this is the input screen
 {
 snip

 echo  input type='hidden' name='welcome_already_seen'
 value='already_seen';
 echo  input type='hidden' name='next_step' value='step20' /;

 snip
 }


 //end input screen

 //Switch statement

 echo 'before';
 print_r($_POST); //post#1

 switch ( $_POST['next_step'] )
 {

 case 'step20':
 {
 pint_r($_POST); //post#2
 echo 'step20';
 if(!empty($_POST['Cust_Num']))
 good();
 if(empty($_POST['Cust_Num']))
 bad();
 break;
 } //end step20

 snip
 } //end switch



 post#1

 beforeArray
 (
 [Cust_Num] = 123
 [Fname] =
 [Lname] =
 [Street] =
 [City] =
 [state] = NY
 [Zip] = 10952
 [PH1] =
 [PH2] =
 [PH3] =
 [Date] =
 [welcome_already_seen] = already_seen
 [next_step] = step20

 )

 Cust_Num state and Zip are as entered.

 The switch statement is never entered, since post#2 is never displayed,
 and neither good() or bad() functions are entered.


 TIA

 Ethan



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


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

On 9/28/2013 10:33 PM, Ethan Rosenberg wrote:

Dear List -

I have a working program.  I made one change in a switch statement, and
it does not work.  I'm probably missing something fundamental.

Here are some code SNIPPETS...  [please note that all my debug
statements are at the left margin]

Setup...

?php
 session_start();
 session_name(STORE);
 set_time_limit(2400);
 ini_set('display_errors', 'on');
 ini_set('display_startup_errors', 'on');
 error_reporting(-2);

 ini_set('error_reporting', 'E_ALL | E_STRICT');
 ini_set('html_errors', 'On');
 ini_set('log_errors', 'On');
 require '/home/ethan/P/wk.inc'; //password file
 $db = Store;
 $cxn =mysqli_connect($host,$user,$password,$db);
 if (!$cxn)
 {
 die('Connect Error (' . mysqli_connect_errno() . ') '
 . mysqli_connect_error());
 }// no error
 if($_REQUEST['welcome_already_seen']!= already_seen)
 show_welcome();

 //end setup
 function show_welcome() //this is the input screen
 {
 snip

 echo  input type='hidden' name='welcome_already_seen'
value='already_seen';
 echo  input type='hidden' name='next_step' value='step20' /;

 snip
 }


 //end input screen

 //Switch statement

echo 'before';
print_r($_POST); //post#1

 switch

php-general Digest 28 Sep 2013 12:26:53 -0000 Issue 8380

2013-09-28 Thread php-general-digest-help

php-general Digest 28 Sep 2013 12:26:53 - Issue 8380

Topics (messages 322200 through 322200):

Re: How to capture uploaded file data
322200 by: Bastien

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---


Thanks,

Bastien

 On Sep 27, 2013, at 12:56 AM, Mariusz Drozdowski scheme...@wp.pl wrote:
 
 Hi all php experts,
 
 I would like to ask you all a question, I hope this is the right place
 to ask it.
 
 I'm writing a PHP extension now in c/c++. User uploads a file (could be POST
 or PUT method, but I can limit it to POST only). I need to capture the
 file data while being
 uploaded, without writing it to disk on the server. I need to process
 the data and (maybe,
 depending on a situation) send it somewhere else or save it to disk.
 Of course I know, that I can process the file
 after it has been uploaded (saved on disk on the server), but I would
 like to avoid it.
 I also need to do something opposite: I need to generate a file on the
 fly and send it
 to the user. All metadata of the generated file is known beforehand
 (e.g. size, name).
 
 I've been searching around for some time now and I could not find
 anything even close to the solution.
 Is there any example(s) or existing PHP extension that do(es) something
 like this (at least something simmilar) ?
 If you could give me any pointers that would be awesome.
 
 Thanks for your help 

The question I have is why? Should your upload fail for any reason you've got a 
half processed file that is non-recoverable.  No do-overs. If you stick to the 
standard processes with out the extension,

Upload
Save somewhere (or leave in temp upload folder)
Process
Send result back to user 
Unlink file

Generating the file and sending it to the user is also pretty standard

Create your dataset
Send appropriate headers
Send data
Close connection

For this, there usually isn't a need to save the file. You may run into issues 
streaming the data to certain browsers. 

Also one of the main downsides to your upload is high load situations or large 
file situations (where file size exceeds php's upload limit). 

My personal preference is to save that file to disk so that if needed I can 
work with it later ( if say the server load is high) and email the results to 
the user. 


---End Message---


php-general Digest 29 Sep 2013 02:33:32 -0000 Issue 8381

2013-09-28 Thread php-general-digest-help

php-general Digest 29 Sep 2013 02:33:32 - Issue 8381

Topics (messages 322201 through 322206):

create a local temp table in local machine
322201 by: iccsi
322202 by: Bastien
322203 by: iccsi
322204 by: Bastien
322205 by: iccsi

Switch Statement
322206 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---

I need create a local table on the local machine.
I would like to know is it possible to down on server side or client side or 
jQuery to do the work.

Your information and help is great appreciated,

regards,


Iccsi, 

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


Thanks,

Bastien

 On Sep 28, 2013, at 3:24 PM, iccsi inu...@gmail.com wrote:
 
 I need create a local table on the local machine.
 I would like to know is it possible to down on server side or client side or 
 jQuery to do the work.
 Your information and help is great appreciated,
 
 regards,
 
 
 Iccsi

If you're looking to create a SQl table then most but not all browsers can use 
SQLite locally for data storage ( it does require newer browsers). 

You haven't stated the goal for this so other options could include sending csv 
or json data down to the browser and using jquery, angular or some other JS 
framework to manipulate that data may also be an option


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

Thanks for the message and help,
because I use jQuery autocomplete which has performance issue for thousands 
records due to network load data.
I want to load the data to local table to resolve performance issue, if it 
possible I can load to an array in the memory.


Thanks again for helping,

Regards,

iccsi,

Bastien  wrote in message 
news:2fd3037d-f68d-47b3-ac4f-007d9559d...@gmail.com...




Thanks,

Bastien


On Sep 28, 2013, at 3:24 PM, iccsi inu...@gmail.com wrote:

I need create a local table on the local machine.
I would like to know is it possible to down on server side or client side 
or jQuery to do the work.

Your information and help is great appreciated,

regards,


Iccsi


If you're looking to create a SQl table then most but not all browsers can 
use SQLite locally for data storage ( it does require newer browsers).


You haven't stated the goal for this so other options could include sending 
csv or json data down to the browser and using jquery, angular or some other 
JS framework to manipulate that data may also be an option


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


 On Sep 28, 2013, at 6:00 PM, iccsi inu...@gmail.com wrote:
 
 Thanks for the message and help,
 because I use jQuery autocomplete which has performance issue for thousands 
 records due to network load data.
 I want to load the data to local table to resolve performance issue, if it 
 possible I can load to an array in the memory.
 
 Thanks again for helping,
 
 Regards,
 
 iccsi,
 
 Bastien  wrote in message 
 news:2fd3037d-f68d-47b3-ac4f-007d9559d...@gmail.com...
 
 
 
 Thanks,
 
 Bastien
 
 On Sep 28, 2013, at 3:24 PM, iccsi inu...@gmail.com wrote:
 
 I need create a local table on the local machine.
 I would like to know is it possible to down on server side or client side or 
 jQuery to do the work.
 Your information and help is great appreciated,
 
 regards,
 
 
 Iccsi
 
 If you're looking to create a SQl table then most but not all browsers can 
 use SQLite locally for data storage ( it does require newer browsers).
 
 You haven't stated the goal for this so other options could include sending 
 csv or json data down to the browser and using jquery, angular or some other 
 JS framework to manipulate that data may also be an option
 

I had exactly this situation, large list with the autocomplete. I cached the 
list to a JS file and ran the autocomplete from that. It works well if the list 
is relatively static which mine was. It will be tougher if the list is dynamic, 
but you could send the data down after the initial page load. 

HTH

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

Thanks for the information and help,
Yes, my data is pretty much static,
Can you please give me some link for the solution?
It is the solution I am looking for my current situation,

Thanks a million for helping,

Regards,

Iccsi,

Bastien  wrote in message 
news:deb5dfe9-ec7f-4bc5-9e2e-acfb85039...@gmail.com...





On Sep 28, 2013, at 6:00 PM, iccsi inu...@gmail.com wrote:

Thanks for the message and help,
because I use jQuery autocomplete which has performance issue for 
thousands records due to network load data.
I want to load the data to local table to resolve performance issue, if it 
possible I can load to an array in the memory.


Thanks again for helping,

Regards,

iccsi,

Bastien  wrote in message 
news

php-general Digest 26 Sep 2013 14:49:48 -0000 Issue 8378

2013-09-26 Thread php-general-digest-help

php-general Digest 26 Sep 2013 14:49:48 - Issue 8378

Topics (messages 322177 through 322197):

PHP and curl
322177 by: Alf Stockton
322178 by: Shawn McKenzie
322181 by: Shawn McKenzie
322197 by: Shawn McKenzie

Re: php fopen https error
322179 by: Shawn McKenzie
322180 by: Shawn McKenzie
322182 by: Markus Falb
322183 by: Markus Falb
322184 by: Shawn McKenzie

https question
322185 by: Tedd Sperling
322186 by: Joshua Kehn
322187 by: Tedd Sperling
322188 by: Joshua Kehn
322189 by: Daniel Brown

Sending PHP mail with Authentication
322190 by: dealTek
322191 by: Aziz Saleh
322192 by: Camilo Sperberg
322193 by: Camilo Sperberg

PHPDoc way to describe the magic getter/setters [SOLVED]
322194 by: Daevid Vincent
322195 by: David Harkness

Re: Apache
322196 by: Robert Stone

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---
In an attempt to interface with a webservice on a Windows 7 server I 
have started writing the following:-

[code]
?php
$strTerminalname = CIS;
$version = 1.2;
$client = new 
SoapClient(http://192.168.0.10/CISWebService/Mediamanager.asmx?WSDL;);

var_dump($client-__getFunctions());
$result = 
$client-__doRequest(GetSequenceNo,$strTerminalname,$version, $one_way 
= 0);

?
[/code]
and I execute it via
php php-soap-web-service.php  test.txt
on my Ubuntu 13.04 laptop using php version Zend Engine v2.4.0
in return I get
array(20) {
  [0]=
  string(59) GetMediaListResponse GetMediaList(GetMediaList $parameters)
  [1]=
  string(68) GetMediaListAllResponse GetMediaListAll(GetMediaListAll 
$parameters)

  [2]=
  string(59) GetSoundListResponse GetSoundList(GetSoundList $parameters)
  [3]=
  string(77) GetTerminalDataXMLResponse 
GetTerminalDataXML(GetTerminalDataXML $parameters)

  [4]=
  string(59) GetRouterXmlResponse GetRouterXml(GetRouterXml $parameters)
  [5]=
  string(80) GetTerminalSoundXMLResponse 
GetTerminalSoundXML(GetTerminalSoundXML $parameters)

  [6]=
  string(62) SetSequenceNoResponse SetSequenceNo(SetSequenceNo 
$parameters)

  [7]=
  string(50) GetConfigResponse GetConfig(GetConfig $parameters)
  [8]=
  string(62) GetSequenceNoResponse GetSequenceNo(GetSequenceNo 
$parameters)

  [9]=
  string(95) UpdateClientMediaLogTimeResponse 
UpdateClientMediaLogTime(UpdateClientMediaLogTime $parameters)

  [10]=
  string(59) GetMediaListResponse GetMediaList(GetMediaList $parameters)
  [11]=
  string(68) GetMediaListAllResponse GetMediaListAll(GetMediaListAll 
$parameters)

  [12]=
  string(59) GetSoundListResponse GetSoundList(GetSoundList $parameters)
  [13]=
  string(77) GetTerminalDataXMLResponse 
GetTerminalDataXML(GetTerminalDataXML $parameters)

  [14]=
  string(59) GetRouterXmlResponse GetRouterXml(GetRouterXml $parameters)
  [15]=
  string(80) GetTerminalSoundXMLResponse 
GetTerminalSoundXML(GetTerminalSoundXML $parameters)

  [16]=
  string(62) SetSequenceNoResponse SetSequenceNo(SetSequenceNo 
$parameters)

  [17]=
  string(50) GetConfigResponse GetConfig(GetConfig $parameters)
  [18]=
  string(62) GetSequenceNoResponse GetSequenceNo(GetSequenceNo 
$parameters)

  [19]=
  string(95) UpdateClientMediaLogTimeResponse 
UpdateClientMediaLogTime(UpdateClientMediaLogTime $parameters)

}

now this is all great but my question is how do I call each of these 
functions with parameters.
The call I immediately need to make is to GetSequenceNo() which requires 
a parameter of CIS in my current configuration.

How do I do this ? Obviously $client-__doRequest is not the way to go.

--

Regards,
Alf Stockton  www.stockton.co.za

---End Message---
---BeginMessage---
SOAP functions can be called as methods of the SoapClient object.  Maybe:

$client-GetSequenceNo( $parameters );

-Shawn


On Wed, Sep 25, 2013 at 9:17 AM, Alf Stockton a...@stockton.co.za wrote:

 In an attempt to interface with a webservice on a Windows 7 server I have
 started writing the following:-
 [code]
 ?php
 $strTerminalname = CIS;
 $version = 1.2;
 $client = new SoapClient(http://192.168.0.**
 10/CISWebService/Mediamanager.**asmx?WSDLhttp://192.168.0.10/CISWebService/Mediamanager.asmx?WSDL
 );
 var_dump($client-__**getFunctions());
 $result = 
 $client-__doRequest(**GetSequenceNo,$**strTerminalname,$version,
 $one_way = 0);
 ?
 [/code]
 and I execute it via
 php php-soap-web-service.php  test.txt
 on my Ubuntu 13.04 laptop using php version Zend Engine v2.4.0
 in return I get
 array(20) {
   [0]=
   string(59) GetMediaListResponse GetMediaList(GetMediaList $parameters)
   [1]=
   string(68

php-general Digest 27 Sep 2013 04:56:29 -0000 Issue 8379

2013-09-26 Thread php-general-digest-help

php-general Digest 27 Sep 2013 04:56:29 - Issue 8379

Topics (messages 322198 through 322199):

Re: Sending PHP mail with Authentication
322198 by: Maciek Sokolewicz

How to capture uploaded file data
322199 by: Mariusz Drozdowski

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 25-9-2013 22:11, dealTek wrote:

Hi All,

Semi newbie email question...

I have used the - mail() — Send mail php function to send email from a site.

now it seems the server is blocking this for safety because I should be using 
authentication

Q: mail() does not have authentication - correct?

Q: So I read from the link below that maybe I should use - PEAR Mail package 
 is this a good choice to send mail with authentication?

...any suggestions for basic sending email with authentication (setup info and 
links also) would be welcome


http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

--
Thanks,
Dave - DealTek
deal...@gmail.com
[db-3]



I'm sure I'm going to annoy people with this, but I would advise to 
never use PEAR. It's the biggest load of extremely badly coded PHP 
you'll ever find. Creating an SMTP client (with the purpose of just 
sending mail) is very easy to do yourself (and also a good challenge if 
you're not yet very skilled with PHP). Alternatively, you can indeed use 
a package such as PHPMailer; it's not perfect, and quite bloated for 
what you want probably, but it works rather well.


- Tul
---End Message---
---BeginMessage---
Hi all php experts,

I would like to ask you all a question, I hope this is the right place
to ask it.

I'm writing a PHP extension now in c/c++. User uploads a file (could be POST
or PUT method, but I can limit it to POST only). I need to capture the
file data while being
uploaded, without writing it to disk on the server. I need to process
the data and (maybe,
depending on a situation) send it somewhere else or save it to disk.
Of course I know, that I can process the file
after it has been uploaded (saved on disk on the server), but I would
like to avoid it.
I also need to do something opposite: I need to generate a file on the
fly and send it
to the user. All metadata of the generated file is known beforehand
(e.g. size, name).

I've been searching around for some time now and I could not find
anything even close to the solution.
Is there any example(s) or existing PHP extension that do(es) something
like this (at least something simmilar) ?
If you could give me any pointers that would be awesome.

Thanks for your help in advance.

Mariusz

---End Message---


php-general Digest 25 Sep 2013 14:09:46 -0000 Issue 8377

2013-09-25 Thread php-general-digest-help

php-general Digest 25 Sep 2013 14:09:46 - Issue 8377

Topics (messages 322176 through 322176):

php fopen https error
322176 by: Markus Falb

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---
With RHEL/CentOS 5 php I get an SSL Error
RHEL/CentOS 5 php is at 5.1.6 with security fixes backported.

?php
 $handle = fopen(https://maps.google.com;, r);
 $contents = stream_get_contents($handle);
 fclose($handle);
?

will result in something like

Warning: stream_get_contents(): SSL: fatal protocol error in bla.php on
line 3

Some https pages do not raise this error, e.g. https://www.redhat.com is
fine
What is wrong? How to debug? How to resolve? How to mitigate?

Thanks
-- 
Markus Falb
---End Message---


php-general Digest 24 Sep 2013 10:38:18 -0000 Issue 8375

2013-09-24 Thread php-general-digest-help

php-general Digest 24 Sep 2013 10:38:18 - Issue 8375

Topics (messages 322160 through 322170):

Re: No MIME-Type in imap_fetch_overview()
322160 by: Negin Nickparsa
322161 by: Negin Nickparsa
322166 by: Aziz Saleh
322168 by: Domain nikha.org
322169 by: Domain nikha.org

Re: Apache
322162 by: Domain nikha.org
322165 by: Ashley Sheridan
322167 by: Tamara Temple
322170 by: Arno Kuhl

Re: filesize() fails on file and works on it's copy (same permissions, same 
directory)
322163 by: Michał Kochanowicz
322164 by: Michał Kochanowicz

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---
I have read your mail twice and still I could not get what you want
exactly.  can't get the structure of the email either although you
elaborate it in details.

you have said something about human rights that I couldn't understand why?
but if you want to get the type of files fetch the structure and then you
can use disposition string, find the attachment and then return the
array.




Sincerely
Negin Nickparsa


On Wed, Sep 18, 2013 at 3:27 PM, Domain nikha.org m...@nikha.org wrote:

 Hello all,

 im posting this here, because the bug report system of php.net is not
 right
 place for my problem. It's not a bug, but a wish - an I found there no
 wishlist option at all.

 I'm running my own webmail-client, written in PHP. It is stable, fast and
 pretty, showing the full power of the PHP imap section.

 Of course it presents paginated content lists for every mailbox the user
 may
 open. These lists tell him some usefull things about every mail actually
 listed:
 Sender, date, subject, size and (eventually) flags.

 All these things are nicely delivered by the function
 imap_fetch_overview()
 The same could be done by calling imap_headerinfo() for every single
 mail, but
 fetch_overview seems to be faster, because it does it at once for the
 whole
 batch.

 BUT NONE OF THEM returns any information about the MIME-Type of the mail!

 Since the user of my webmail client has the intrinsic, natural born an
 general
 human right to KNOW whether some mail in his mailbox has attachments or
 not, I'm
 forced to do very ugly things. My script calls additionally for every (!)
 actually listed mail  imap_fetchbody($connect, $msg_no, 0) - where
 $connect
 holds the result of imap_open().

 That gives me the mail header, the script reads the line starting with
 Content-Type: and returns its content. Evaluating this against mixed or
 alternative we have finaly what we want: This mail has attachments! Or is
 written in HTML, what is even more we wanted!

 Works fine, but is ugly. First fetch_overview parses all mail headers,
 then
 they are fetched again to be parsed for the MIME-Type. I could just omit
 fetch_overview and read the headers by my own means, that whould be
 faster,
 but then I loose the size information, that is NOT (and cannot) be part of
 the
 mail header!

 If I want to have both, size and MIME-Type, and I WANT to have both,
 respecting
 the intrinsic, natural born and general human rights of my user, im must
 call
 both, overview and fetchbody.

 My question is this: Is there a better solution? Or is there someone that
 knows
 someone among the PHP-Developpers to suggest them an improvement of the
 functions imap_fetch_overivew() and imap_headerinfo(). Please, Please,
 add
 the MIME-Type to your fantastic object collections! BTW: It's really easy.
 Read
 the Content-Type-Line! Sorry...

 Hope, somebody has an idea,
 my regards,

 Niklaus









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


---End Message---
---BeginMessage---
I have read your mail twice and still I could not get what you want
exactly.  can't get the structure of the email either although you
elaborate it in details.

you have said something about human rights that I couldn't understand why?
but if you want to get the type of files fetch the structure and then you
can use disposition string, find the attachment and then return the
array.




Sincerely
Negin Nickparsa


On Wed, Sep 18, 2013 at 3:27 PM, Domain nikha.org m...@nikha.org wrote:

 Hello all,

 im posting this here, because the bug report system of php.net is not
 right
 place for my problem. It's not a bug, but a wish - an I found there no
 wishlist option at all.

 I'm running my own webmail-client, written in PHP. It is stable, fast and
 pretty, showing the full power of the PHP imap section.

 Of course it presents paginated content lists for every mailbox the user
 may
 open. These lists tell him some usefull things about every mail actually
 listed

php-general Digest 24 Sep 2013 22:58:33 -0000 Issue 8376

2013-09-24 Thread php-general-digest-help

php-general Digest 24 Sep 2013 22:58:33 - Issue 8376

Topics (messages 322171 through 322175):

Re: Apache
322171 by: Domain nikha.org
322172 by: Domain nikha.org
322173 by: Ashley Sheridan
322174 by: Domain nikha.org
322175 by: Ashley Sheridan

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---
Ashley Sheridan am Montag, 23. September 2013 - 21:35:

 No, no, no! That is not a good stand-in for fundamental security
 principles!
 
 This is a better method for ensuring an image is really an image:
 
 ?php
 if(isset($_FILES['file']))
 {
   list($width, $height) = getimagesize($_FILES['file']['tmp_name']);
   if($width  $height)
   {
   $source = imagecreatefromjpeg($_FILES['file']['tmp_name']);
   $dest = imagecreatetruecolor($width, $height);
   
   imagecopyresampled($dest, $source,
   0, 0, 0, 0,
   $width, $height, $width, $height);
   imagejpeg($dest, basename($_FILES['file']['tmp_name']));
   }
   else
   echo {$_FILES['file']['name']} is not a jpeg;
 }
 ?
 form enctype=multipart/form-data method=post
   input type=file name=file/
   input type=submit name=submit value=submit/
 /form
 
 Obviously it's only rough, and checks only for jpeg images, but
that's
 easy to alter. I've just tested this with a regular jpeg, the same
jpeg
 with PHP code concatenated onto the end (which still appears to be a
 valid image to viewing/editing software) and a pure PHP file with a
.jpg
 extension. In the case of the first 2, a new jpeg is generated with
the
 same image and without the code. The third example just echoes out an
 error.
 

Dear Ashley, nice, but useless for this problem!

First, because users may upload other things than images! PDF's, audio
files, videos etc! And on behalf images: GD you are using handles only
jpeg, gif and png. There are about hunderd other image types on the way,
users can upload! How to detect them, if the extension is missleading?

And even if we succeed: As your script demonstrates very well, malicious
code does not affect the rendering of the image. The hacker says: Hi,
this is a nice picture, play it, and then, please do this--follows his
code, that can be a desaster for the whole system.

Yes, your script seems to purge the image file, simply because GD does
not copy the malware code. But why are you sure about that? You cannot
see that code, OK, but may be it was executed in the plain GD
environement? What you are doing is dangerous, because you force the
execution of things that should be never executed!

no no no forget it. After all we cannot exclude that users come in
with malware. But we MUST exclude, it is executed on the web server.
That is the Apache chainsaw massacre as Steward whould say. And probably
it can be avoided by purging the filenames (not the files!). 

Nevertheless, the standard configuration of the Apache servers is
basically unacceptable. It must execute user requests and never ever
user files! Period.

Have nice days,
Niklaus 
---End Message---
---BeginMessage---
Tamara Temple am Montag, 23. September 2013 - 22:38:
 
 On Sep 23, 2013, at 1:36 PM, Domain nikha.org m...@nikha.org wrote:
 
  Better solutions?
 
 One I have used, and continue to use in Apache environments, is place
uploads only in a place where they cannot be executed by turning off
such options and handlers in that directory. This is *in addition* to
untainting files and names of uploaded files.

Good idea. I will do this right now

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


Domain nikha.org m...@nikha.org wrote:
Ashley Sheridan am Montag, 23. September 2013 - 21:35:

 No, no, no! That is not a good stand-in for fundamental security
 principles!
 
 This is a better method for ensuring an image is really an image:
 
 ?php
 if(isset($_FILES['file']))
 {
  list($width, $height) = getimagesize($_FILES['file']['tmp_name']);
  if($width  $height)
  {
  $source = imagecreatefromjpeg($_FILES['file']['tmp_name']);
  $dest = imagecreatetruecolor($width, $height);
  
  imagecopyresampled($dest, $source,
  0, 0, 0, 0,
  $width, $height, $width, $height);
  imagejpeg($dest, basename($_FILES['file']['tmp_name']));
  }
  else
  echo {$_FILES['file']['name']} is not a jpeg;
 }
 ?
 form enctype=multipart/form-data method=post
  input type=file name=file/
  input type=submit name=submit value=submit/
 /form
 
 Obviously it's only rough, and checks only for jpeg images, but
that's
 easy to alter. I've just tested

php-general Digest 23 Sep 2013 18:36:21 -0000 Issue 8374

2013-09-23 Thread php-general-digest-help

php-general Digest 23 Sep 2013 18:36:21 - Issue 8374

Topics (messages 322149 through 322159):

Re: filesize() fails on file and works on it's copy (same permissions, same 
directory)
322149 by: Negin Nickparsa
322150 by: Carsten Jensen
322158 by: Tamara Temple

Re: Apache
322151 by: Domain nikha.org
322152 by: Tim Streater
322153 by: Stuart Dallas
322159 by: Domain nikha.org

Re: Friday's Question
322154 by: Eric K. Dickinson

Problem with mbstring.internal_encoding, mcrypt and php-fpm
322155 by: Condor
322156 by: Aziz Saleh
322157 by: Condor

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---
regardless of you, saying they have same permissions I think they do not
have the same permission

try to use --reference for chmod to see if there is any differences

try to copy the file keeping the whole permissions from original using sudo
cp -rp and check.
if this copy has the warning then your problem is from the permissions.


Sincerely
Negin Nickparsa


On Tue, Aug 13, 2013 at 11:30 AM, Michał Kochanowicz
mic...@michal.waw.plwrote:

 Hello

 I've got a file, which can't be checked with filesize(). I copy it (with
 permissions) and then I can filesize() the copy. This is same directory,
 permissions are same. I don't understand what's the difference. Can you
 help me?

 Original file:
   File: 'DSC_5196_fx-1553725666.JPG'
   Size: 1907383 Blocks: 3728   IO Block: 4096   regular file
 Device: 803h/2051d  Inode: 5905591363  Links: 1
 Access: (0644/-rw-r--r--)  Uid: (   51/http)   Gid: (   51/http)
 Access: 2013-08-13 00:47:28.107477918 +0200
 Modify: 2013-08-12 21:38:27.219913208 +0200
 Change: 2013-08-13 00:47:08.931478654 +0200
  Birth: -

 Copy:
   File: 'DSC_5196_fx-1553725666_X.JPG'
   Size: 1907383 Blocks: 3728   IO Block: 4096   regular file
 Device: 803h/2051d  Inode: 144 Links: 1
 Access: (0644/-rw-r--r--)  Uid: (   51/http)   Gid: (   51/http)
 Access: 2013-08-13 00:45:48.0 +0200
 Modify: 2013-08-12 21:38:27.0 +0200
 Change: 2013-08-13 00:47:28.199477914 +0200
  Birth: -

 The only difference is inode: (5905591363 - doesn't work vs 144 - does
 work).

 Test script:

 html
 body
 pre
 ?
 $f3 = '/home/services/httpd/html.**galeria.XXX/gallery/var/**
 albums/988_Rok-2013/333_**Rydzewo-04-06.08.2013/Sobota/**
 DSC_5196_fx-1553725666.JPG';
 $f4 = '/home/services/httpd/html.**galeria.XXX/gallery/var/**
 albums/988_Rok-2013/333_**Rydzewo-04-06.08.2013/Sobota/**
 DSC_5196_fx-1553725666_X.JPG';

 print $f3.: .filesize($f3).\n;
 print $f4.: .filesize($f4).\n;

 ?
 /pre
 /body
 /html

 Result:

 Warning: filesize(): stat failed for /home/services/httpd/html.**
 galeria.XXX/gallery/var/**albums/988_Rok-2013/333_**
 Rydzewo-04-06.08.2013/Sobota/**DSC_5196_fx-1553725666.JPG in
 /home/services/httpd/html.**galeria.michal.waw.pl/**
 gallery3-3.0.x/test.phphttp://html.galeria.michal.waw.pl/gallery3-3.0.x/test.phpon
  line 13
 /home/services/httpd/html.**galeria.XXX/gallery/var/**
 albums/988_Rok-2013/333_**Rydzewo-04-06.08.2013/Sobota/**DSC_5196_fx-1553725666.JPG:

 /home/services/httpd/html.**galeria.XXX/gallery/var/**
 albums/988_Rok-2013/333_**Rydzewo-04-06.08.2013/Sobota/**DSC_5196_fx-1553725666_X.JPG:
 1907383

 Regards
 Michał

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


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

if you have console access and the cli version of php works,
what does

echo filesize('/path/to/file');

tell (try running as root, then later as uid 51/webuser)
this will eliminate permission doubts

also you should use ?php as start tag instead of only ?

cheers
Carsten


On 09/23/2013 10:06 AM, Negin Nickparsa wrote:

regardless of you, saying they have same permissions I think they do not
have the same permission

try to use --reference for chmod to see if there is any differences

try to copy the file keeping the whole permissions from original using sudo
cp -rp and check.
if this copy has the warning then your problem is from the permissions.


Sincerely
Negin Nickparsa


On Tue, Aug 13, 2013 at 11:30 AM, Michał Kochanowicz
mic...@michal.waw.plwrote:


Hello

I've got a file, which can't be checked with filesize(). I copy it (with
permissions) and then I can filesize() the copy. This is same directory,
permissions are same. I don't understand what's the difference. Can you
help me?

Original file:
   File: 'DSC_5196_fx-1553725666.JPG'
   Size: 1907383 Blocks: 3728   IO Block: 4096   regular file
Device: 803h/2051d  Inode: 5905591363  Links: 1
Access: (0644/-rw-r--r

php-general Digest 22 Sep 2013 13:12:45 -0000 Issue 8372

2013-09-22 Thread php-general-digest-help

php-general Digest 22 Sep 2013 13:12:45 - Issue 8372

Topics (messages 322142 through 322143):

Re: jquery fill select option value
322142 by: Ashley Sheridan
322143 by: Jim Giner

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---


iccsi inu...@gmail.com wrote:
select id=mark name=mark
  option value=--/option
  option value=bmwBMW/option
  option value=audiAudi/option
/select

I use above code to have my select drop down on the form and would like
to 
use jQuery to fill option value on change event.
I would like know is it possible to do, if yes, any hint or example
code at 
server site is appreciated,

Your help and information is great appreciated,

Regards,

Iccsi, 

Yes it is possible but a) not at server side because JavaScript is run on the 
browser, and b) this is a PHP list not a JavaScript list.

Saying that, why aren't you populating it on the server side with PHP? 

Thanks,
Ash
---End Message---
---BeginMessage---

On 9/22/2013 3:52 AM, Ashley Sheridan wrote:



iccsi inu...@gmail.com wrote:

select id=mark name=mark
  option value=--/option
  option value=bmwBMW/option
  option value=audiAudi/option
/select

I use above code to have my select drop down on the form and would like
to
use jQuery to fill option value on change event.
I would like know is it possible to do, if yes, any hint or example
code at
server site is appreciated,

Your help and information is great appreciated,

Regards,

Iccsi,


Yes it is possible but a) not at server side because JavaScript is run on the 
browser, and b) this is a PHP list not a JavaScript list.

Saying that, why aren't you populating it on the server side with PHP?

Thanks,
Ash

Not sure what you are asking.  With PHP it is possible to have a specifi 
item from the options selected in the drop down when the page is loaded. 
 With JS it is possible to capture the newly selected option value and 
place it in another field, if that is what you want.  Obviously when the 
user clicks on an option, that value IS placed in the select tag for 
processing at the server side by PHP on submit.


So what is it you want to accomplish?
---End Message---


php-general Digest 23 Sep 2013 04:49:40 -0000 Issue 8373

2013-09-22 Thread php-general-digest-help

php-general Digest 23 Sep 2013 04:49:40 - Issue 8373

Topics (messages 322144 through 322148):

Re: jquery fill select option value
322144 by: Tedd Sperling
322145 by: Jim Giner
322146 by: Tedd Sperling

Re: Friday's Question
322147 by: Jonesy

Re: Apache's PHP handlers
322148 by: Tamara Temple

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 Sep 21, 2013, at 9:06 PM, iccsi inu...@gmail.com wrote:
 select id=mark name=mark
 option value=--/option
 option value=bmwBMW/option
 option value=audiAudi/option
 /select
 
 I use above code to have my select drop down on the form and would like to 
 use jQuery to fill option value on change event.
 I would like know is it possible to do, if yes, any hint or example code at 
 server site is appreciated,
 
 Your help and information is great appreciated,

While jQuery is great, you don't need jQuery for this -- a simple AJAX routine 
will do what you want. Here's an example:

http://php1.net/a/zipcode-states/

The ajax routine is there -- you can copy it.

The HTML is there -- you can copy that too.

The php script is a simple script that is triggered by an ajax script 
(triggered by the user via onchange() ) that then pulls whatever data is needed 
to populate the remaining option controls via a GET.

HTH's 

tedd

___
tedd sperling
tedd.sperl...@gmail.com


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

On 9/22/2013 12:04 PM, Tedd Sperling wrote:

On Sep 21, 2013, at 9:06 PM, iccsi inu...@gmail.com wrote:

select id=mark name=mark
option value=--/option
option value=bmwBMW/option
option value=audiAudi/option
/select

I use above code to have my select drop down on the form and would like to use 
jQuery to fill option value on change event.
I would like know is it possible to do, if yes, any hint or example code at 
server site is appreciated,

Your help and information is great appreciated,


While jQuery is great, you don't need jQuery for this -- a simple AJAX routine 
will do what you want. Here's an example:

http://php1.net/a/zipcode-states/

The ajax routine is there -- you can copy it.

The HTML is there -- you can copy that too.

The php script is a simple script that is triggered by an ajax script 
(triggered by the user via onchange() ) that then pulls whatever data is needed 
to populate the remaining option controls via a GET.

HTH's

tedd

___
tedd sperling
tedd.sperl...@gmail.com


OH!!! So you want to populate another(!) select box after the user makes 
his first selection.  You didn't say that.


Yes - ajax call would be just what you want to do.
---End Message---
---BeginMessage---

On Sep 22, 2013, at 12:47 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

 On 9/22/2013 12:04 PM, Tedd Sperling wrote:
 On Sep 21, 2013, at 9:06 PM, iccsi inu...@gmail.com wrote:
 select id=mark name=mark
 option value=--/option
 option value=bmwBMW/option
 option value=audiAudi/option
 /select
 
 I use above code to have my select drop down on the form and would like to 
 use jQuery to fill option value on change event.
 I would like know is it possible to do, if yes, any hint or example code at 
 server site is appreciated,
 
 Your help and information is great appreciated,
 
 While jQuery is great, you don't need jQuery for this -- a simple AJAX 
 routine will do what you want. Here's an example:
 
 http://php1.net/a/zipcode-states/
 
 The ajax routine is there -- you can copy it.
 
 The HTML is there -- you can copy that too.
 
 The php script is a simple script that is triggered by an ajax script 
 (triggered by the user via onchange() ) that then pulls whatever data is 
 needed to populate the remaining option controls via a GET.
 
 HTH's
 
 tedd
 
 
 OH!!! So you want to populate another(!) select box after the user makes his 
 first selection.  You didn't say that.


Well... not meaning to disagree -- but he did say:

 I use above code to have my select drop down on the form and would like to 
 use jQuery to fill option value on change event.


I took that to mean fill another option control. Why would one want to change 
the values of the current one?

tedd

___
tedd sperling
tedd.sperl...@gmail.com

---End Message---
---BeginMessage---
On Fri, 20 Sep 2013 12:51:49 -0400, Tedd Sperling wrote:

 Do you use a Mousepad?

Age: 70
Mousepad: No.  Been using trackballs since 1993...
(No room for a mousepad on _my_ desktop!)

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

On Sep 19, 2013, at 9:14 AM, Arno Kuhl a...@dotcontent.net wrote:

 Arno: If you can request that file using a web browser, and it gets executed
 as PHP on your server then there is an error in the Apache configuration.
 
 Easy test

php-general Digest 21 Sep 2013 11:22:55 -0000 Issue 8370

2013-09-21 Thread php-general-digest-help

php-general Digest 21 Sep 2013 11:22:55 - Issue 8370

Topics (messages 322126 through 322140):

Re: Friday's Question
322126 by: Jen Rasmussen
322127 by: Joshua Kehn
322128 by: Larry Martell
322129 by: Matijn Woudt
322130 by: Camilo Sperberg
322132 by: Tedd Sperling
322133 by: Mattias Thorslund
322134 by: Curtis Maurand
322135 by: Bastien
322136 by: Tim Streater
322137 by: Tim Streater
322138 by: Simon J Welsh
322139 by: Daniel
322140 by: Ashley Sheridan

Re: php-general Digest 20 Sep 2013 17:33:26 - Issue 8369
322131 by: Bill Guion

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---


-Original Message-
From: larry.mart...@gmail.com [mailto:larry.mart...@gmail.com] On Behalf Of 
Larry Martell
Sent: Friday, September 20, 2013 12:26 PM
To: j...@cetaceasound.com
Cc: Tedd Sperling; PHP General
Subject: Re: [PHP] Friday's Question

On Fri, Sep 20, 2013 at 11:20 AM, Jen Rasmussen j...@cetaceasound.com wrote:
 -Original Message-
 What in the heck is a Bag Bomb?

It's a salve for cow udders. Not sure what a person would do with it.


Ha! Interesting. Thanks :)

---End Message---
---BeginMessage---
On Sep 20, 2013, at 1:26 PM, Larry Martell la...@software-horizons.com wrote:

 On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn josh.k...@gmail.com wrote:
 
 
 Slightly snobbish solution: Don't use windows.
 
 Unfortunately required to VPN into most of my clients corporate networks.

Windows is required to VPN in? I'm guessing they use some proprietary client 
then? --jk---End Message---
---BeginMessage---
On Fri, Sep 20, 2013 at 11:35 AM, Joshua Kehn josh.k...@gmail.com wrote:
 On Sep 20, 2013, at 1:26 PM, Larry Martell la...@software-horizons.com 
 wrote:

 On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn josh.k...@gmail.com wrote:


 Slightly snobbish solution: Don't use windows.

 Unfortunately required to VPN into most of my clients corporate networks.

 Windows is required to VPN in? I'm guessing they use some proprietary client 
 then? --jk

Yes, and/or they validate the host ID, and/or there's some soft key
RSA thing involved.
---End Message---
---BeginMessage---
On Fri, Sep 20, 2013 at 6:51 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:

 Do you use a Mousepad?

 My reason for asking is that I've used a Mousepad ever since mice first
 came out (back when they had one ball).

 Now that mice are optical (no balls), Mousepads are not really needed --
 or so I'll told by the college -- you see, they don't provide Mousepads for
 their student's computers.

 As such, I wondered what's the percentage of programmers still using a
 Mousepad?

 Secondly, are Mousepads used primarily by older programmers (like me)
 while younger programmers don't use Mousepads, or what?

 So -- please respond with:

 Age: *
 Mousepad: Yes/No



Age: 21
Mouse: No, so why would I need a mousepad?
---End Message---
---BeginMessage---

On 20 sep. 2013, at 18:51, Tedd Sperling t...@sperling.com wrote:

 Hi gang:
 
 Do you use a Mousepad?
 
 My reason for asking is that I've used a Mousepad ever since mice first came 
 out (back when they had one ball).
 
 Now that mice are optical (no balls), Mousepads are not really needed -- or 
 so I'll told by the college -- you see, they don't provide Mousepads for 
 their student's computers.
 
 As such, I wondered what's the percentage of programmers still using a 
 Mousepad?
 
 Secondly, are Mousepads used primarily by older programmers (like me) while 
 younger programmers don't use Mousepads, or what?
 
 So -- please respond with:
 
 Age: *
 Mousepad: Yes/No
 
 Thank you,
 
 tedd
 
 PS: * If you don't want to provide your actual age, then indicate your age by 
 stating young, middle-age, old-age, ancient, or whatever term 
 describes your age.
 
 Alternate -- I claim that you can tell a man's age by ten-times the number of 
 personal products he routinely uses, for example:
 
 Years Old - Personal Products
 10Toothpaste
 20Toothpaste, Deodorant
 30Toothpaste, Deodorant, Aftershave
 40Toothpaste, Deodorant, Aftershave, Minoxidil
 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H
 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb
 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, 
 Fixodent
 
 So, you could indicate age by stating Bag Bomb like me.
 
 ___
 tedd sperling
 t...@sperling.com
 
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


Age: Aftershave (but I've began using it only a year

php-general Digest 22 Sep 2013 01:07:00 -0000 Issue 8371

2013-09-21 Thread php-general-digest-help

php-general Digest 22 Sep 2013 01:07:00 - Issue 8371

Topics (messages 322141 through 322141):

jquery fill select option value
322141 by: iccsi

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---

select id=mark name=mark
 option value=--/option
 option value=bmwBMW/option
 option value=audiAudi/option
/select

I use above code to have my select drop down on the form and would like to 
use jQuery to fill option value on change event.
I would like know is it possible to do, if yes, any hint or example code at 
server site is appreciated,


Your help and information is great appreciated,

Regards,

Iccsi, 

---End Message---


php-general Digest 20 Sep 2013 17:33:26 -0000 Issue 8369

2013-09-20 Thread php-general-digest-help

php-general Digest 20 Sep 2013 17:33:26 - Issue 8369

Topics (messages 322111 through 322125):

Friday's Question
322111 by: Tedd Sperling
322112 by: Larry Martell
322113 by: Aziz Saleh
322114 by: Daniel Brown
322115 by: Kirk.Johnson.zootweb.com
322116 by: Jeff Burcher
322117 by: Joshua Kehn
322119 by: Jen Rasmussen
322120 by: Larry Martell
322121 by: Joshua Kehn
322122 by: Larry Martell
322123 by: Larry Martell
322124 by: Daniel Brown
322125 by: Sean Greenslade

Re: Apache
322118 by: Domain nikha.org

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---
Hi gang:

Do you use a Mousepad?

My reason for asking is that I've used a Mousepad ever since mice first came 
out (back when they had one ball).

Now that mice are optical (no balls), Mousepads are not really needed -- or so 
I'll told by the college -- you see, they don't provide Mousepads for their 
student's computers.

As such, I wondered what's the percentage of programmers still using a Mousepad?

Secondly, are Mousepads used primarily by older programmers (like me) while 
younger programmers don't use Mousepads, or what?

So -- please respond with:

Age: *
Mousepad: Yes/No

Thank you,

tedd

PS: * If you don't want to provide your actual age, then indicate your age by 
stating young, middle-age, old-age, ancient, or whatever term describes 
your age.

Alternate -- I claim that you can tell a man's age by ten-times the number of 
personal products he routinely uses, for example:

Years Old   - Personal Products
10  Toothpaste
20  Toothpaste, Deodorant
30  Toothpaste, Deodorant, Aftershave
40  Toothpaste, Deodorant, Aftershave, Minoxidil
50  Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H
60  Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb
70  Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, 
Fixodent

So, you could indicate age by stating Bag Bomb like me.

___
tedd sperling
t...@sperling.com





---End Message---
---BeginMessage---
On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 Do you use a Mousepad?

 My reason for asking is that I've used a Mousepad ever since mice first came 
 out (back when they had one ball).

 Now that mice are optical (no balls), Mousepads are not really needed -- or 
 so I'll told by the college -- you see, they don't provide Mousepads for 
 their student's computers.

 As such, I wondered what's the percentage of programmers still using a 
 Mousepad?

 Secondly, are Mousepads used primarily by older programmers (like me) while 
 younger programmers don't use Mousepads, or what?

 So -- please respond with:

 Age: *
 Mousepad: Yes/No

54 Yes
---End Message---
---BeginMessage---
Haha, like your product usage chart Tedd,

Age: 31
Mousepad: Webster New Dictionary of Synonyms, too lazy of having to go to
Microcenter and buy one!

Aziz


On Fri, Sep 20, 2013 at 12:58 PM, Larry Martell la...@software-horizons.com
 wrote:

 On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling t...@sperling.com wrote:
  Hi gang:
 
  Do you use a Mousepad?
 
  My reason for asking is that I've used a Mousepad ever since mice first
 came out (back when they had one ball).
 
  Now that mice are optical (no balls), Mousepads are not really needed --
 or so I'll told by the college -- you see, they don't provide Mousepads for
 their student's computers.
 
  As such, I wondered what's the percentage of programmers still using a
 Mousepad?
 
  Secondly, are Mousepads used primarily by older programmers (like me)
 while younger programmers don't use Mousepads, or what?
 
  So -- please respond with:
 
  Age: *
  Mousepad: Yes/No

 54 Yes

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


---End Message---
---BeginMessage---
On Fri, Sep 20, 2013 at 12:51 PM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 Do you use a Mousepad?

I'm in my mid-thirties and - despite having an optical mouse - I
do indeed still use a mousepad.  A customized one that the wife did
for me for Christmas one year: images of Futurama, the Cleveland
Browns, Minnesota Vikings, and several aircraft, all surrounding a
picture of her and our daughter.  I've found that shiny surfaces -
such as my desk - reflect too much of the laser, causing the mouse to
be far less responsive.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/
---End Message---
---BeginMessage---
Tedd Sperling t...@sperling.com wrote on 09/20/2013 10:51:49 AM:

 Do you use a Mousepad

[PHP] Re: php-general Digest 20 Sep 2013 17:33:26 -0000 Issue 8369

2013-09-20 Thread Bill Guion

On Sep 20, 2013, at 1:33 PM, php-general-digest-h...@lists.php.net wrote:

 Friday's Question
   322111 by: Tedd Sperling
 --
 
 From: Tedd Sperling t...@sperling.com
 Subject: Friday's Question
 Date: September 20, 2013 12:51:49 PM EDT
 To: php-general@lists.php.net
 
 
 Hi gang:
 
 Do you use a Mousepad?
 
 My reason for asking is that I've used a Mousepad ever since mice first came 
 out (back when they had one ball).
 
 Now that mice are optical (no balls), Mousepads are not really needed -- or 
 so I'll told by the college -- you see, they don't provide Mousepads for 
 their student's computers.
 
 As such, I wondered what's the percentage of programmers still using a 
 Mousepad?
 
 Secondly, are Mousepads used primarily by older programmers (like me) while 
 younger programmers don't use Mousepads, or what?
 
 So -- please respond with:
 
 Age: *
 Mousepad: Yes/No
 
 Thank you,
 
 tedd
 
 PS: * If you don't want to provide your actual age, then indicate your age by 
 stating young, middle-age, old-age, ancient, or whatever term 
 describes your age.
 
 Alternate -- I claim that you can tell a man's age by ten-times the number of 
 personal products he routinely uses, for example:
 
 Years Old - Personal Products
 10Toothpaste
 20Toothpaste, Deodorant
 30Toothpaste, Deodorant, Aftershave
 40Toothpaste, Deodorant, Aftershave, Minoxidil
 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H
 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb
 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, 
 Fixodent
 
 So, you could indicate age by stating Bag Bomb like me.
 
 ___
 tedd sperling
 t...@sperling.com


Age: 72 years, 7 days  toothpaste, deodorant, aftershave. Don't need the rest, 
yet.
Mousepad: Yes. I find it easier to clean the mousepad than to try to clean the 
keyboard tray/desktop/whatever.


 -= Bill =-
-- 

A day without sunshine is like a day in Seattle.



php-general Digest 19 Sep 2013 11:35:54 -0000 Issue 8367

2013-09-19 Thread php-general-digest-help

php-general Digest 19 Sep 2013 11:35:54 - Issue 8367

Topics (messages 322083 through 322092):

Re: assign database result to iinput text box
322083 by: Maciek Sokolewicz
322091 by: ITN Network

Re: high traffic websites
322084 by: Negin Nickparsa
322086 by: Sebastian Krebs
322087 by: Stuart Dallas
322088 by: Negin Nickparsa
322089 by: Camilo Sperberg
322090 by: Sebastian Krebs

No MIME-Type in imap_fetch_overview()
322085 by: Domain nikha.org

Apache's PHP handlers
322092 by: Arno Kuhl

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 18-9-2013 7:33, iccsi wrote:

I have following html code to show my input text box and php to connect
server and select result from database server.
I would like to know how I can I use php to assign the value to my input
text.
Your help and information is great appreciated,

Regards,


Hi iccsi,

first, look at http://www.php.net/mysql_fetch_array the example should 
help you.


Once you have the value you're looking for in a variable, you simply 
assign insert it into the value property of your input element. Ie. you 
should have something like input type=text name=a id=b value=the 
variable containing your data


Also please note that the mysql extension is deprecated; you are advised 
to switch to either PDO_MySQL or mysqli instead.


- Tul
---End Message---
---BeginMessage---
?php
$username = root;
$password = myPassword;
$hostname = localhost;

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)  or die(Unable
to connect to MySQL);
echo Connected to MySQLbr;

//select a database to work with
$selected = mysql_select_db(iccsimd,$dbhandle)  or die(Could not select
aerver);

//execute the SQL query and return records
$result = mysql_fetch_assoc(mysql_query(SELECT invid, invdate, note,
amount FROM invheader));
?

INPUT type=text name=Mytxt id=MytextID value=?php echo
$result['note'];? /

Like Maciek mentioned, if this is a new project use PDO or MySQLi instead,
else use a PDO wrapper for MySQL functions.


On Wed, Sep 18, 2013 at 7:45 AM, Maciek Sokolewicz 
maciek.sokolew...@gmail.com wrote:

 On 18-9-2013 7:33, iccsi wrote:

 I have following html code to show my input text box and php to connect
 server and select result from database server.
 I would like to know how I can I use php to assign the value to my input
 text.
 Your help and information is great appreciated,

 Regards,


 Hi iccsi,

 first, look at 
 http://www.php.net/mysql_**fetch_arrayhttp://www.php.net/mysql_fetch_arraythe
  example should help you.

 Once you have the value you're looking for in a variable, you simply
 assign insert it into the value property of your input element. Ie. you
 should have something like input type=text name=a id=b value=the
 variable containing your data

 Also please note that the mysql extension is deprecated; you are advised
 to switch to either PDO_MySQL or mysqli instead.

 - Tul


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


---End Message---
---BeginMessage---
Thank you Camilo

to be more in details,suppose the website has 80,000 users and each page
takes 200 ms to be rendered and you have thousand hits in a second so we
want to reduce the time of rendering. is there any way to reduce the
rendering time?

other thing is suppose they want to upload files simultaneously and the
videos are in the website not on another server like YouTube and so streams
are really consuming the bandwidth.

Also,It is troublesome to get backups,when getting backups you have problem
of lock backing up with bulk of data.



Sincerely
Negin Nickparsa


On Wed, Sep 18, 2013 at 12:50 PM, Camilo Sperberg unrea...@gmail.comwrote:


 On Sep 18, 2013, at 09:38, Negin Nickparsa nickpa...@gmail.com wrote:

  Thank you Sebastian..actually I will already have one if qualified for
 the
  job. Yes, and I may fail to handle it that's why I asked for guidance.
  I wanted some tidbits to start over. I have searched through yslow,
  HTTtrack and others.
  I have searched through php list in my email too before asking this
  question. it is kind of beneficial for all people and not has been asked
  directly.
 
 
  Sincerely
  Negin Nickparsa
 
 
  On Wed, Sep 18, 2013 at 10:45 AM, Sebastian Krebs krebs@gmail.com
 wrote:
 
 
 
 
  2013/9/18 Negin Nickparsa nickpa...@gmail.com
 
  In general, what are the best ways to handle high traffic websites?
 
  VPS(clouds)?
  web analyzers?
  dedicated servers?
  distributed memory cache?
 
 
  Yes :)
 
  But seriously: That is a topic most of us spent much time to get

php-general Digest 20 Sep 2013 05:28:48 -0000 Issue 8368

2013-09-19 Thread php-general-digest-help

php-general Digest 20 Sep 2013 05:28:48 - Issue 8368

Topics (messages 322093 through 322110):

Re: Apache's PHP handlers
322093 by: Design in Motion Webdesign
322094 by: Arno Kuhl
322095 by: Arno Kuhl
322096 by: Design in Motion Webdesign
322097 by: Stuart Dallas
322098 by: Aziz Saleh
322099 by: Stuart Dallas
322100 by: Bastien Koert
322101 by: Arno Kuhl
322109 by: Ashley Sheridan

PHP 5.5.4 has been released
322102 by: Julien Pauli

Static methods vs. plain functions
322103 by: Simon Dániel
322105 by: Sebastian Krebs
322106 by: Aziz Saleh
322107 by: Paul M Foster
322108 by: Sebastian Krebs

Re: high traffic websites
322104 by: Negin Nickparsa

PHP 5.4.20 released!
322110 by: Stas Malyshev

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---
- Original Message - 
From: Arno Kuhl a...@dotcontent.net

To: php-gene...@lists.php.net
Sent: Thursday, September 19, 2013 1:35 PM
Subject: [PHP] Apache's PHP handlers



For the past week I've been trying to get to the bottom of an exploit, but
googling hasn't been much help so far, nor has my service provider.
Basically a file was uploaded with the filename xxx.php.pgif which 
contained

nasty php code, and then the file was run directly from a browser. The
upload script used to upload this file checks that the upload filename
doesn't have a .php extension, which in this case it doesn't, so let it
through. I was under the impression apache would serve any file with an
extension not listed in its handlers directly back to the browser, but
instead it sent it to the php handler. Is this normal behaviour or is 
there
a problem with my service provider's apache configuration? Trying this on 
my
localhost returns the file contents directly to the browser as expected 
and

doesn't run the php code.



Cheers

Arno



Arno,

the php file hidden as a gif will indeed not execute if opened directly from 
your website. But if opened from a page hosted elsewhere with some code like 
require($path_to_your_image), the php code inside the image will be sent to 
the php handler and will be executed.


Prevention is the best way to avoid hacking from image upload. Check the 
file extention and the file content before upload.


Cheers.
Steven 

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

-Original Message-
From: Ken Robinson [mailto:kenrb...@rbnsn.com] 
Sent: 19 September 2013 01:52 PM
To: a...@dotcontent.net
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] Apache's PHP handlers

Check you .htaccess file. The hackers could have modified it to allow that
type of file to be executed. I had some that modified my .htaccess file to
go to a spam site when my site got a 404 error. That was nasty. 

Ken

Sent from my iPad

On Sep 19, 2013, at 7:35 AM, Arno Kuhl a...@dotcontent.net wrote:

 For the past week I've been trying to get to the bottom of an exploit, 
 but googling hasn't been much help so far, nor has my service provider.
 Basically a file was uploaded with the filename xxx.php.pgif which 
 contained nasty php code, and then the file was run directly from a 
 browser. The upload script used to upload this file checks that the 
 upload filename doesn't have a .php extension, which in this case it 
 doesn't, so let it through. I was under the impression apache would 
 serve any file with an extension not listed in its handlers directly 
 back to the browser, but instead it sent it to the php handler. Is 
 this normal behaviour or is there a problem with my service provider's 
 apache configuration? Trying this on my localhost returns the file 
 contents directly to the browser as expected and doesn't run the php code.
 
 
 
 Cheers
 
 Arno
  S

Hi Ken, .htaccess wasn't modified, this file was just uploaded and run. So
far all my service provider has told me is it was because the filename
contained .php in the filename, even though it's not the extension, and
that's the reason apache sent it to the php handler.  I'm sure that can't be
right, otherwise it would be open to all sorts of exploits.

Cheers
Arno


---End Message---
---BeginMessage---
 For the past week I've been trying to get to the bottom of an exploit, but
 googling hasn't been much help so far, nor has my service provider.
 Basically a file was uploaded with the filename xxx.php.pgif which
contained
 nasty php code, and then the file was run directly from a browser. The
 upload script used to upload this file checks that the upload filename
 doesn't have a .php extension, which in this case it doesn't, so let it
 through. I was under the impression apache would serve

php-general Digest 18 Sep 2013 09:20:48 -0000 Issue 8366

2013-09-18 Thread php-general-digest-help

php-general Digest 18 Sep 2013 09:20:48 - Issue 8366

Topics (messages 322076 through 322082):

Re: Resolving a PHP Notice Error
322076 by: Daniel Brown
322077 by: Sebastian Krebs

assign database result to iinput text box
322078 by: iccsi

high traffic websites
322079 by: Negin Nickparsa
322080 by: Sebastian Krebs
322081 by: Negin Nickparsa
322082 by: Camilo Sperberg

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 Tue, Sep 17, 2013 at 3:38 PM, Ron Piggott
ron.pigg...@actsministries.org wrote:

 I am wanting to establish a default sort by preference when the user hasn’t 
 specified one.  I setup to test this with:

 ?php

 if ( !is_set( $sort_by_preference ) ) {

Did you create a function is_set(), or did you mean to use the
construct isset()?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/
---End Message---
---BeginMessage---
2013/9/17 Ron Piggott ron.pigg...@actsministries.org


 I am wanting to establish a default sort by preference when the user
 hasn’t specified one.  I setup to test this with:

 ?php

 if ( !is_set( $sort_by_preference ) ) {

 $sort_by_preference = government_wording;

 }

 ?

 But I am receiving a Notice error:

 Notice:  Undefined variable: sort_by_preference in GIFI_codes.php on line
 11- Line 11 is “if ( !is_set( $sort_by_preference ) ) {“What is the correct
 way to test this without triggering a Notice error?Ron
 Ron Piggott


Because actually you are looking for isset() (not is_set()).





 www.TheVerseOfTheDay.info




-- 
github.com/KingCrunch
---End Message---
---BeginMessage---
I have following html code to show my input text box and php to connect 
server and select result from database server.
I would like to know how I can I use php to assign the value to my input 
text.

Your help and information is great appreciated,

Regards,

Iccsi,

INPUT type=text name=Mytxt id=MytextID /


?php
$username = root;
$password = myPassword;
$hostname = localhost;

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
 or die(Unable to connect to MySQL);
echo Connected to MySQLbr;

//select a database to work with
$selected = mysql_select_db(iccsimd,$dbhandle)
 or die(Could not select aerver);

//execute the SQL query and return records
$result = mysql_query(SELECT invid, invdate, note, amount FROM invheader);

---End Message---
---BeginMessage---
In general, what are the best ways to handle high traffic websites?

VPS(clouds)?
web analyzers?
dedicated servers?
distributed memory cache?


Sincerely
Negin Nickparsa
---End Message---
---BeginMessage---
2013/9/18 Negin Nickparsa nickpa...@gmail.com

 In general, what are the best ways to handle high traffic websites?

 VPS(clouds)?
 web analyzers?
 dedicated servers?
 distributed memory cache?


Yes :)

But seriously: That is a topic most of us spent much time to get into it.
You can explain it with a bunch of buzzwords. Additional, how do you define
high traffic websites? Do you already _have_ such a site? Or do you
_want_ it? It's important, because I've seen it far too often, that
projects spent too much effort in their high traffic infrastructure and
at the end it wasn't that high traffic ;) I wont say, that you cannot be
successfull, but you should start with an effort you can handle.

Regards,
Sebastian




 Sincerely
 Negin Nickparsa




-- 
github.com/KingCrunch
---End Message---
---BeginMessage---
Thank you Sebastian..actually I will already have one if qualified for the
job. Yes, and I may fail to handle it that's why I asked for guidance.
I wanted some tidbits to start over. I have searched through yslow,
HTTtrack and others.
I have searched through php list in my email too before asking this
question. it is kind of beneficial for all people and not has been asked
directly.


Sincerely
Negin Nickparsa


On Wed, Sep 18, 2013 at 10:45 AM, Sebastian Krebs krebs@gmail.comwrote:




 2013/9/18 Negin Nickparsa nickpa...@gmail.com

 In general, what are the best ways to handle high traffic websites?

 VPS(clouds)?
 web analyzers?
 dedicated servers?
 distributed memory cache?


 Yes :)

 But seriously: That is a topic most of us spent much time to get into it.
 You can explain it with a bunch of buzzwords. Additional, how do you define
 high traffic websites? Do you already _have_ such a site? Or do you
 _want_ it? It's important, because I've seen it far too often, that
 projects spent too much effort in their high traffic infrastructure and
 at the end it wasn't that high traffic ;) I wont say, that you cannot be
 successfull, but you should start with an effort you can handle.

 Regards,
 Sebastian

php-general Digest 17 Sep 2013 19:38:29 -0000 Issue 8365

2013-09-17 Thread php-general-digest-help

php-general Digest 17 Sep 2013 19:38:29 - Issue 8365

Topics (messages 322075 through 322075):

Resolving a PHP Notice Error
322075 by: Ron Piggott

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---

I am wanting to establish a default sort by preference when the user hasn’t 
specified one.  I setup to test this with:

?php

if ( !is_set( $sort_by_preference ) ) {

$sort_by_preference = government_wording;

}

?

But I am receiving a Notice error:

Notice:  Undefined variable: sort_by_preference in GIFI_codes.php on line 11- 
Line 11 is “if ( !is_set( $sort_by_preference ) ) {“What is the correct way to 
test this without triggering a Notice error?Ron
Ron Piggott



www.TheVerseOfTheDay.info 
---End Message---


php-general Digest 15 Sep 2013 21:41:11 -0000 Issue 8364

2013-09-15 Thread php-general-digest-help

php-general Digest 15 Sep 2013 21:41:11 - Issue 8364

Topics (messages 322074 through 322074):

Re: PHP Dependency Injector
322074 by: marco.behnke.biz

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---
Hey Juan,

before sharing your work, you should spend some time on class and method
documentation and putting stuff into the readme ;)
This can be very helpful for others.

Regards,
Marco

 Juan Sebastian Scatularo sebastianscatul...@gmail.com hat am 5. September
 2013 um 22:30 geschrieben:


 Sorry guys if disturbed.


 2013/9/5 Bastien Koert phps...@gmail.com

  Jee, that should have been a friday comment...how does your dic standout
 
 
  On Thu, Sep 5, 2013 at 4:06 PM, Sorin Badea sorin.bade...@gmail.comwrote:
 
  There are few tutorials about home made dic. How does your dic stand out
  from the crowd ?
 
  Regards.
 
  On Thu, Sep 5, 2013 at 10:56 PM, Juan Sebastian Scatularo 
  sebastianscatul...@gmail.com wrote:
 
   Hello people, I want to share with you a simple and small Dependency
   Injector made for me.
  
   https://github.com/abloos/Sofia
  
   Regards
  
   --
   Facebook: www.facebook.com/JuanSebastianScatularo
   Twitter: www.twitter.com/js_scatularo
   Web: www.sebastianscatularo.com.ar
  
 
 
 
  --
  Sorin Badea - Software Engineer
 
 
 
 
  --
 
  Bastien
 
  Cat, the other other white meat
 



 --
 Facebook: www.facebook.com/JuanSebastianScatularo
 Twitter: www.twitter.com/js_scatularo
 Web: www.sebastianscatularo.com.ar

--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz
---End Message---


php-general Digest 14 Sep 2013 11:42:33 -0000 Issue 8363

2013-09-14 Thread php-general-digest-help

php-general Digest 14 Sep 2013 11:42:33 - Issue 8363

Topics (messages 322072 through 322073):

Re: Ini files for CLI only on non Win32 platform
322072 by: Kevin Kinsey
322073 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


--
---BeginMessage---
Date: Fri, 13 Sep 2013 11:40:27 +0100
From: Richard Quadling rquadl...@gmail.com
To: PHP General list php-gene...@lists.php.net
Subject: [PHP] Ini files for CLI only on non Win32 platform.

I've got an instance of PHP that is looking for additional ini files in
/etc/php.d

This seems to work well.

I now need to make one of the ini files only accessible if the SAPI is CGI.

So, I renamed the file ... mv /etc/php.d/my.ini /etc/php.d/my-cgi.ini

If I do a ...

php --ini

I still see the ini file.

Is the -SAPI filtering performed on the additional files?

It doesn't seem to and I can't really tell from the dox if it is supposed
to.

Shouldn't the file name be php-cgi.ini ?

Manual: If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for 
example, php-cli.ini or 
php-apache.ini), it is used instead of php.ini. The SAPI name can be determined 
with php_sapi_name().

I'm in CLI mode here; note that my-cli.ini is ignored but php-cli.ini
is not:

[1016] Fri 13.Sep.2013 13:52:05
[kadmin@freebsd-devel][/www/data/]
php --ini

Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:  /usr/local/etc/php/extensions.ini

[1017] Fri 13.Sep.2013 13:52:08
[kadmin@freebsd-devel][/www/data/]  
 
sudo touch /usr/local/etc/php-cgi.ini

[1018] Fri 13.Sep.2013 13:52:26
[kadmin@freebsd-devel][/www/data/]
sudo touch /usr/local/etc/php-cli.ini

[1019] Fri 13.Sep.2013 13:52:32
[kadmin@freebsd-devel][/www/data/]
sudo touch /usr/local/etc/my-cli.ini

[1020] Fri 13.Sep.2013 13:52:44
[kadmin@freebsd-devel][/www/data/]
php --ini

Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File: /usr/local/etc/php-cli.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:  /usr/local/etc/php/extensions.ini


I apologize if I'm missing the point or am obtuse or irrelevant;
I don't play with the INI files very often.

Kevin Kinsey
---End Message---
---BeginMessage---
On 13 September 2013 20:06, Kevin Kinsey k...@daleco.biz wrote:

 Date: Fri, 13 Sep 2013 11:40:27 +0100
 From: Richard Quadling rquadl...@gmail.com
 To: PHP General list php-gene...@lists.php.net
 Subject: [PHP] Ini files for CLI only on non Win32 platform.

 I've got an instance of PHP that is looking for additional ini files in
 /etc/php.d
 
 This seems to work well.
 
 I now need to make one of the ini files only accessible if the SAPI is
 CGI.
 
 So, I renamed the file ... mv /etc/php.d/my.ini /etc/php.d/my-cgi.ini
 
 If I do a ...
 
 php --ini
 
 I still see the ini file.
 
 Is the -SAPI filtering performed on the additional files?
 
 It doesn't seem to and I can't really tell from the dox if it is supposed
 to.

 Shouldn't the file name be php-cgi.ini ?

 Manual: If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for
 example, php-cli.ini or
 php-apache.ini), it is used instead of php.ini. The SAPI name can be
 determined with php_sapi_name().

 I'm in CLI mode here; note that my-cli.ini is ignored but php-cli.ini
 is not:

 [1016] Fri 13.Sep.2013 13:52:05
 [kadmin@freebsd-devel][/www/data/]
 php --ini

 Configuration File (php.ini) Path: /usr/local/etc
 Loaded Configuration File: /usr/local/etc/php.ini
 Scan for additional .ini files in: /usr/local/etc/php
 Additional .ini files parsed:  /usr/local/etc/php/extensions.ini

 [1017] Fri 13.Sep.2013 13:52:08
 [kadmin@freebsd-devel][/www/data/]
 sudo touch /usr/local/etc/php-cgi.ini

 [1018] Fri 13.Sep.2013 13:52:26
 [kadmin@freebsd-devel][/www/data/]
 sudo touch /usr/local/etc/php-cli.ini

 [1019] Fri 13.Sep.2013 13:52:32
 [kadmin@freebsd-devel][/www/data/]
 sudo touch /usr/local/etc/my-cli.ini

 [1020] Fri 13.Sep.2013 13:52:44
 [kadmin@freebsd-devel][/www/data/]
 php --ini

 Configuration File (php.ini) Path: /usr/local/etc
 Loaded Configuration File: /usr/local/etc/php-cli.ini
 Scan for additional .ini files in: /usr/local/etc/php
 Additional .ini files parsed:  /usr/local/etc/php/extensions.ini


 I apologize if I'm missing the point or am obtuse or irrelevant;
 I don't play with the INI files very often.

 Kevin Kinsey


Ah! Yes.

The main ini file can be php-sapi.ini and the code is going to look for the
sapi specific file before the non specific file.

If you

php-general Digest 13 Sep 2013 10:40:53 -0000 Issue 8362

2013-09-13 Thread php-general-digest-help

php-general Digest 13 Sep 2013 10:40:53 - Issue 8362

Topics (messages 322069 through 322071):

Re: PHP CLI setting cooked terminal mode
322069 by: Stuart Dallas
322070 by: Alain Williams

Ini files for CLI only on non Win32 platform.
322071 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


--
---BeginMessage---
On 11 Sep 2013, at 17:37, Alain Williams a...@phcomp.co.uk wrote:

 Hi,
 
 I am running a PHP script at the command line and piping the output through 
 less:
 
./myScript | less
 
 Since less is an interactive program it puts the terminal into 'raw' mode so
 that it can read characters one at a time. However, when I do the above I find
 that the commands that I type to less are echoed back to me and not acted on
 until I type RETURN. This is not as it should be.
 
 The sript is not doing anything really clever, just looking at a few files and
 printing out directory contents, time stamps, ...
 
 If I run the script under strace I see:
 
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
 ...}) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) 
 = 0
 
 
 I can get it to not do this by connect stdout to /dev/null:
 
./myScript  /dev/null | less
 
 another way of getting it to work is (and this shows that it really is PHP 
 that
 is messing the tty modes):
 
./myScript  /dev/null | (sleep 10;less)
 
 However: PHP should not set the terminal to cooked mode in the first place
 
 Is there any way in which I can get PHP to not do this ?
 
 TIA
 
 I am running PHP 5.3.3 on CentOS 6.

Make sure output buffering is off by putting this at the top of your script:

while(ob_end_clean());

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
---End Message---
---BeginMessage---
On Wed, Sep 11, 2013 at 05:45:45PM +0100, Stuart Dallas wrote:
 On 11 Sep 2013, at 17:37, Alain Williams a...@phcomp.co.uk wrote:

 Make sure output buffering is off by putting this at the top of your script:
 
 while(ob_end_clean());

Sorry, that does not fix the problem - but thanks for trying.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT 
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: 
http://www.phcomp.co.uk/contact.php
#include std_disclaimer.h
---End Message---
---BeginMessage---
Hi.

I've got an instance of PHP that is looking for additional ini files in
/etc/php.d

This seems to work well.

I now need to make one of the ini files only accessible if the SAPI is CGI.

So, I renamed the file ...

mv /etc/php.d/my.ini /etc/php.d/my-cgi.ini

If I do a ...

php --ini

I still see the ini file.

Is the -SAPI filtering performed on the additional files?

It doesn't seem to and I can't really tell from the dox if it is supposed
to.

Regards,

Richard.
-- 
Richard Quadling
---End Message---


php-general Digest 11 Sep 2013 16:37:45 -0000 Issue 8361

2013-09-11 Thread php-general-digest-help

php-general Digest 11 Sep 2013 16:37:45 - Issue 8361

Topics (messages 322066 through 322068):

Hey, I have a full time PHP developer position in Chicago!
322066 by: Steve Gadlin
322067 by: Matt Giddings

PHP CLI setting cooked terminal mode
322068 by: Alain Williams

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---
Howdy. My name is Steve, and I run the web department for Weigel
Broadcasting in Chicago. We're looking for a senior-level PHP developer to
add to our team.

This is a full time gig with benefits. As it's an in-house thing, we're
happy to meet with people outside Chicago if they're willing to relocate
for the job.

What do we need? Oh, just someone who's great with PHP. We need someone who
can decipher our existing homegrown CMS and work with frameworks like
Kohana and Wordpress.

We need a Jack or Jill of all trades... someone comfortable using SSH and
messing around from the Linux prompt, and someone comfortable learning a
new API. An understanding of advanced front-end coding would be swell...
but we have a front-end coder on staff, so a passing familiarity will
suffice.

You'll be building out websites with very large built-in audiences. This is
rewarding work for an amazing company. And your boss will be some guy who,
off hours, draws stick figure cats for people (
http://iwanttodrawacatforyou.com).

Thanks for reading, and I apologize for dropping into your PHP party to
simply spout ads at you. I promise to try and participate in some
meaningful way when I see an opening!

Interested? Know someone who's interested? Reach out to me directly (
st...@blewt.com) and we'll skip this whole resume nonsense.

Beans!

Steve Gadlin



-- 
Steve Gadlin
Blewt! LLC
312-77-BLEWT

http://iwanttodrawacatforyou.com/Steev.org - IWantToDrawACatForYou.com -
TwoFilmTShirts.com - Blewt.com

http://blewt.com
---End Message---
---BeginMessage---
Sorry I can't relocate at the time.  Thanks for sending me the notification
though.  : )

Matt


On Tue, Sep 10, 2013 at 10:41 AM, Steve Gadlin st...@blewt.com wrote:

 Howdy. My name is Steve, and I run the web department for Weigel
 Broadcasting in Chicago. We're looking for a senior-level PHP developer to
 add to our team.

 This is a full time gig with benefits. As it's an in-house thing, we're
 happy to meet with people outside Chicago if they're willing to relocate
 for the job.

 What do we need? Oh, just someone who's great with PHP. We need someone who
 can decipher our existing homegrown CMS and work with frameworks like
 Kohana and Wordpress.

 We need a Jack or Jill of all trades... someone comfortable using SSH and
 messing around from the Linux prompt, and someone comfortable learning a
 new API. An understanding of advanced front-end coding would be swell...
 but we have a front-end coder on staff, so a passing familiarity will
 suffice.

 You'll be building out websites with very large built-in audiences. This is
 rewarding work for an amazing company. And your boss will be some guy who,
 off hours, draws stick figure cats for people (
 http://iwanttodrawacatforyou.com).

 Thanks for reading, and I apologize for dropping into your PHP party to
 simply spout ads at you. I promise to try and participate in some
 meaningful way when I see an opening!

 Interested? Know someone who's interested? Reach out to me directly (
 st...@blewt.com) and we'll skip this whole resume nonsense.

 Beans!

 Steve Gadlin



 --
 Steve Gadlin
 Blewt! LLC
 312-77-BLEWT

 http://iwanttodrawacatforyou.com/Steev.org - IWantToDrawACatForYou.com -
 TwoFilmTShirts.com - Blewt.com

 http://blewt.com

---End Message---
---BeginMessage---
Hi,

I am running a PHP script at the command line and piping the output through 
less:

./myScript | less

Since less is an interactive program it puts the terminal into 'raw' mode so
that it can read characters one at a time. However, when I do the above I find
that the commands that I type to less are echoed back to me and not acted on
until I type RETURN. This is not as it should be.

The sript is not doing anything really clever, just looking at a few files and
printing out directory contents, time stamps, ...

If I run the script under strace I see:

ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo 
...}) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0


I can get it to not do this by connect stdout to /dev/null:

./myScript  /dev/null | less

another way of getting it to work is (and this shows that it really is PHP that
is messing the tty modes):

./myScript  /dev/null | (sleep 10;less)

However: PHP should not set the terminal to cooked

php-general Digest 10 Sep 2013 13:17:10 -0000 Issue 8360

2013-09-10 Thread php-general-digest-help

php-general Digest 10 Sep 2013 13:17:10 - Issue 8360

Topics (messages 322061 through 322065):

Re: Which function returns a correct ISO8601 date?
322061 by: Alessandro Pellizzari
322064 by: Simon Schick

char set ?
322062 by: georg chambert
322063 by: Ashley Sheridan

transferring iis7, php5, mysql project to another server
322065 by: Harrison, Roberto

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 Sat, 07 Sep 2013 14:47:00 +0200, Simon Schick wrote:

 The method date(c) actually formats a date, fitting to the format
 defined in the constant DateTime::ATOM.
 
 Are both formats (with and without colon) valid for ISO8601, or is the
 documentation for the method date() wrong?

Yes:

http://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators

Bye.


---End Message---
---BeginMessage---
Hi, Alessandro

Would it be worth noting somewhere, that these two implementations of
ISO8601 differ? Because I needed the DateTime::ATOM way to save the
timezone ... Even so the other one was also about ISO 8601 ...

My system is working towards a search-engine called ElasticSearch.
This one makes use of a Java method to format a date. This one is
defined here:
http://joda-time.sourceforge.net/api-release/org/joda/time/format/ISODateTimeFormat.html#dateOptionalTimeParser%28%29

The definition for a time-offset is defined like this:
offset= 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])

Is there a format, you know of, that makes this difference (colon or
not) bullet-prove?
Bye,
Simon


On Sat, Sep 7, 2013 at 5:29 PM, Alessandro Pellizzari a...@amiran.it wrote:
 On Sat, 07 Sep 2013 14:47:00 +0200, Simon Schick wrote:

 The method date(c) actually formats a date, fitting to the format
 defined in the constant DateTime::ATOM.

 Are both formats (with and without colon) valid for ISO8601, or is the
 documentation for the method date() wrong?

 Yes:

 http://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators

 Bye.



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

---End Message---
---BeginMessage---
This Q is possibly rather HTML (is there a good list for that...)

anyways;
 Im in Sweden, and have done som pages with Swedish text, however our special 
(weird) characters åäö
comes out wrong when displayd in browser, would be nice if I could tag the text 
and keep the file as is rather
than changing the file format of the text (and encode the characters with some 
double/prefix notation, 
which I guess would be the main stream
anyone ?

regards
Georg---End Message---
---BeginMessage---
On Sat, 2013-09-07 at 18:21 +0200, georg chambert wrote:

 This Q is possibly rather HTML (is there a good list for that...)
 
 anyways;
  Im in Sweden, and have done som pages with Swedish text, however our special 
 (weird) characters åäö
 comes out wrong when displayd in browser, would be nice if I could tag the 
 text and keep the file as is rather
 than changing the file format of the text (and encode the characters with 
 some double/prefix notation, 
 which I guess would be the main stream
 anyone ?
 
 regards
 Georg


Save PHP script as UTF8, and make sure you output UTF8 headers

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


---End Message---
---BeginMessage---
I have a working project using the above resources, though these are on a
Windows Server 2008 trial installation on a virtual machine in VMWare.

Is there an easy way to transfer the whole project to a legit Windows
Server 2008? So far I have the following backed up:

administration.config
applicationHost.config
redirection.config
Arachnophilia folder
MySQL folder
php folder
phpdebug folder
wwwroot folder

Thanks in advance.


Roberto Harrison, MLIS
Technology Support Librarian
Medical College of Wisconsin Libraries
Link.Learn.Lead


.




On 9/3/13 8:31 AM, Stuart Dallas stu...@3ft9.com wrote:

On 3 Sep 2013, at 02:30, Daevid Vincent dae...@daevid.com wrote:

 I'm confused on how a reference works I think.
 
 I have a DB result set in an array I'm looping over. All I simply want
to do
 is make the array key the id of the result set row.
 
 This is the basic gist of it:
 
   private function _normalize_result_set()
   {
  foreach($this-tmp_results as $k = $v)
  {
 $id = $v['id'];
 $new_tmp_results[$id] = $v; //2013-08-29 [dv]
using a
 reference here cuts the memory usage in half!

You are assigning a reference to $v. In the next iteration of the loop,
$v will be pointing at the next item in the array, as will the reference
you're storing here. With this code I'd expect

php-general Digest 7 Sep 2013 12:47:05 -0000 Issue 8359

2013-09-07 Thread php-general-digest-help

php-general Digest 7 Sep 2013 12:47:05 - Issue 8359

Topics (messages 322060 through 322060):

Which function returns a correct ISO8601 date?
322060 by: Simon Schick

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---
Hi, all

Some days ago, I needed a date, formatted as date(c) ...

To be a bit more object-oriented, I worked with an instance of
DateTime. My first thought was: As the documenting for date() defines
'c' as ISO8601, I can take the constant provided in the DateTime
object ... right? ... and that was wrong.

Here's a code-example:

date(c);
// 2013-09-07T12:40:25+00:00

date(DateTime::ISO8601);
// 2013-09-07T12:40:25+

- Take special care to the notation of the timezone.

The method date(c) actually formats a date, fitting to the format
defined in the constant DateTime::ATOM.

Are both formats (with and without colon) valid for ISO8601, or is the
documentation for the method date() wrong?

Bye,
Simon
---End Message---


php-general Digest 6 Sep 2013 07:24:11 -0000 Issue 8358

2013-09-06 Thread php-general-digest-help

php-general Digest 6 Sep 2013 07:24:11 - Issue 8358

Topics (messages 322047 through 322059):

Re: Static utility class?
322047 by: Micky Hulse
322048 by: Robert Cummings
322049 by: Micky Hulse

PHP Dependency Injector
322050 by: Juan Sebastian Scatularo
322051 by: Sorin Badea
322052 by: Bastien Koert
322053 by: Juan Sebastian Scatularo
322054 by: Sorin Badea
322055 by: Juan Sebastian Scatularo
322056 by: Paul M Foster
322057 by: David Harkness
322058 by: Marc Guay

Re: PHP-5.5.2 +opcache segfaults with Piwik
322059 by: Jan Ehrhardt

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 Wed, Sep 4, 2013 at 11:07 PM, Robert Cummings rob...@interjinn.com wrote:
 I'll second Rodrigo's opinion, but would like to comment that the name of
 the class is misleading since it's called Singleton. The singleton pattern
 is used when you only ever want one instantiation of a class. In your case
 you are using static methods, the object never needs to be instantiated and
 so it doesn't fit this pattern. What you are creating is far more consistent
 with the utility pattern.

Ahhh, thanks so much for the clarification and details! That's very helpful.

I've updated my gist to reflect the pattern name:

https://gist.github.com/mhulse/6441525

Much appreciated. :)
---End Message---
---BeginMessage---

On 13-09-05 02:27 PM, Micky Hulse wrote:

On Wed, Sep 4, 2013 at 11:07 PM, Robert Cummings rob...@interjinn.com wrote:

I'll second Rodrigo's opinion, but would like to comment that the name of
the class is misleading since it's called Singleton. The singleton pattern
is used when you only ever want one instantiation of a class. In your case
you are using static methods, the object never needs to be instantiated and
so it doesn't fit this pattern. What you are creating is far more consistent
with the utility pattern.


Ahhh, thanks so much for the clarification and details! That's very helpful.

I've updated my gist to reflect the pattern name:

https://gist.github.com/mhulse/6441525

Much appreciated. :)


Probably sufficient (and easier for typing) to just call it Utility 
since it follows the pattern but isn't the pattern itself :)


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
---End Message---
---BeginMessage---
On Thu, Sep 5, 2013 at 12:15 PM, Robert Cummings rob...@interjinn.com wrote:
 Probably sufficient (and easier for typing) to just call it Utility since it
 follows the pattern but isn't the pattern itself :)

Good call! Updated the example code.

Thanks again! I really appreciate the help. :)

Cheers,
Micky
---End Message---
---BeginMessage---
Hello people, I want to share with you a simple and small Dependency
Injector made for me.

https://github.com/abloos/Sofia

Regards

-- 
Facebook: www.facebook.com/JuanSebastianScatularo
Twitter: www.twitter.com/js_scatularo
Web: www.sebastianscatularo.com.ar
---End Message---
---BeginMessage---
There are few tutorials about home made dic. How does your dic stand out
from the crowd ?

Regards.

On Thu, Sep 5, 2013 at 10:56 PM, Juan Sebastian Scatularo 
sebastianscatul...@gmail.com wrote:

 Hello people, I want to share with you a simple and small Dependency
 Injector made for me.

 https://github.com/abloos/Sofia

 Regards

 --
 Facebook: www.facebook.com/JuanSebastianScatularo
 Twitter: www.twitter.com/js_scatularo
 Web: www.sebastianscatularo.com.ar




-- 
Sorin Badea - Software Engineer
---End Message---
---BeginMessage---
Jee, that should have been a friday comment...how does your dic standout


On Thu, Sep 5, 2013 at 4:06 PM, Sorin Badea sorin.bade...@gmail.com wrote:

 There are few tutorials about home made dic. How does your dic stand out
 from the crowd ?

 Regards.

 On Thu, Sep 5, 2013 at 10:56 PM, Juan Sebastian Scatularo 
 sebastianscatul...@gmail.com wrote:

  Hello people, I want to share with you a simple and small Dependency
  Injector made for me.
 
  https://github.com/abloos/Sofia
 
  Regards
 
  --
  Facebook: www.facebook.com/JuanSebastianScatularo
  Twitter: www.twitter.com/js_scatularo
  Web: www.sebastianscatularo.com.ar
 



 --
 Sorin Badea - Software Engineer




-- 

Bastien

Cat, the other other white meat
---End Message---
---BeginMessage---
Sorry guys if disturbed.


2013/9/5 Bastien Koert phps...@gmail.com

 Jee, that should have been a friday comment...how does your dic standout


 On Thu, Sep 5, 2013 at 4

php-general Digest 5 Sep 2013 10:48:00 -0000 Issue 8357

2013-09-05 Thread php-general-digest-help

php-general Digest 5 Sep 2013 10:48:00 - Issue 8357

Topics (messages 322039 through 322046):

Re: Static utility class?
322039 by: Stephen
322040 by: Micky Hulse
322043 by: Rodrigo Santos
322044 by: Micky Hulse
322045 by: Robert Cummings

Re: message to user after complete POST
322041 by: Rodrigo Santos
322042 by: iccsi

Re: PHP-5.5.2 +opcache segfaults with Piwik
322046 by: Grant

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 13-09-04 05:09 PM, Micky Hulse wrote:

Thank you so much for the quick and very informative/educational
replies Stephen and David, I really appreciate it! :)

On Wed, Sep 4, 2013 at 12:36 PM, Stephen stephe...@rogers.com wrote:

This sounds simply like a library of functions that are implemented using
objects.
Instantiate your static variables in the library file. Again, so that only
happens once.

functions implemented using objects sounds like exactly what I want.
Just out of curiosity, and sorry in advance for my ignorance, but does
the code I posted fit that type of pattern? If not, what would I need
to modify and how would I call it?

Actually, I should probably spend some time Googling before I ask you
for more details. :D
Well, your code does not take advantage of the features of classes, but 
the syntax is correct.


Global, static variables are not consistent with the design concepts of 
OOP. But as a first step in moving from procedural code to OOP, which is 
learning the syntax, go for it.


--
Stephen

---End Message---
---BeginMessage---
Thanks Stephen! I really appreciate the help! :)

In my PHP ventures over the years, I haven't made much use of static
variables/methods/properties ... I was thinking they might be useful
for this one bit of code, but based on your feedback (and David's) I
think I'll be heading down a different path.

Thanks again for the kick in the right direction!

Much appreciated!

Cheers,
Micky
---End Message---
---BeginMessage---
Hi, first, sorry for the bad English.

Yes, at least, as far as I know, this is the perfect way to do what you
want to do. Think like this: when you instanciate a class, you are
allocating memory. If you don't need any information stored, then you don't
need to allocate memory, right? So, it's is logic to have a class that you
will call only one fragment when you need it, rather than load the entire
class just for one method.

Just be careful to organize your utility methods by by meaning. Don't put a
method that make dating stuff and a method that write a random string in
the same class. By doing so, you are breaking the object orientation
purpose.


2013/9/4 Micky Hulse mickyhulse.li...@gmail.com

 Hi all!

 Example code:

 https://gist.github.com/mhulse/6441525

 Goal:

 I want to have a utility class that contain utility methods which should
 have the option of being called multiple times on a page.

 I think my main goal is to avoid having to new things ... I don't really
 need to create an instance here (there's no need for a constructor in this
 case).

 Question:

 Is the above simple pattern a good way to have a class that calls static
 methods?

 To put it another way, is there any reason why I would not want to use the
 above code?

 Basically I want to wrap these simple functions in a nice class wrapper and
 have the ability to call them without having to jump through more hoops
 than is necessary.

 Are there any pitfalls to writing a class like this? Or, is this the
 standard way of writing a simple utility class for this type of
 situation?

 Please let me know if I need to clarify my questions.

 Thanks for your time?

---End Message---
---BeginMessage---
Hi Rodrigo, thanks for the help, I really appreciate it!

On Wed, Sep 4, 2013 at 5:55 PM, Rodrigo Santos
rodrigos.santo...@gmail.com wrote:
 Hi, first, sorry for the bad English.

Not bad at all! Very clear and well written reply (heck, it's better
than my native English writing), so thank you! :)

 Yes, at least, as far as I know, this is the perfect way to do what you want
 to do. Think like this: when you instanciate a class, you are allocating
 memory. If you don't need any information stored, then you don't need to
 allocate memory, right? So, it's is logic to have a class that you will call
 only one fragment when you need it, rather than load the entire class just
 for one method.

Interesting! That makes a lot of sense.

Now you've piqued my interests! :)

I was going to head down a different path, but you've inspired me to
further explore the use of static methods/properties/variables/other.

A part of me just wants to learn more about PHP OOP, and using static
members

php-general Digest 4 Sep 2013 09:21:22 -0000 Issue 8355

2013-09-04 Thread php-general-digest-help

php-general Digest 4 Sep 2013 09:21:22 - Issue 8355

Topics (messages 322028 through 322033):

Re: refernces, arrays, and why does it take up so much memory? [SOLVED]
322028 by: Daevid Vincent
322029 by: Stuart Dallas
322030 by: Daevid Vincent
322031 by: Daevid Vincent
322033 by: Stuart Dallas

Re: PHP-5.5.2 +opcache segfaults with Piwik
322032 by: Daniel

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---
EUREKA!

 -Original Message-
 From: Stuart Dallas [mailto:stu...@3ft9.com]
 Sent: Tuesday, September 03, 2013 6:31 AM
 To: Daevid Vincent
 Cc: php-gene...@lists.php.net
 Subject: Re: [PHP] refernces, arrays, and why does it take up so much
 memory?
 
 On 3 Sep 2013, at 02:30, Daevid Vincent dae...@daevid.com wrote:
 
  I'm confused on how a reference works I think.
 
  I have a DB result set in an array I'm looping over. All I simply want
to
 do
  is make the array key the id of the result set row.
 
  This is the basic gist of it:
 
private function _normalize_result_set()
{
   foreach($this-tmp_results as $k = $v)
   {
  $id = $v['id'];
  $new_tmp_results[$id] = $v; //2013-08-29 [dv] using
a
  reference here cuts the memory usage in half!
 
 You are assigning a reference to $v. In the next iteration of the loop, $v
 will be pointing at the next item in the array, as will the reference
you're
 storing here. With this code I'd expect $new_tmp_results to be an array
 where the keys (i.e. the IDs) are correct, but the data in each item
matches
 the data in the last item from the original array, which appears to be
what
 you describe.
 
  unset($this-tmp_results[$k]);
 
 Doing this for every loop is likely very inefficient. I don't know how the
 inner workings of PHP process something like this, but I wouldn't be
 surprised if it's allocating a new chunk of memory for a version of the
 array without this element. You may find it better to not unset anything
 until the loop has finished, at which point you can just unset($this-
 tmp_results).
 
 
  /*
  if ($i++ % 1000 == 0)
  {
gc_enable(); // Enable Garbage Collector
var_dump(gc_enabled()); // true
var_dump(gc_collect_cycles()); // # of
elements
  cleaned up
gc_disable(); // Disable Garbage Collector
  }
  */
   }
   $this-tmp_results = $new_tmp_results;
   //var_dump($this-tmp_results); exit;
   unset($new_tmp_results);
}
 
 
 Try this:
 
 private function _normalize_result_set()
 {
   // Initialise the temporary variable.
   $new_tmp_results = array();
 
   // Loop around just the keys in the array.
   foreach (array_keys($this-tmp_results) as $k)
   {
 // Store the item in the temporary array with the ID as the key.
 // Note no pointless variable for the ID, and no use of !
 $new_tmp_results[$this-tmp_results[$k]['id']] =
$this-tmp_results[$k];
   }
 
   // Assign the temporary variable to the original variable.
   $this-tmp_results = $new_tmp_results;
 }
 
 I'd appreciate it if you could plug this in and see what your memory usage
 reports say. In most cases, trying to control the garbage collection
through
 the use of references is the worst way to go about optimising your code.
In
 my code above I'm relying on PHPs copy-on-write feature where data is only
 duplicated when assigned if it changes. No unsets, just using scope to
mark
 a variable as able to be cleaned up.
 
 Where is this result set coming from? You'd save yourself a lot of
 memory/time by putting the data in to this format when you read it from
the
 source. For example, if reading it from MySQL, $this-
 tmp_results[$row['id']] = $row when looping around the result set.
 
 Also, is there any reason why you need to process this full set of data in
 one go? Can you not break it up in to smaller pieces that won't put as
much
 strain on resources?
 
 -Stuart

There were reasons I had the $id -- I only showed the relevant parts of the
code for sake of not overly complicating what I was trying to illustrate.
There is other processing that had to be done too in the loop and that is
also what I illustrated.

Here is your version effectively:

private function _normalize_result_set() //Stuart
{
  if (!$this-tmp_results || count($this-tmp_results)  1)
return;

  $new_tmp_results = array();

  // Loop

php-general Digest 4 Sep 2013 22:25:25 -0000 Issue 8356

2013-09-04 Thread php-general-digest-help

php-general Digest 4 Sep 2013 22:25:25 - Issue 8356

Topics (messages 322034 through 322038):

Static utility class?
322034 by: Micky Hulse
322035 by: Stephen
322036 by: David Harkness
322037 by: Micky Hulse

message to user after complete POST
322038 by: iccsi

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---
Hi all!

Example code:

https://gist.github.com/mhulse/6441525

Goal:

I want to have a utility class that contain utility methods which should
have the option of being called multiple times on a page.

I think my main goal is to avoid having to new things ... I don't really
need to create an instance here (there's no need for a constructor in this
case).

Question:

Is the above simple pattern a good way to have a class that calls static
methods?

To put it another way, is there any reason why I would not want to use the
above code?

Basically I want to wrap these simple functions in a nice class wrapper and
have the ability to call them without having to jump through more hoops
than is necessary.

Are there any pitfalls to writing a class like this? Or, is this the
standard way of writing a simple utility class for this type of situation?

Please let me know if I need to clarify my questions.

Thanks for your time?
---End Message---
---BeginMessage---

On 13-09-04 03:25 PM, Micky Hulse wrote:

I want to have a utility class that contain utility methods which should
have the option of being called multiple times on a page.
This sounds simply like a library of functions that are implemented 
using objects.


You can use the standard require_once in your various PHP source files 
so you only deal with loading the library file in the first file in 
which it is needed. It would not be loaded from other files.


Instantiate your static variables in the library file. Again, so that 
only happens once.


--
Stephen

---End Message---
---BeginMessage---
On Wed, Sep 4, 2013 at 12:25 PM, Micky Hulse mickyhulse.li...@gmail.comwrote:

 I want to have a utility class that contain utility methods which should
 have the option of being called multiple times on a page.
 ...
 To put it another way, is there any reason why I would not want to use the
 above code?


The main problem caused by static methods is testability. Mocking or
stubbing a static method requires using a PHP extension and ensuring that
the original is reset whether the test passes or fails. As long as your
utility methods don't perform actions you want to avoid during tests, this
is fine.

Good examples for a utility class are string-processing functions such as
parsing and formatting, trimming and/or normalizing empty string to null,
etc. You want tests to work against these methods directly since there's no
need to avoid the work.

You'll want to avoid static methods whenever you want to be able to fix the
behavior (stubbing) to test scenarios in the class under test. An example
is anything hitting a database or external service. In order to test that
your downloader sends the correct warning email to the sysadmin when a REST
call fails, you need to be able to force the REST call to fail. This is
easy to do when you plug in an instance implementing the API because you
can give it an implementation/mock that fails for all calls.

I can't say if what you're thinking of will make a good utility class since
the code you posted is fake. If you post some examples of methods you want
to make static, we can give you pointers on which are good candidates and
which are best left to instance methods.

Peace,
David
---End Message---
---BeginMessage---
Thank you so much for the quick and very informative/educational
replies Stephen and David, I really appreciate it! :)

On Wed, Sep 4, 2013 at 12:36 PM, Stephen stephe...@rogers.com wrote:
 This sounds simply like a library of functions that are implemented using
 objects.
 Instantiate your static variables in the library file. Again, so that only
 happens once.

functions implemented using objects sounds like exactly what I want.
Just out of curiosity, and sorry in advance for my ignorance, but does
the code I posted fit that type of pattern? If not, what would I need
to modify and how would I call it?

Actually, I should probably spend some time Googling before I ask you
for more details. :D

On Wed, Sep 4, 2013 at 1:15 PM, David Harkness
davi...@highgearmedia.com wrote:
 I can't say if what you're thinking of will make a good utility class since 
 the code you posted is fake. If you post some examples of methods you want to 
 make static, we can give you pointers on which are good candidates and which 
 are best left to instance methods.

Sorry about the fake code

php-general Digest 3 Sep 2013 13:31:21 -0000 Issue 8354

2013-09-03 Thread php-general-digest-help

php-general Digest 3 Sep 2013 13:31:21 - Issue 8354

Topics (messages 322024 through 322027):

Re: refernces, arrays, and why does it take up so much memory?
322024 by: Jim Giner
322025 by: Daevid Vincent
322026 by: Jim Giner
322027 by: Stuart Dallas

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 9/2/2013 9:30 PM, Daevid Vincent wrote:

I'm confused on how a reference works I think.

I have a DB result set in an array I'm looping over. All I simply want to do
is make the array key the id of the result set row.

This is the basic gist of it:

private function _normalize_result_set()
{
   foreach($this-tmp_results as $k = $v)
   {
  $id = $v['id'];
  $new_tmp_results[$id] = $v; //2013-08-29 [dv] using a
reference here cuts the memory usage in half!
  unset($this-tmp_results[$k]);

  /*
  if ($i++ % 1000 == 0)
  {
gc_enable(); // Enable Garbage Collector
var_dump(gc_enabled()); // true
var_dump(gc_collect_cycles()); // # of elements
cleaned up
gc_disable(); // Disable Garbage Collector
  }
  */
   }
   $this-tmp_results = $new_tmp_results;
   //var_dump($this-tmp_results); exit;
   unset($new_tmp_results);
}

Without using the = reference, my data works great:
$new_tmp_results[$id] = $v;

array (size=79552)
   6904 =
 array (size=4)
   'id' = string '6904' (length=4)
   'studio_id' = string '5' (length=1)
   'genres' = string '34|' (length=3)
   6905 =
 array (size=4)
   'id' = string '6905' (length=4)
   'studio_id' = string '5' (length=1)
   'genres' = string '6|37|' (length=5)

However it takes a stupid amount of memory for some unknown reason.
MEMORY USED @START: 262,144 - @END: 42,729,472 = 42,467,328 BYTES
MEMORY PEAK USAGE: 216,530,944 BYTES

When using the reference the memory drastically goes down to what I'd EXPECT
it to be (and actually the problem I'm trying to solve).
MEMORY USED @START: 262,144 - @END: 6,029,312 = 5,767,168 BYTES
MEMORY PEAK USAGE: 82,051,072 BYTES

However my array is all kinds of wrong:

array (size=79552)
   6904 = 
 array (size=4)
   'id' = string '86260' (length=5)
   'studio_id' = string '210' (length=3)
   'genres' = string '8|9|10|29|58|' (length=13)
   6905 = 
 array (size=4)
   'id' = string '86260' (length=5)
   'studio_id' = string '210' (length=3)
   'genres' = string '8|9|10|29|58|' (length=13)

Notice that they're all the same values, although the keys seem right. I
don't understand why that happens because
foreach($this-tmp_results as $k = $v)
Should be changing $v each iteration I'd think.

Honestly, I am baffled as to why those unsets() make no difference. All I
can think is that the garbage collector doesn't run. But then I had also
tried to force gc() and that still made no difference. *sigh*

I had some other cockamamie idea where I'd use the same tmp_results array in
a tricky way to avoid a  second array. The concept being I'd add 1 million
to the ['id'] (which we want as the new array key), then unset the existing
sequential key, then when all done, loop through and shift all the keys by 1
million thereby they'd be the right index ID. So add one and unset one
immediately after. Clever right? 'cept it too made no difference on memory.
Same thing is happening as above where the gc() isn't running or something
is holding all that memory until the end. *sigh*

Then I tried a different way using array_combine() and noticed something
very disturbing.
http://www.php.net/manual/en/function.array-combine.php


private function _normalize_result_set()
{
   if (!$this-tmp_results || count($this-tmp_results)  1)
return;

   $D_start_mem_usage = memory_get_usage();
   foreach($this-tmp_results as $k = $v)
   {
  $id = $v['id'];
  $tmp_keys[] = $id;

  if ($v['genres'])
  {
 $g = explode('|', $v['genres']);
$this-tmp_results[$k]['g'] = $g; //this causes a
massive spike in memory usage
  }
   }
   //var_dump($tmp_keys, $this-tmp_results); exit;
   echo \nMEMORY USED BEFORE array_combine:
.number_format(memory_get_usage() - $D_start_mem_usage). PEAK

php-general Digest 2 Sep 2013 08:57:25 -0000 Issue 8352

2013-09-02 Thread php-general-digest-help

php-general Digest 2 Sep 2013 08:57:25 - Issue 8352

Topics (messages 322017 through 322020):

Re: PHP-5.5.2 +opcache segfaults with Piwik
322017 by: Lester Caine
322018 by: Jan Ehrhardt
322019 by: Jan Ehrhardt
322020 by: Jan Ehrhardt

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---

Grant wrote:

I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
opcache is disabled.  Someone filed a piwik bug but was told it's a
php bug:

http://dev.piwik.org/trac/ticket/4093



Is this a known issue?


I'm running my own port of piwik in production with eaccelerator on 5.4 but I've 
made the decision not to move any of the machines to 5.5 until all of the legacy 
5.2 machines have been brought up to 5.4. Not an answer, but explains perhaps 
why the problem is not being seen by others.


--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
---End Message---
---BeginMessage---
Lester Caine in php.general (Sun, 01 Sep 2013 12:59:18 +0100):
Grant wrote:
 I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
 opcache is disabled.  Someone filed a piwik bug but was told it's a
 php bug:
 
 http://dev.piwik.org/trac/ticket/4093

 Is this a known issue?

 (...) Not an answer, but explains perhaps  why the problem is not being
seen by others.

It is more likely that users do not notice it. I have Piwik running with
PHP 5.3 and php_opcache.dll (Centos 5) and it segfaults:

[Sun Sep 01 17:06:53.131410 2013] [core:notice] [pid 25411] AH00052:
child pid 25451 exit signal Segmentation fault (11)
[Sun Sep 01 17:08:18.561917 2013] [core:notice] [pid 25411] AH00052:
child pid 25453 exit signal Segmentation fault (11)
[Sun Sep 01 17:08:19.569714 2013] [core:notice] [pid 25411] AH00052:
child pid 25450 exit signal Segmentation fault (11)

However, nothing special is displaying on the page. You have to grep
your Apache error_log to know that it happens. How did you notice?

Jan
---End Message---
---BeginMessage---
Grant in php.general (Sun, 1 Sep 2013 02:13:54 -0700):
 I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
 opcache is disabled.  Someone filed a piwik bug but was told it's a
 php bug:

 http://dev.piwik.org/trac/ticket/4093

Is this a known issue?

I changed the PHP on my (dev) Centos5 server to PHP 5.5.3, pulled the
latest OPcache from Github and tried to get a segfault. That was clearly
visible when I tried to access the Goals tab in the dashboard of one of
my websites. The page never got further than 'Loading data...' and my
Apache log showed a segfault.

So, if it was no known issue it is confirmed now.

Jan
---End Message---
---BeginMessage---
Grant in php.general (Sun, 25 Aug 2013 02:31:29 -0700):
I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
opcache is disabled.  Someone filed a piwik bug but was told it's a
php bug:

http://dev.piwik.org/trac/ticket/4093

Could you try to add a function_exists check to
libs/upgradephp/upgrade.php?

This at the function declaration of _json_encode:
if (!function_exists('_json_encode')) { function _json_encode($var, ...

And a extra } at the end.

This seemed to correct this fatal error on my side:

[02-Sep-2013 10:35:40 Europe/Paris] PHP Fatal error:  Cannot redeclare
_json_encode() (previously declared in
/usr/local/lib/php/share/piwik/libs/upgradephp/upgrade.php:109) in
/usr/local/lib/php/share/piwik/libs/upgradephp/upgrade.php on line 109

I do not know what opcache has to do with it, although I suspect that
Piwik is calling itself a lot of times and that opcache is trailing
behind (or something like that).

Jan
---End Message---


php-general Digest 3 Sep 2013 01:31:03 -0000 Issue 8353

2013-09-02 Thread php-general-digest-help

php-general Digest 3 Sep 2013 01:31:03 - Issue 8353

Topics (messages 322021 through 322023):

Re: PHP-5.5.2 +opcache segfaults with Piwik
322021 by: Jan Ehrhardt
322022 by: Lester Caine

refernces, arrays, and why does it take up so much memory?
322023 by: Daevid Vincent

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---
Jan Ehrhardt in php.general (Mon, 02 Sep 2013 10:57:14 +0200):
Could you try to add a function_exists check to
libs/upgradephp/upgrade.php?

This at the function declaration of _json_encode:
if (!function_exists('_json_encode')) { function _json_encode($var, ...

And a extra } at the end.

This patch, together with upgrading to the latest OPcache from github
solved my segfaults and fatal errors.

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

Jan Ehrhardt wrote:

Could you try to add a function_exists check to
libs/upgradephp/upgrade.php?

This at the function declaration of _json_encode:
if (!function_exists('_json_encode')) { function _json_encode($var, ...

And a extra } at the end.

This patch, together with upgrading to the latest OPcache from github
solved my segfaults and fatal errors.


Jan  - could you post the solution on http://dev.piwik.org/trac/ticket/4093 - 
better that you get the credit than one of us pinch it ;)


--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
---End Message---
---BeginMessage---
I'm confused on how a reference works I think.
 
I have a DB result set in an array I'm looping over. All I simply want to do
is make the array key the id of the result set row.
 
This is the basic gist of it:
 
   private function _normalize_result_set()
   {
  foreach($this-tmp_results as $k = $v)
  {
 $id = $v['id'];
 $new_tmp_results[$id] = $v; //2013-08-29 [dv] using a
reference here cuts the memory usage in half!
 unset($this-tmp_results[$k]);
 
 /*
 if ($i++ % 1000 == 0)
 {
   gc_enable(); // Enable Garbage Collector
   var_dump(gc_enabled()); // true
   var_dump(gc_collect_cycles()); // # of elements
cleaned up
   gc_disable(); // Disable Garbage Collector
 }
 */
  }
  $this-tmp_results = $new_tmp_results;
  //var_dump($this-tmp_results); exit;
  unset($new_tmp_results);
   }
 
Without using the = reference, my data works great:
$new_tmp_results[$id] = $v;
 
array (size=79552)
  6904 = 
array (size=4)
  'id' = string '6904' (length=4)
  'studio_id' = string '5' (length=1)
  'genres' = string '34|' (length=3)
  6905 = 
array (size=4)
  'id' = string '6905' (length=4)
  'studio_id' = string '5' (length=1)
  'genres' = string '6|37|' (length=5)
 
However it takes a stupid amount of memory for some unknown reason.
MEMORY USED @START: 262,144 - @END: 42,729,472 = 42,467,328 BYTES
MEMORY PEAK USAGE: 216,530,944 BYTES
 
When using the reference the memory drastically goes down to what I'd EXPECT
it to be (and actually the problem I'm trying to solve).
MEMORY USED @START: 262,144 - @END: 6,029,312 = 5,767,168 BYTES
MEMORY PEAK USAGE: 82,051,072 BYTES
 
However my array is all kinds of wrong:
 
array (size=79552)
  6904 = 
array (size=4)
  'id' = string '86260' (length=5)
  'studio_id' = string '210' (length=3)
  'genres' = string '8|9|10|29|58|' (length=13)
  6905 = 
array (size=4)
  'id' = string '86260' (length=5)
  'studio_id' = string '210' (length=3)
  'genres' = string '8|9|10|29|58|' (length=13)
 
Notice that they're all the same values, although the keys seem right. I
don't understand why that happens because 
foreach($this-tmp_results as $k = $v)
Should be changing $v each iteration I'd think.
 
Honestly, I am baffled as to why those unsets() make no difference. All I
can think is that the garbage collector doesn't run. But then I had also
tried to force gc() and that still made no difference. *sigh*
 
I had some other cockamamie idea where I'd use the same tmp_results array in
a tricky way to avoid a  second array. The concept being I'd add 1 million
to the ['id'] (which we want as the new array key), then unset the existing
sequential key, then when all done, loop through and shift all the keys by 1

php-general Digest 1 Sep 2013 09:14:01 -0000 Issue 8351

2013-09-01 Thread php-general-digest-help

php-general Digest 1 Sep 2013 09:14:01 - Issue 8351

Topics (messages 322016 through 322016):

Re: PHP-5.5.2 +opcache segfaults with Piwik
322016 by: Grant

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---
 I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
 opcache is disabled.  Someone filed a piwik bug but was told it's a
 php bug:

 http://dev.piwik.org/trac/ticket/4093

 - Grant

Is this a known issue?

- Grant
---End Message---


php-general Digest 30 Aug 2013 21:00:13 -0000 Issue 8350

2013-08-30 Thread php-general-digest-help

php-general Digest 30 Aug 2013 21:00:13 - Issue 8350

Topics (messages 322015 through 322015):

Strange url session behavior after upgrade to 4.3
322015 by: Tobiah

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---

I have a page that needs to get another page on the fly, using
the same session.  I figured out how to stop my session and set
the cookie on the CURL handler, and everything was cool.  The
curled page had my same session available as the calling page.
Life was good.

Now something has changed after upgrading from 5.2.4 to 5.3.10.
My session was no longer available on the curled page.  What's
strange is that the PHPSESSID cookie was still being set, and
hit had the correct value.

Here is the weirdest part.  If I do this:

session_id($_COOKIE['PHPSESSID']);
session_start();

The session is there!  But why isn't php taking
the cookie as the id all by itself?  Regular
pages (not curled) all work as before.  All of
our websites work fine on the new version, except
for this one curl call.  I could update 100's of
websites to fix them with the added lines, but
I'd really rather find out why the curled page
is not taking the session_id from the PHPSESSID
cookie.

Thanks!

Toby
---End Message---


php-general Digest 29 Aug 2013 23:30:10 -0000 Issue 8349

2013-08-29 Thread php-general-digest-help

php-general Digest 29 Aug 2013 23:30:10 - Issue 8349

Topics (messages 322012 through 322014):

Re: Basic Auth
322012 by: Jim Giner
322013 by: Stuart Dallas

IMAP Metadata support
322014 by: list.airstreamcomm.net

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---

Stuart,

Just wanted to follow up with my thanks for your excellent help in 
providing understanding of how to generate the 401 error page and 
getting me thru the process of performing a sign-out from basic auth. 
Without your patience it never would have happened.


Also wanted to tell you that I've scrapped it all.  Keeping the code for 
a rainy day of course, but giving up on using it (as well as the basic 
auth signon process) to use my own 'roll-your-own' code.  Since IE 
insisted on presenting multiple credentials during the signon process it 
was a futile effort to be doing a signoff.  And yes - I've taken the 
proper precautions to hash the incoming password value before submission 
and storing in my db that way.


Thanks again.  It's help like this that makes this group such a great 
resource.
---End Message---
---BeginMessage---
On 27 Aug 2013, at 18:45, Jim Giner jim.gi...@albanyhandball.com wrote:

 From your latest missive I gleaned that I needed to have a script on my server

One last time: YOU DON'T NEED TO CHANGE ANYTHING ON THE SERVER-SIDE!

Ok, I see that you've decided to use another method, which is great; HTTP auth 
is a pretty antiquated way to handle authentication these days. Whatever you're 
using, I wish you all the best with it.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/---End Message---
---BeginMessage---

Does PHP IMAP have any support for Metadata?

Thanks.

---End Message---


php-general Digest 28 Aug 2013 10:15:58 -0000 Issue 8348

2013-08-28 Thread php-general-digest-help

php-general Digest 28 Aug 2013 10:15:58 - Issue 8348

Topics (messages 322011 through 322011):

Re: php seg faults on creation pdf
322011 by: KAs Coenen

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---
Hi, 

Some more info. I ran gdb on the core file (after reinstalling with debug mode):

# /usr/local/gdb/bin/gdb /usr/local/php5/bin/php-cgi 
/opt/apache/htdocs/wachtlijst/core
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as i386-pc-solaris2.10.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/php5/bin/php-cgi...done.
[New LWP 1]
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
Core was generated by `/usr/local/php5/bin/php-cgi 
/opt/apache/htdocs/wachtlijst/test.php'.
Program terminated with signal 11, Segmentation fault.
#0  0x0093baa4 in _object_and_properties_init (arg=error reading 
variable: Cannot access memory at address 0xffd8,
    arg@entry=error reading variable: Cannot access memory at address 0x8, 
class_type=error reading variable: Cannot access memory at address 
0xffd0,
    class_type@entry=error reading variable: Cannot access memory at address 
0x8, properties=error reading variable: Cannot access memory at address 
0xffc8,
    properties@entry=error reading variable: Cannot access memory at address 
0x8) at /export/home/coenenka/php-5.5.1/Zend/zend_API.c:1200
1200    Z_OBJVAL_P(arg) = class_type-create_object(class_type 
TSRMLS_CC);

Does anyone see anything in this? The dir /export/home/coenenka is not the 
install dir (but my home drive) and I have no clue why it is referencing to 
that dir (it is the location of the source). 

Greetings,

Kas



 From: kascoe...@hotmail.com
 To: php-gene...@lists.php.net
 Subject: php seg faults on creation pdf
 Date: Wed, 28 Aug 2013 10:00:29 +0200

 Hi,

 When surfing to a website that generates a pdf the apache server segfaults. 
 This made me run the script (that generates the pdf) with the php cli 
 command. The php also segfaults with the same error:

 # /usr/local/php5/bin/php-cgi test.php
 Segmentation Fault (core dumped)

 Pstack output:

 # pstack core
 core 'core' of 726: /usr/local/php5/bin/php-cgi test.php
  00960af5 _object_and_properties_init () + 111

 I attached the truss output to the mail. I am running this on a solaris 
 server:

 # uname -a
 SunOS zone-eu4 5.10 Generic_142910-17 i86pc i386 i86pc
 # cat /etc/release
 Oracle Solaris 10 9/10 s10x_u9wos_14a X86
  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 Assembled 11 August 2010

 pdflib module is 2.1.10. PDFlib lite is version 7.0.5. I tried to compile 
 everything in 64 bit. I suspect the problem is that somewhere a 32bit lib or 
 executable is being used instead of a 64bit.


 Can anyone help me out on this?

 Kind regards,

 Kas ---End Message---


php-general Digest 27 Aug 2013 06:45:12 -0000 Issue 8346

2013-08-27 Thread php-general-digest-help

php-general Digest 27 Aug 2013 06:45:12 - Issue 8346

Topics (messages 321971 through 321985):

Re: exec and system do not work
321971 by: Jim Giner
321973 by: marco.behnke.biz
321976 by: Tamara Temple
321978 by: Ethan Rosenberg, PhD
321979 by: Tim Streater
321980 by: David Robley
321981 by: Ethan Rosenberg, PhD
321982 by: Jasper Kips
321983 by: David Robley

How to send post-variables in a Location header
321972 by: Ajay Garg
321974 by: marco.behnke.biz
321975 by: Matijn Woudt
321977 by: Tamara Temple

Permissions
321984 by: Ethan Rosenberg, PhD
321985 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 8/26/2013 2:41 PM, Ethan Rosenberg wrote:


On 08/26/2013 11:36 AM, ma...@behnke.biz wrote:




Tamara Temple tamouse.li...@gmail.com hat am 26. August 2013 um 08:33
geschrieben:



On Aug 25, 2013, at 10:41 PM, Ethan Rosenberg
erosenb...@hygeiabiomedical.com wrote:


Dear List -

I'm lost on this one -

This works -

$out = system(ls -l ,$retvals);
printf(%s, $out);

This does -

echo exec(ls -l);


Please show the output of the directory listing.
Please us ls -la



This does not -

if( !file_exists(/var/www/orders.txt));
{
$out = system(touch /var/www/orders.txt, $ret);


Maybe you don't have write permissions on the folder?


$out2 = system(chmod 766 /var/www/orders.txt, $ret);
echo 'file2br /';
echo file_exists(/var/www/orders.txt);
}

and this does not -

if( !file_exists(/var/www/orders.txt));
{
exec(touch /var/www/orders.txt);
exec(chmod 766 /var/www/orders.txt);
echo 'file2br /';
echo file_exists(/var/www/orders.txt);
}

Ethan




When you say does not work, can you show what is actually not
working? I
believe the exec and system functions are likely working just fine,
but that
the commands you've passed to them may not be.




--
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz



Tamara -

  Please show the output of the directory listing.
  Please us ls -la

echo exec('ls -la orders.txt');

-rw-rw-rw- 1 ethan ethan 43 Aug 25 23:50 orders.txt


Maybe you don't have write permissions on the folder?

If I perform the touch and chmod from the command line, everything works.


  When you say does not work, can you show what is actually not
working? I
  believe the exec and system functions are likely working just fine,
but that
  the commands you've passed to them may not be.

Here are my commands.

if( !file_exists(/var/www/orders.txt));
{
echo system(touch /var/www/orders.txt, $ret);
echo system(chmod 766 /var/www/orders.txt, $ret);
echo 'file2br /';
echo file_exists(/var/www/orders.txt);
}

If I now try a ls from the command line, the return is
  cannot access /var/www/orders.txt: No such file or directory

The ls -la  works because the file was created from the command line.

TIA

Ethan






Ethan - YOU'RE DOING IT AGAIN!!!

Either you are not using error checking AGAIN!!
OR
You are showing us re-typed in code that YOU DIDNT ACTUALLY RUN.

I've told you multiple times that you need to do these two things and 
you are back at it again.


The sample php above has plain simple syntax errors that would keep it 
from running, which error checking would tell you IF YOU RAN IT.
---End Message---
---BeginMessage---


 Ethan Rosenberg erosenb...@hygeiabiomedical.com hat am 26. August 2013 um
 20:41 geschrieben:


   Please show the output of the directory listing.
   Please us ls -la

 echo exec('ls -la orders.txt');

 -rw-rw-rw- 1 ethan ethan 43 Aug 25 23:50 orders.txt

Please supply the complete output. Especially the rights for . and ..

 Maybe you don't have write permissions on the folder?

 If I perform the touch and chmod from the command line, everything works.

cli and ww are different users.
---End Message---
---BeginMessage---

On Aug 26, 2013, at 1:41 PM, Ethan Rosenberg erosenb...@hygeiabiomedical.com 
wrote:
 On 08/26/2013 11:36 AM, ma...@behnke.biz wrote:
 Tamara Temple tamouse.li...@gmail.com hat am 26. August 2013 um 08:33
 geschrieben:
 
 
 
 On Aug 25, 2013, at 10:41 PM, Ethan Rosenberg
 erosenb...@hygeiabiomedical.com wrote:
 
 Dear List -
 
 I'm lost on this one -
 
 This works -
 
 $out = system(ls -l ,$retvals);
 printf(%s, $out);
 
 This does -
 
 echo exec(ls -l);
 
 Please show the output of the directory listing.
 Please us ls -la
 
 
 This does not -
 
 if( !file_exists(/var/www/orders.txt));
 {
$out = system(touch /var/www

php-general Digest 26 Aug 2013 18:41:27 -0000 Issue 8345

2013-08-26 Thread php-general-digest-help

php-general Digest 26 Aug 2013 18:41:27 - Issue 8345

Topics (messages 321966 through 321970):

Re: exec and system do not work
321966 by: Sorin Badea
321967 by: Robert Cummings
321968 by: Tamara Temple
321969 by: marco.behnke.biz
321970 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---
*/var/www* is usually under *www* user. It may be a permissions problem.


On Mon, Aug 26, 2013 at 6:41 AM, Ethan Rosenberg 
erosenb...@hygeiabiomedical.com wrote:

 Dear List -

 I'm lost on this one -

 This works -

 $out = system(ls -l ,$retvals);
 printf(%s, $out);

 This does -

 echo exec(ls -l);

 This does not -

 if( !file_exists(/var/www/orders.**txt));
 {
$out = system(touch /var/www/orders.txt, $ret);
$out2 = system(chmod 766 /var/www/orders.txt, $ret);
echo 'file2br /';
echo file_exists(/var/www/orders.**txt);
 }

 and this does not -

 if( !file_exists(/var/www/orders.**txt));
 {
exec(touch /var/www/orders.txt);
exec(chmod 766 /var/www/orders.txt);
echo 'file2br /';
echo file_exists(/var/www/orders.**txt);
 }

 Ethan

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




-- 
Sorin Badea - Software Engineer
---End Message---
---BeginMessage---

On 13-08-25 11:41 PM, Ethan Rosenberg wrote:

Dear List -

I'm lost on this one -

This works -

$out = system(ls -l ,$retvals);
printf(%s, $out);

This does -

echo exec(ls -l);

This does not -

if( !file_exists(/var/www/orders.txt));
{
 $out = system(touch /var/www/orders.txt, $ret);
 $out2 = system(chmod 766 /var/www/orders.txt, $ret);
 echo 'file2br /';
 echo file_exists(/var/www/orders.txt);
}

and this does not -

if( !file_exists(/var/www/orders.txt));
{
 exec(touch /var/www/orders.txt);
 exec(chmod 766 /var/www/orders.txt);
 echo 'file2br /';
 echo file_exists(/var/www/orders.txt);
}

Ethan


Hi Ethan,

Is there a reason you're using shell commands to achieve the following:

?php

$path = '/var/www/orders.txt';
if( !file_exists( $path ) )
{
if( !touch( $path ) )
{
echo 'Failed to touch file into existence: '.$path.\n;
}
else
{
if( !chmod( $path, 0766 ) )
{
echo 'Failed to update file permissions: '.$path.\n;
}
}
}

?

Also, why are you setting the executable bit on a text file? :)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
---End Message---
---BeginMessage---

On Aug 25, 2013, at 10:41 PM, Ethan Rosenberg erosenb...@hygeiabiomedical.com 
wrote:

 Dear List -
 
 I'm lost on this one -
 
 This works -
 
 $out = system(ls -l ,$retvals);
 printf(%s, $out);
 
 This does -
 
 echo exec(ls -l);
 
 This does not -
 
 if( !file_exists(/var/www/orders.txt));
 {
   $out = system(touch /var/www/orders.txt, $ret);
   $out2 = system(chmod 766 /var/www/orders.txt, $ret);
   echo 'file2br /';
   echo file_exists(/var/www/orders.txt);
 }
 
 and this does not -
 
 if( !file_exists(/var/www/orders.txt));
 {
   exec(touch /var/www/orders.txt);
   exec(chmod 766 /var/www/orders.txt);
   echo 'file2br /';
   echo file_exists(/var/www/orders.txt);
 }
 
 Ethan
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

When you say does not work, can you show what is actually not working? I 
believe the exec and system functions are likely working just fine, but that 
the commands you've passed to them may not be.


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


 Tamara Temple tamouse.li...@gmail.com hat am 26. August 2013 um 08:33
 geschrieben:



 On Aug 25, 2013, at 10:41 PM, Ethan Rosenberg
 erosenb...@hygeiabiomedical.com wrote:

  Dear List -
 
  I'm lost on this one -
 
  This works -
 
  $out = system(ls -l ,$retvals);
  printf(%s, $out);
 
  This does -
 
  echo exec(ls -l);

Please show the output of the directory listing.
Please us ls -la

 
  This does not -
 
  if( !file_exists(/var/www/orders.txt));
  {
    $out = system(touch /var/www/orders.txt, $ret);

Maybe you don't have write permissions on the folder?

    $out2 = system(chmod 766 /var/www/orders.txt, $ret);
    echo 'file2br /';
    echo file_exists(/var/www/orders.txt);
  }
 
  and this does not -
 
  if( !file_exists(/var/www/orders.txt));
  {
    exec(touch /var/www/orders.txt);
    exec(chmod 766 /var/www/orders.txt);
    echo

php-general Digest 25 Aug 2013 09:31:34 -0000 Issue 8343

2013-08-25 Thread php-general-digest-help

php-general Digest 25 Aug 2013 09:31:34 - Issue 8343

Topics (messages 321960 through 321964):

Re: Alternate list for eclipse ide support?
321960 by: Sebastian Krebs
321961 by: Lester Caine
321962 by: Sebastian Krebs
321963 by: Lester Caine

PHP-5.5.2 +opcache segfaults with Piwik
321964 by: Grant

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---
2013/8/24 Lester Caine les...@lsces.co.uk

 With composer being pushed as the 'in way to go' and not being able to see
 how to get some code relating to bootstrap and smarty development because
 the links only show composer I've downloaded a plug-in for eclipse that is
 supposed to handle that. But it's not working as I expect, and while
 heading over to the plug-ins developers is the obvious step, what I'd
 actually prefer is a more general PHP/Eclipse list to discuss general IDE
 problems rather than even PDT biased discussions.

 Is there a suitable list? And if not is there any interest in setting one
 up? ... at the risk of proliferating even more lists ...


Hi,

I for myself switched over to PhpStorm from Eclipse/PDT and I fear meany
hear use either PhpStorm, or Netbeans in the meantime. I'm not saying, that
nobody is using Eclipse/PDT anymore, but I fear you wont find much interest
here.

Regards,
Sebastian



 --
 Lester Caine - G8HFL
 -
 Contact - 
 http://lsces.co.uk/wiki/?page=**contacthttp://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
 Rainbow Digital Media - 
 http://rainbowdigitalmedia.co.**ukhttp://rainbowdigitalmedia.co.uk

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




-- 
github.com/KingCrunch
---End Message---
---BeginMessage---

Sebastian Krebs wrote:

With composer being pushed as the 'in way to go' and not being able to see
how to get some code relating to bootstrap and smarty development because
the links only show composer I've downloaded a plug-in for eclipse that is
supposed to handle that. But it's not working as I expect, and while
heading over to the plug-ins developers is the obvious step, what I'd
actually prefer is a more general PHP/Eclipse list to discuss general IDE
problems rather than even PDT biased discussions.

Is there a suitable list? And if not is there any interest in setting one
up? ... at the risk of proliferating even more lists ...


I for myself switched over to PhpStorm from Eclipse/PDT and I fear meany
hear use either PhpStorm, or Netbeans in the meantime. I'm not saying, that
nobody is using Eclipse/PDT anymore, but I fear you wont find much interest
here.


I'm still on PHPEclipse for PHP. PDT just does not work for me, and neither did 
Netbeans for some of the other languages I have to live with, which is why 
PHPStorm is no use either. I need python in addition to C/C++ with document 
handling, and firebird which don't get any support from either so Eclipse is 
really my only option.


--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
---End Message---
---BeginMessage---
2013/8/24 Lester Caine les...@lsces.co.uk

 Sebastian Krebs wrote:

 With composer being pushed as the 'in way to go' and not being able to see
 how to get some code relating to bootstrap and smarty development
 because
 the links only show composer I've downloaded a plug-in for eclipse that
 is
 supposed to handle that. But it's not working as I expect, and while
 heading over to the plug-ins developers is the obvious step, what I'd
 actually prefer is a more general PHP/Eclipse list to discuss general
 IDE
 problems rather than even PDT biased discussions.
 
 Is there a suitable list? And if not is there any interest in setting
 one
 up? ... at the risk of proliferating even more lists ...


 I for myself switched over to PhpStorm from Eclipse/PDT and I fear meany
 hear use either PhpStorm, or Netbeans in the meantime. I'm not saying,
 that
 nobody is using Eclipse/PDT anymore, but I fear you wont find much
 interest
 here.


 I'm still on PHPEclipse for PHP. PDT just does not work for me, and
 neither did Netbeans for some of the other languages I have to live with,
 which is why PHPStorm is no use either.


PHPEclipse is still in development? O_o The last time I noticed it, it
looked abandoned. However, if it works for you

php-general Digest 26 Aug 2013 03:41:12 -0000 Issue 8344

2013-08-25 Thread php-general-digest-help

php-general Digest 26 Aug 2013 03:41:12 - Issue 8344

Topics (messages 321965 through 321965):

exec and system do not work
321965 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---

Dear List -

I'm lost on this one -

This works -

$out = system(ls -l ,$retvals);
printf(%s, $out);

This does -

echo exec(ls -l);

This does not -

if( !file_exists(/var/www/orders.txt));
{
   $out = system(touch /var/www/orders.txt, $ret);
   $out2 = system(chmod 766 /var/www/orders.txt, $ret);
   echo 'file2br /';
   echo file_exists(/var/www/orders.txt);
}

and this does not -

if( !file_exists(/var/www/orders.txt));
{
   exec(touch /var/www/orders.txt);
   exec(chmod 766 /var/www/orders.txt);
   echo 'file2br /';
   echo file_exists(/var/www/orders.txt);
}

Ethan
---End Message---


php-general Digest 24 Aug 2013 11:45:26 -0000 Issue 8342

2013-08-24 Thread php-general-digest-help

php-general Digest 24 Aug 2013 11:45:26 - Issue 8342

Topics (messages 321955 through 321959):

Re: windows files and folders permission
321955 by: Carlos Medina

files and folders windows permission
321956 by: Emiliano Boragina
321957 by: Matijn Woudt
321958 by: Maciek Sokolewicz

Alternate list for eclipse ide support?
321959 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


--
---BeginMessage---
Hola Emiliano,
i think you should to redefine your question because i can not
understand what you want. Please post parts of the code, examples,
errors, etc.

regards

Carlos Medina

Am 23.08.2013 06:28, schrieb Emiliano Boragina:
 Night everyone, I did a upload page and when upload a JPG file this is not
 available. Why this happens? Thanks a lot.
 
 
 Emiliano Boragina | gráfico + web
 desarrollos  comunicación
 
 + 15 33 92 60 02
 » emiliano.borag...@gmail.com
 
 © 2013
 
 
 

---End Message---
---BeginMessage---
Hi everyone, sorry my ugly english. I did an upload file form. Works
very good. Upload the files in the right folder, with the right name.
I use chmod 0644, and for try I use 0777. But always the files are
copyed blocked. I cant see them with windows preview for example. I
read in forums that is Windows fault. How can I fix this? Thanks a
lot.

-- 

Emiliano Boragina | gráfico + web
desarrollos  comunicación

+ 15 33 92 60 02
» emiliano.borag...@gmail.com

© 2013

---End Message---
---BeginMessage---
On Fri, Aug 23, 2013 at 4:03 PM, Emiliano Boragina 
emiliano.borag...@gmail.com wrote:

 Hi everyone, sorry my ugly english. I did an upload file form. Works
 very good. Upload the files in the right folder, with the right name.
 I use chmod 0644, and for try I use 0777. But always the files are
 copyed blocked. I cant see them with windows preview for example. I
 read in forums that is Windows fault. How can I fix this? Thanks a
 lot.

 Code?
---End Message---
---BeginMessage---

On 23-8-2013 16:37, Matijn Woudt wrote:

On Fri, Aug 23, 2013 at 4:03 PM, Emiliano Boragina 
emiliano.borag...@gmail.com wrote:


Hi everyone, sorry my ugly english. I did an upload file form. Works
very good. Upload the files in the right folder, with the right name.
I use chmod 0644, and for try I use 0777. But always the files are
copyed blocked. I cant see them with windows preview for example. I
read in forums that is Windows fault. How can I fix this? Thanks a
lot.

Code?




On a sidenote, how the hell did you manage to chmod files on _windows_ ???
---End Message---
---BeginMessage---
With composer being pushed as the 'in way to go' and not being able to see how 
to get some code relating to bootstrap and smarty development because the links 
only show composer I've downloaded a plug-in for eclipse that is supposed to 
handle that. But it's not working as I expect, and while heading over to the 
plug-ins developers is the obvious step, what I'd actually prefer is a more 
general PHP/Eclipse list to discuss general IDE problems rather than even PDT 
biased discussions.


Is there a suitable list? And if not is there any interest in setting one up? 
... at the risk of proliferating even more lists ...


--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
---End Message---


php-general Digest 22 Aug 2013 15:34:18 -0000 Issue 8340

2013-08-22 Thread php-general-digest-help

php-general Digest 22 Aug 2013 15:34:18 - Issue 8340

Topics (messages 321944 through 321952):

Re: PHP vs JAVA
321944 by: David Harkness
321945 by: Sebastian Krebs
321952 by: David Harkness

Re: Off the wall - sub-domain question
321946 by: Curtis Maurand
321947 by: Jim Giner
321948 by: Willie
321949 by: Jim Giner
321950 by: Dan McCullough
321951 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


--
---BeginMessage---
On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand cur...@maurand.com wrote:

 Sebastian Krebs wrote:

 Actually the problem is, that the dot . is already in use. With

 $foo.bar() you cannot tell, if you want to call the method bar() on the
  object $foo, or if you want to concatenate the value of $foo to the
  result of the function bar(). There is no other way around this than a
  different operator for method calls.

 I didn't think
 of that.  It seems to me there could be an easier operator than -
 which sometimes will make me stop and look at what keys I'm trying to
 hit.  Just a thought.  I forgot about the concatenation operator
 which is + in Java/C#


The PHP language developers were pretty stuck. Because of automatic
string-to-numeric-conversion, they couldn't use + for string concatenation.
Sadly, they chose . rather than .. which I believe one or two other
languages use. If they had, . would have been available once objects
rolled around in PHP 4/5. I suspect they chose - since that's used in C
and C++ to dereference a pointer.


  Ever tried the jetbrains products? :D (No, they don't pay me)

 I have not, but it looks interesting.
 I'll have to try it.


Those are very good products which have had a strong following for a
decade. The free IDE NetBeans also has quite good support for both Java and
PHP, and the latest beta version provides a web project that provides
front- and back-end debugging of PHP + JavaScript. You can be stepping
through JS code and hit an AJAX call and then seamlessly step through the
PHP code that handles it.

I use NetBeans for PHP/HTML/JS (though I am evaluating JetBrains' PHPStorm
now) and Eclipse for Java. You can't beat Eclipse's refactoring support in
a free tool, though I think NetBeans is close to catching up. I would bet
IntelliJ IDEA for Java by JetBrains is on par at least.

Peace,
David
---End Message---
---BeginMessage---
2013/8/22 David Harkness davi...@highgearmedia.com

 On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand cur...@maurand.comwrote:

 Sebastian Krebs wrote:

  Actually the problem is, that the dot . is already in use. With

   $foo.bar() you cannot tell, if you want to call the method bar() on
 the
  object $foo, or if you want to concatenate the value of $foo to the
  result of the function bar(). There is no other way around this than a
  different operator for method calls.

 I didn't think
 of that.  It seems to me there could be an easier operator than -
 which sometimes will make me stop and look at what keys I'm trying to
 hit.  Just a thought.  I forgot about the concatenation operator
 which is + in Java/C#


 The PHP language developers were pretty stuck. Because of automatic
 string-to-numeric-conversion, they couldn't use + for string concatenation.
 Sadly, they chose . rather than .. which I believe one or two other
 languages use. If they had, . would have been available once objects
 rolled around in PHP 4/5. I suspect they chose - since that's used in C
 and C++ to dereference a pointer.


Actually I think .. is quite error-prone, because it is hard to
distinguish from . or _ on the _first_ glance, which makes the get
quickly through the code. [1]
So . is maybe not the best choice, but also remember when it was
introduced: That was decades ago. That time it was (probably ;)) the best
choice and nowadays I don't think it is too bad at all, beside that _other_
languages use it for other purposes now ;)


[1] Yes, I know, that _ is not an operator, but mixed with strings and
variables names it is there ;)




  Ever tried the jetbrains products? :D (No, they don't pay me)

 I have not, but it looks interesting.
 I'll have to try it.


 Those are very good products which have had a strong following for a
 decade. The free IDE NetBeans also has quite good support for both Java and
 PHP, and the latest beta version provides a web project that provides
 front- and back-end debugging of PHP + JavaScript. You can be stepping
 through JS code and hit an AJAX call and then seamlessly step through the
 PHP code that handles it.

 I use NetBeans for PHP/HTML/JS (though I am evaluating JetBrains' PHPStorm
 now) and Eclipse for Java. You can't beat Eclipse's

php-general Digest 23 Aug 2013 04:28:41 -0000 Issue 8341

2013-08-22 Thread php-general-digest-help

php-general Digest 23 Aug 2013 04:28:41 - Issue 8341

Topics (messages 321953 through 321954):

PHP 5.4.19 and PHP 5.5.3 Released!
321953 by: Stas Malyshev

windows files and folders permission
321954 by: Emiliano Boragina

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---
Hello!

The PHP development team announces the immediate availability of PHP
5.4.19 and PHP 5.5.3. These releases fix a bug in the patch for
CVE-2013-4248 in OpenSSL module and compile failure with ZTS enabled in
PHP 5.4, which were introduced in previously released 5.4.18 and 5.5.2.

All PHP users are encouraged to upgrade to either PHP 5.5.3 or PHP 5.4.19.

For source downloads of PHP 5.4.19 and PHP 5.5.3 please visit our
downloads page:

http://www.php.net/downloads.php

Windows binaries can be found on:

http://windows.php.net/download/

The list of changes is recorded in the ChangeLog at:

http://www.php.net/ChangeLog-5.php

Regards,

Stanislav Malyshev
PHP 5.4 Release Manager
---End Message---
---BeginMessage---
Night everyone, I did a upload page and when upload a JPG file this is not
available. Why this happens? Thanks a lot.


Emiliano Boragina | gráfico + web
desarrollos  comunicación

+ 15 33 92 60 02
» emiliano.borag...@gmail.com

© 2013



---End Message---


php-general Digest 22 Aug 2013 02:56:29 -0000 Issue 8339

2013-08-21 Thread php-general-digest-help

php-general Digest 22 Aug 2013 02:56:29 - Issue 8339

Topics (messages 321937 through 321943):

Re: PHP vs JAVA
321937 by: georg chambert
321938 by: Sebastian Krebs
321939 by: Stuart Dallas
321940 by: Curtis Maurand
321942 by: Sebastian Krebs
321943 by: Curtis Maurand

Off the wall - sub-domain question
321941 by: Jim Giner

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---

Hi,

my I shake the subject a little; Ive been doing some PHP and found it ok 
to work with

not so much fuss, but that was PHP4, what about PHP5 ?
Dont really checked the difference but made a short-scan and found that it 
had be

screwed around with ?

Any think, should I change to 5 ?

BR georg

- Original Message - 
From: Tim Streater t...@clothears.org.uk

To: PHP List phpl...@arashidigital.com; php-gene...@lists.php.net
Sent: Wednesday, August 21, 2013 1:59 PM
Subject: [PHP] Re: PHP vs JAVA


On 20 Aug 2013 at 23:59, PHP List phpl...@arashidigital.com wrote:


While I don't have any references to back it up - my guess would be that
Java may be seen as more versatile in general programming terms.  A
staggering number of enterprise level web applications are built with
Java, add to that the possibility of writing Android apps with the same
knowledge.


To me the salient point is, does java has as extensive a library or set of 
interfaces to other packages (such as SQLite, mysql, etc)?



I would say that, in general, the other teacher is incorrect speaking
strictly in terms of web development.  PHP has already won that crown
many times over.  That said, when I was in University, it was difficult
to find a programming class that taught anything but Java - and that was
10yrs ago now.  I chalked it up to the education bubble not being able
to see what the rest of the world is actually doing.


Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking 
down its nose at PHP. There being lots of courses proves nothing in and of 
itself. 20 years ago, there were lots of PC mags you could buy, which caused 
some folks to say look how much better the PC is supported than other 
platforms. Truth was, at the time, such support was needed given the mess 
of 640k limits, DOS, IRQs and the like, most of which issues have ceased to 
be relevant.


Anyway, why should one need a course to learn PHP, assuming you already know 
other languages. It's simple enough.


--
Cheers  --  Tim








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


---End Message---
---BeginMessage---
2013/8/21 georg chambert georg.chamb...@telia.com

 Hi,

 my I shake the subject a little; Ive been doing some PHP and found it ok
 to work with
 not so much fuss, but that was PHP4, what about PHP5 ?
 Dont really checked the difference but made a short-scan and found that it
 had be
 screwed around with ?

 Any think, should I change to 5 ?


ehm ... serious?
http://php.net/eol.php



 BR georg

 - Original Message - From: Tim Streater t...@clothears.org.uk
 To: PHP List phpl...@arashidigital.com; php-gene...@lists.php.net
 Sent: Wednesday, August 21, 2013 1:59 PM
 Subject: [PHP] Re: PHP vs JAVA



 On 20 Aug 2013 at 23:59, PHP List phpl...@arashidigital.com wrote:

  While I don't have any references to back it up - my guess would be that
 Java may be seen as more versatile in general programming terms.  A
 staggering number of enterprise level web applications are built with
 Java, add to that the possibility of writing Android apps with the same
 knowledge.


 To me the salient point is, does java has as extensive a library or set of
 interfaces to other packages (such as SQLite, mysql, etc)?

  I would say that, in general, the other teacher is incorrect speaking
 strictly in terms of web development.  PHP has already won that crown
 many times over.  That said, when I was in University, it was difficult
 to find a programming class that taught anything but Java - and that was
 10yrs ago now.  I chalked it up to the education bubble not being able
 to see what the rest of the world is actually doing.


 Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking
 down its nose at PHP. There being lots of courses proves nothing in and of
 itself. 20 years ago, there were lots of PC mags you could buy, which
 caused some folks to say look how much better the PC is supported than
 other platforms. Truth was, at the time, such support was needed given the
 mess of 640k limits, DOS, IRQs and the like, most of which issues have
 ceased

php-general Digest 20 Aug 2013 14:00:35 -0000 Issue 8337

2013-08-20 Thread php-general-digest-help

php-general Digest 20 Aug 2013 14:00:35 - Issue 8337

Topics (messages 321880 through 321890):

Re: Mysqli Extension
321880 by: Matijn Woudt
321881 by: Curtis Maurand
321882 by: Ashley Sheridan
321884 by: Matijn Woudt
321885 by: Ashley Sheridan
321886 by: Daniel P. Brown
321887 by: Matijn Woudt
321888 by: Curtis Maurand
321889 by: Lester Caine

Re: How can I submit more than 2000 items of data?
321883 by: Robert Cummings

PHP vs JAVA
321890 by: Tedd Sperling

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 Mon, Aug 19, 2013 at 8:02 PM, Ethan Rosenberg 
erosenb...@hygeiabiomedical.com wrote:

 Dear List -

 My mysqli extension seems to have gone away.

 $host = 'localhost';
 $user = 'root';
 $password = 'SdR3908';
 echo hello2br /;
 var_dump(function_exists('**mysqli_connect'));// this returns boo(false)
 $db = 'Store';
 $cxn = mysqli_connect($host,$user,$**password,$db);

 I tried to reinstall -

 rosenberg:/home/ethan#  apt-get install php5-common libapache2-mod-php5
 php5-cli
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 libapache2-mod-php5 is already the newest version.
 libapache2-mod-php5 set to manually installed.
 php5-cli is already the newest version.
 php5-cli set to manually installed.
 php5-common is already the newest version.
 php5-common set to manually installed.
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 It did not help.

 TIA

 Ethan


apt-get install php5-mysql

If that doesn't help, there's something wrong with your configuration of
the modules.

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


Ethan Rosenberg wrote:
 Dear List -
 
 My
mysqli extension seems to have gone away.
 
 $host =
'localhost';
 $user = 'root';
 $password = 'SdR3908';
 echo hello2br /;

var_dump(function_exists('mysqli_connect'));// this returns boo(false)
 $db = 'Store';
 $cxn =
mysqli_connect($host,$user,$password,$db);
 
 I tried to
reinstall -
 
 rosenberg:/home/ethan#  apt-get install
php5-common libapache2-mod-php5
 php5-cli
 Reading
package lists... Done
 Building dependency tree
 Reading
state information... Done
 libapache2-mod-php5 is already the
newest version.
 libapache2-mod-php5 set to manually
installed.
 php5-cli is already the newest version.

php5-cli set to manually installed.
 php5-common is already the
newest version.
 php5-common set to manually installed.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


 It did not help.
 
 TIA
 

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


Found
this in ubuntu forums.

http://ubuntuforums.org/showthread.php?t=1814736


sudo apt-get install
php5-mysql
This package contains the PHP module that interfaces with the MySQL
server.



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


Curtis Maurand cur...@maurand.com wrote:


Ethan Rosenberg wrote:
 Dear List -
 
 My
mysqli extension seems to have gone away.
 
 $host =
'localhost';
 $user = 'root';
 $password = 'SdR3908';
 echo hello2br /;

var_dump(function_exists('mysqli_connect'));// this returns boo(false)
 $db = 'Store';
 $cxn =
mysqli_connect($host,$user,$password,$db);
 
 I tried to
reinstall -
 
 rosenberg:/home/ethan#  apt-get install
php5-common libapache2-mod-php5
 php5-cli
 Reading
package lists... Done
 Building dependency tree
 Reading
state information... Done
 libapache2-mod-php5 is already the
newest version.
 libapache2-mod-php5 set to manually
installed.
 php5-cli is already the newest version.

php5-cli set to manually installed.
 php5-common is already the
newest version.
 php5-common set to manually installed.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


 It did not help.
 
 TIA
 

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


Found
this in ubuntu forums.

http://ubuntuforums.org/showthread.php?t=1814736


sudo apt-get install
php5-mysql
This package contains the PHP module that interfaces with the MySQL
server.

Could it be that the mysql service on the server has stopped. Typically you'd 
do something like this on RedHat/Fedora servers:

service mysqld status

That would certainly stop the extension working from within PHP.

Thanks,
Ash
---End Message---
---BeginMessage---
On Mon, Aug 19, 2013 at 8:55 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:



 Curtis Maurand cur...@maurand.com wrote:
 
 
 Ethan Rosenberg wrote:
  Dear List -
 
  My
 mysqli extension seems to have gone away.
 
  $host =
 'localhost';
  $user = 'root';
  $password = 'SdR3908

php-general Digest 19 Aug 2013 06:07:22 -0000 Issue 8335

2013-08-19 Thread php-general-digest-help

php-general Digest 19 Aug 2013 06:07:22 - Issue 8335

Topics (messages 321856 through 321860):

Re: Finally
321856 by: Daniel

how old is this version of PHP?
321857 by: Tamara Temple
321858 by: Camilo Sperberg
321859 by: Tamara Temple
321860 by: Larry Garfield

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---
Yay, Thankyou :)
Regards,
Daniel Fenn






On Sat, Aug 17, 2013 at 2:30 AM, Robert Cummings rob...@interjinn.com wrote:
 On 13-08-16 11:58 AM, Marc Guay wrote:

 Those Belgacom emails were the only thing keeping me from a crushing
 loneliness - undo!


 *sniffle* Another friend bites the dust *sniffle*.


 --
 E-Mail Disclaimer: Information contained in this message and any
 attached documents is considered confidential and legally protected.
 This message is intended solely for the addressee(s). Disclosure,
 copying, and distribution are prohibited unless authorized.


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

---End Message---
---BeginMessage---
Looking into a problem for someone who is using Godaddy Shared Web Hosting (I 
know..), I noticed the version tag reported by phpinfo is: 


PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519

Just how old is this version of PHP??


---End Message---
---BeginMessage---
On 16 aug. 2013, at 19:17, Tamara Temple tamouse.li...@gmail.com wrote:

 Looking into a problem for someone who is using Godaddy Shared Web Hosting (I 
 know..), I noticed the version tag reported by phpinfo is: 
 
 
 PHP API   20041225
 PHP Extension 20060613
 Zend Extension220060519
 
 Just how old is this version of PHP??
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

According to my google search, it should be 5.2.9, so it isn't that old:


http://devzone.zend.com/1442/compiling-php-extensions-with-zend-server/

CD onto the extension's source dir (in our example, the PHP version is 5.2.9 as 
it is the current stable version Zend Server is shipped with):

$ cd /usr/local/zend/share/php-source/php-5.2.9/ext/pspell
Run phpize:

$ /usr/local/zend/bin/phpize
Output should be similar to this:

/Configuring for:
PHP Api Version: 20041225
Zend Module Api No:  20060613
Zend Extension Api No:   220060519/


Greetings.


Met vriendelijke groet,
Camilo Sperberg


W: http://unreal4u.com
T: http://twitter.com/unreal4u

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

On Aug 17, 2013, at 6:26 PM, Camilo Sperberg unrea...@gmail.com wrote:

 On 16 aug. 2013, at 19:17, Tamara Temple tamouse.li...@gmail.com wrote:
 
 Looking into a problem for someone who is using Godaddy Shared Web Hosting 
 (I know..), I noticed the version tag reported by phpinfo is: 
 
 
 PHP API  20041225
 PHP Extension20060613
 Zend Extension   220060519
 
 Just how old is this version of PHP??
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 According to my google search, it should be 5.2.9, so it isn't that old:
 
 
 http://devzone.zend.com/1442/compiling-php-extensions-with-zend-server/
 
 CD onto the extension's source dir (in our example, the PHP version is 5.2.9 
 as it is the current stable version Zend Server is shipped with):
 
 $ cd /usr/local/zend/share/php-source/php-5.2.9/ext/pspell
 Run phpize:
 
 $ /usr/local/zend/bin/phpize
 Output should be similar to this:
 
 /Configuring for:
 PHP Api Version: 20041225
 Zend Module Api No:  20060613
 Zend Extension Api No:   220060519/

That would be neat if there was any shell access.

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

On 08/17/2013 06:26 PM, Camilo Sperberg wrote:

On 16 aug. 2013, at 19:17, Tamara Temple tamouse.li...@gmail.com wrote:


Looking into a problem for someone who is using Godaddy Shared Web Hosting (I 
know..), I noticed the version tag reported by phpinfo is:


PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519

Just how old is this version of PHP??



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


According to my google search, it should be 5.2.9, so it isn't that old:


5.2.9 was released in February of 2009.  5.2 is completely retired and 
out of support.  5.3 is on security-only life-support.  5.4 is the 
legacy stable release.


Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into 
this decade.  (GoDaddy apparently doesn't meet that qualification.) 
You're doing clients a disservice

php-general Digest 19 Aug 2013 18:32:01 -0000 Issue 8336

2013-08-19 Thread php-general-digest-help

php-general Digest 19 Aug 2013 18:32:01 - Issue 8336

Topics (messages 321861 through 321879):

How can I submit more than 2000 items of data?
321861 by: aesbovis
321862 by: Mihai Anghel
321863 by: Szopen Xiao
321864 by: Jan Ehrhardt
321866 by: aesbovis
321867 by: aesbovis
321868 by: Stuart Dallas
321873 by: Matijn Woudt
321874 by: Stuart Dallas
321875 by: Matijn Woudt
321876 by: Stuart Dallas
321877 by: Tedd Sperling

Re: how old is this version of PHP?
321865 by: Thomas Punt
321869 by: Lester Caine
321870 by: Jeff Burcher
321871 by: Sebastian Krebs
321872 by: Lester Caine
321878 by: Larry Garfield

Mysqli Extension
321879 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---
Hello there
I am making a little web-based-tool for our studio to progress a large
amount of data, more than 2000 items, but it seems there is a length limit
of 1000 to $_POST.

How can I submit all of the items in one time?

Thank you!
aesbovis

-- 
*Anywhere @aesbovis!*
---End Message---
---BeginMessage---
Check this http://www.php.net/manual/en/ini.core.php#ini.post-max-size


On Mon, Aug 19, 2013 at 9:55 AM, aesbovis aesbo...@gmail.com wrote:

 Hello there
 I am making a little web-based-tool for our studio to progress a large
 amount of data, more than 2000 items, but it seems there is a length limit
 of 1000 to $_POST.

 How can I submit all of the items in one time?

 Thank you!
 aesbovis

 --
 *Anywhere @aesbovis!*

---End Message---
---BeginMessage---
you can use JSON post

2013/8/19 aesbovis aesbo...@gmail.com:
 Hello there
 I am making a little web-based-tool for our studio to progress a large
 amount of data, more than 2000 items, but it seems there is a length limit
 of 1000 to $_POST.

 How can I submit all of the items in one time?

 Thank you!
 aesbovis

 --
 *Anywhere @aesbovis!*
---End Message---
---BeginMessage---
Mihai Anghel in php.general (Mon, 19 Aug 2013 11:30:01 +0300):
Check this http://www.php.net/manual/en/ini.core.php#ini.post-max-size

Keyword: max_input_vars.

Jan
---End Message---
---BeginMessage---
T
hank you, it works now.


On Mon, Aug 19, 2013 at 5:09 PM, Jan Ehrhardt php...@ehrhardt.nl wrote:

 Mihai Anghel in php.general (Mon, 19 Aug 2013 11:30:01 +0300):
 Check this http://www.php.net/manual/en/ini.core.php#ini.post-max-size

 Keyword: max_input_vars.

 Jan

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




-- 
*Anywhere @aesbovis!*
---End Message---
---BeginMessage---
I know Javascript can solve it, but I don't want to use Js.
Thank you all the same.


On Mon, Aug 19, 2013 at 4:32 PM, Szopen Xiao chopins.x...@gmail.com wrote:

 you can use JSON post

 2013/8/19 aesbovis aesbo...@gmail.com:
  Hello there
  I am making a little web-based-tool for our studio to progress a large
  amount of data, more than 2000 items, but it seems there is a length
 limit
  of 1000 to $_POST.
 
  How can I submit all of the items in one time?
 
  Thank you!
  aesbovis
 
  --
  *Anywhere @aesbovis!*




-- 
*Anywhere @aesbovis!*
---End Message---
---BeginMessage---
On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:

 I know Javascript can solve it, but I don't want to use Js.
 Thank you all the same.

I know you've had the right answer, but I think it's worth pointing out that 
use of JSON in no way requires Javascript, despite its name.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

 On Mon, Aug 19, 2013 at 4:32 PM, Szopen Xiao chopins.x...@gmail.com wrote:
 
 you can use JSON post
 
 2013/8/19 aesbovis aesbo...@gmail.com:
 Hello there
 I am making a little web-based-tool for our studio to progress a large
 amount of data, more than 2000 items, but it seems there is a length
 limit
 of 1000 to $_POST.
 
 How can I submit all of the items in one time?
 
 Thank you!
 aesbovis
 
 --
 *Anywhere @aesbovis!*
 
 
 
 
 -- 
 *Anywhere @aesbovis!*

---End Message---
---BeginMessage---
On Mon, Aug 19, 2013 at 11:54 AM, Stuart Dallas stu...@3ft9.com wrote:

 On 19 Aug 2013, at 10:49, aesbovis aesbo...@gmail.com wrote:

  I know Javascript can solve it, but I don't want to use Js.
  Thank you all the same.

 I know you've had the right answer, but I think it's worth pointing out
 that use of JSON in no way requires Javascript, despite its name.

 -Stuart


You might want to explain how you convert form data to JSON without
javascript?
---End Message---
---BeginMessage---
On 19 Aug 2013, at 15:56, Matijn Woudt tijn...@gmail.com wrote:

 
 On Mon, Aug 19, 2013 at 11:54 AM, Stuart

php-general Digest 17 Aug 2013 20:04:00 -0000 Issue 8334

2013-08-17 Thread php-general-digest-help

php-general Digest 17 Aug 2013 20:04:00 - Issue 8334

Topics (messages 321850 through 321855):

Finally
321850 by: Daniel Brown
321851 by: Matijn Woudt
321852 by: Marc Guay
321853 by: Tamara Temple
321854 by: Robert Cummings
321855 by: Kevin Kinsey

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---
# ezmlm-list ~ezmlm/php-general | grep skynet
supp...@skynet.be

# ezmlm-unsub ~ezmlm/php-general supp...@skynet.be

# ezmlm-list ~ezmlm/php-general | grep skynet
#

No more of those Your e-mail concerning our products and
services autoreplies from the Belgacom Webteam.  Sorry it took me
this long to realize it and get around to it.

Happy Friday.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/
---End Message---
---BeginMessage---
On Fri, Aug 16, 2013 at 5:23 PM, Daniel Brown danbr...@php.net wrote:

 # ezmlm-list ~ezmlm/php-general | grep skynet
 supp...@skynet.be

 # ezmlm-unsub ~ezmlm/php-general supp...@skynet.be

 # ezmlm-list ~ezmlm/php-general | grep skynet
 #

 No more of those Your e-mail concerning our products and
 services autoreplies from the Belgacom Webteam.  Sorry it took me
 this long to realize it and get around to it.

 Happy Friday.

 Daniel,

Thank you, thank you, thank you ;)
---End Message---
---BeginMessage---
Those Belgacom emails were the only thing keeping me from a crushing
loneliness - undo!


On 16 August 2013 11:51, Matijn Woudt tijn...@gmail.com wrote:
 On Fri, Aug 16, 2013 at 5:23 PM, Daniel Brown danbr...@php.net wrote:

 # ezmlm-list ~ezmlm/php-general | grep skynet
 supp...@skynet.be

 # ezmlm-unsub ~ezmlm/php-general supp...@skynet.be

 # ezmlm-list ~ezmlm/php-general | grep skynet
 #

 No more of those Your e-mail concerning our products and
 services autoreplies from the Belgacom Webteam.  Sorry it took me
 this long to realize it and get around to it.

 Happy Friday.

 Daniel,

 Thank you, thank you, thank you ;)
---End Message---
---BeginMessage---

On Aug 16, 2013, at 10:58 AM, Marc Guay marc.g...@gmail.com wrote:

 Those Belgacom emails were the only thing keeping me from a crushing
 loneliness - undo!

I'll place a forward on my other spam…


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

On 13-08-16 11:58 AM, Marc Guay wrote:

Those Belgacom emails were the only thing keeping me from a crushing
loneliness - undo!


*sniffle* Another friend bites the dust *sniffle*.


--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
---End Message---
---BeginMessage---
Date: Fri, 16 Aug 2013 11:23:18 -0400
From: Daniel Brown danbr...@php.net
To: PHP General php-gene...@lists.php.net
Subject: [PHP] Finally

# ezmlm-list ~ezmlm/php-general | grep skynet
supp...@skynet.be

# ezmlm-unsub ~ezmlm/php-general supp...@skynet.be

# ezmlm-list ~ezmlm/php-general | grep skynet
#

No more of those Your e-mail concerning our products and
services autoreplies from the Belgacom Webteam.  Sorry it took me
this long to realize it and get around to it.

Happy Friday.

Aunt AMaViS says, What autoreplies?

;) ;)

Kevin Kinsey
---End Message---


php-general Digest 16 Aug 2013 15:08:25 -0000 Issue 8333

2013-08-16 Thread php-general-digest-help

php-general Digest 16 Aug 2013 15:08:25 - Issue 8333

Topics (messages 321848 through 321849):

Re: Session_unset - session_destroy issue
321848 by: Stuart Dallas

Re: How to upstream code changes to php community
321849 by: Daniel Brown

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 15 Aug 2013, at 19:16, dealTek deal...@gmail.com wrote:

 Hi all,
 
 I am having trouble with session_destroy - session_unset and $_SESSION = 
 array()... I am trying to STOP and destroy all session vars..
 
 
 with the simple code test below I would think it would echo test 1 BUT FAIL 
 on test2 
 - however it shows both for me...
 
 how do I UNSET - DESTROY SESSIONS?
 
 
 ?php
 
 
 session_start();
 
 $_SESSION['var1'] = 'test1';
 echo 'br / test1 '. $_SESSION['var1'].' ';
 
 session_unset();
 session_destroy();
 $_SESSION = array();
 
 
 $_SESSION['var1'] = 'test2';
 
 echo 'br / test2 ' . $_SESSION['var1'];
 
 
 
 ?

The $_SESSION superglobal variable is nothing more than that. Calling 
session_start will populate it with an existing session, and when the request 
ends the contents will be stored. Once you've closed or destroyed the session 
it does not stop working because it's nothing more than a superglobal variable, 
it just won't be stored at the end of the request.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/---End Message---
---BeginMessage---
On Tue, Aug 13, 2013 at 12:38 AM, Shahina Rabbani
shahinarabbani.sh...@gmail.com wrote:
 Hi,

 I have done some modifications to the php source code and i tested it with
 php bench and I observed  some improvement.

 I wanted to upstream these code changes to PHP community.
 I searched the wed but i didnt find proper guide to upstream the code to
 php.

 Please help me by  providing the information how to upstream my code
 changes to php  source code community.

Start by subscribing to intern...@lists.php.net and introducing
yourself on that list, which is intended for the discussion of the
ongoing development of the runtime and related things.  You may also
want to hop on EFNet and join #php.pecl, which - like internals@ - is
specifically for discussion of furthering the core development (not
for any time of support).

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


php-general Digest 15 Aug 2013 18:16:40 -0000 Issue 8332

2013-08-15 Thread php-general-digest-help

php-general Digest 15 Aug 2013 18:16:40 - Issue 8332

Topics (messages 321843 through 321847):

Re: How to upstream code changes to php community
321843 by: David Robley

filesize() fails on file and works on it's copy (same permissions, same 
directory)
321844 by: Michał Kochanowicz

Why the difference in email transit times?
321845 by: Tedd Sperling
321846 by: Ian

Session_unset - session_destroy issue
321847 by: dealTek

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---
Shahina Rabbani wrote:

 Hi,
 
 I have done some modifications to the php source code and i tested it with
 php bench and I observed  some improvement.
 
 I wanted to upstream these code changes to PHP community.
 I searched the wed but i didnt find proper guide to upstream the code to
 php.
 
 Please help me by  providing the information how to upstream my code
 changes to php  source code community.
 
 
 Thanks,
 Shahina Rabbani

Start with https://github.com/php/php-
src/blob/master/README.SUBMITTING_PATCH which is linked from the Community 
menu item on the PHP home page.

-- 
Cheers
David Robley

Enter any 11-digit prime number to continue...

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

Hello

I've got a file, which can't be checked with filesize(). I copy it (with 
permissions) and then I can filesize() the copy. This is same directory, 
permissions are same. I don't understand what's the difference. Can you help me?


Original file:
  File: 'DSC_5196_fx-1553725666.JPG'
  Size: 1907383 Blocks: 3728   IO Block: 4096   regular file
Device: 803h/2051d  Inode: 5905591363  Links: 1
Access: (0644/-rw-r--r--)  Uid: (   51/http)   Gid: (   51/http)
Access: 2013-08-13 00:47:28.107477918 +0200
Modify: 2013-08-12 21:38:27.219913208 +0200
Change: 2013-08-13 00:47:08.931478654 +0200
 Birth: -

Copy:
  File: 'DSC_5196_fx-1553725666_X.JPG'
  Size: 1907383 Blocks: 3728   IO Block: 4096   regular file
Device: 803h/2051d  Inode: 144 Links: 1
Access: (0644/-rw-r--r--)  Uid: (   51/http)   Gid: (   51/http)
Access: 2013-08-13 00:45:48.0 +0200
Modify: 2013-08-12 21:38:27.0 +0200
Change: 2013-08-13 00:47:28.199477914 +0200
 Birth: -

The only difference is inode: (5905591363 - doesn't work vs 144 - does work).

Test script:

html
body
pre
?
$f3 = 
'/home/services/httpd/html.galeria.XXX/gallery/var/albums/988_Rok-2013/333_Rydzewo-04-06.08.2013/Sobota/DSC_5196_fx-1553725666.JPG';
$f4 = 
'/home/services/httpd/html.galeria.XXX/gallery/var/albums/988_Rok-2013/333_Rydzewo-04-06.08.2013/Sobota/DSC_5196_fx-1553725666_X.JPG';


print $f3.: .filesize($f3).\n;
print $f4.: .filesize($f4).\n;

?
/pre
/body
/html

Result:

Warning: filesize(): stat failed for 
/home/services/httpd/html.galeria.XXX/gallery/var/albums/988_Rok-2013/333_Rydzewo-04-06.08.2013/Sobota/DSC_5196_fx-1553725666.JPG 
in /home/services/httpd/html.galeria.michal.waw.pl/gallery3-3.0.x/test.php on 
line 13
/home/services/httpd/html.galeria.XXX/gallery/var/albums/988_Rok-2013/333_Rydzewo-04-06.08.2013/Sobota/DSC_5196_fx-1553725666.JPG: 

/home/services/httpd/html.galeria.XXX/gallery/var/albums/988_Rok-2013/333_Rydzewo-04-06.08.2013/Sobota/DSC_5196_fx-1553725666_X.JPG: 
1907383


Regards
Michał
---End Message---
---BeginMessage---
Hi gang:

I'm using the class.phpmailer.php code to send email -- it works neat -- very 
classy (no pun intended).

I can send an email from my sperling.com domain and it arrives almost 
immediately.

However, when I use the exact same code (except for the FROM address) from 
kvyv.com (another domain I own), the email literally takes hours (up to 12) to 
arrive.

Any idea of why there is a difference of email transit times between the two 
domains?

Cheers,

tedd

PS: Note, my receiving email addresses are handled by gmail.com.

___
tedd sperling
t...@sperling.com





---End Message---
---BeginMessage---
On 13/08/2013 16:20, Tedd Sperling wrote:
 Hi gang:
 
 I'm using the class.phpmailer.php code to send email -- it works neat -- very 
 classy (no pun intended).
 
 I can send an email from my sperling.com domain and it arrives almost 
 immediately.
 
 However, when I use the exact same code (except for the FROM address) from 
 kvyv.com (another domain I own), the email literally takes hours (up to 12) 
 to arrive.
 
 Any idea of why there is a difference of email transit times between the two 
 domains?
 
 Cheers,
 
 tedd
 
 PS: Note, my receiving email addresses are handled by gmail.com.

Hi,

Have a look at the Received: headers of each email.  They are in
reverse order.  I.e. the one at the top is the most recently added.

Take into account timezone

php-general Digest 12 Aug 2013 11:36:06 -0000 Issue 8330

2013-08-12 Thread php-general-digest-help

php-general Digest 12 Aug 2013 11:36:06 - Issue 8330

Topics (messages 321837 through 321840):

[PHP-GENERAL] gibberish output when using the loadHTMLFile() function.
321837 by: atar

gibberish output when using the loadHTMLFile() function.
321838 by: atar
321840 by: Maciek Sokolewicz

sessions working? not working?
321839 by: Clifford Shuker

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---

Hi there!!

When I'm trying to load an external html document with the loadHTMLFile()
function and then I use the saveHTML() function to output its content,
some text in the external html document which is written in hebrew is
displayed in a gibberish format. is anyone here has an idea how to solve
this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.
---End Message---
---BeginMessage---

Hi there!!

When I'm trying to load an external html document with the loadHTMLFile()  
function and then I use the saveHTML() function to output its content,  
some text in the external html document which is written in hebrew is  
displayed in a gibberish format. is anyone here has an idea how to solve  
this problem?


NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.
---End Message---
---BeginMessage---

On 12-8-2013 2:54, atar wrote:

Hi there!!

When I'm trying to load an external html document with the
loadHTMLFile() function and then I use the saveHTML() function to output
its content, some text in the external html document which is written in
hebrew is displayed in a gibberish format. is anyone here has an idea
how to solve this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.


First of all, stop triple-posting to each list. Choose one address, and 
stick to it.


As for your question; the character set needs to be announced as well as 
set. So to display in UTF-8, you need to:

1. make sure the document is actually encoded using the UTF-8 charset
2. make sure the browser recieves an HTTP header which tells it the 
content is in UTF-8: header('Content-type: text/html; charset=utf-8')
3. make sure the document itself states its encoding is UTF-8 (usually 
done using a meta http-equiv=Content-Type content=text/html; 
charset=utf8/


If your output conforms to all three of these, it will work. It probably 
does not conform to it however.

- Tul
- Tul
---End Message---
---BeginMessage---
Hi List,

 

Hi have the following (below) session code at the top of each page..  The
'print_r' (development feature only) confirms that on one particular page I
do log out as the session var = (). but, on testing that page via the URL I
still get to see the page and all its contents - session var() -..  the page
has the following  'session_start, DOCTYPE Info then htmlheadcontaining
meta info  title/headbodycontaining style/tables/content//body/html
// end of page.  I have copied the same page without the html content (i.e.
a blank page) and I get to fully log out.. when this page is tested in the
URL my warning comes up 'you need to login to see this page' which is what I
want but, I've tried numerous avenues to reconcile my problem to no avail..
I'm a novice so any help would be appreciated..   

 

?php

session_start();

error_reporting (E_ALL ^ E_NOTICE);

$userid = $_SESSION['userid'];

$username = $_SESSION['username'];

print_r($_SESSION);

?

---End Message---


php-general Digest 13 Aug 2013 04:38:44 -0000 Issue 8331

2013-08-12 Thread php-general-digest-help

php-general Digest 13 Aug 2013 04:38:44 - Issue 8331

Topics (messages 321841 through 321842):

Re: sessions working? not working?
321841 by: Tedd Sperling

How to upstream code changes to php community
321842 by: Shahina Rabbani

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 Aug 12, 2013, at 4:27 AM, Clifford Shuker clifford.shu...@ntlworld.com 
wrote:
 Hi have the following (below) session code at the top of each page..  The
 'print_r' (development feature only) confirms that on one particular page I
 do log out as the session var = (). but, on testing that page via the URL I
 still get to see the page and all its contents - session var() -..  the page
 has the following  'session_start, DOCTYPE Info then htmlheadcontaining
 meta info  title/headbodycontaining style/tables/content//body/html
 // end of page.  I have copied the same page without the html content (i.e.
 a blank page) and I get to fully log out.. when this page is tested in the
 URL my warning comes up 'you need to login to see this page' which is what I
 want but, I've tried numerous avenues to reconcile my problem to no avail..
 I'm a novice so any help would be appreciated..   
 
 
 
 ?php
 
 session_start();
 
 error_reporting (E_ALL ^ E_NOTICE);
 
 $userid = $_SESSION['userid'];
 
 $username = $_SESSION['username'];
 
 print_r($_SESSION);
 
 ?
 

Ok, but when are you populating the SESSION's? Such as:

$_SESSION['userid'] = $userid;

Also, have a look at this:

http://sperling.com/php/authorization/log-on.php

It might help.

tedd

___
tedd sperling
tedd.sperl...@gmail.com



---End Message---
---BeginMessage---
Hi,

I have done some modifications to the php source code and i tested it with
php bench and I observed  some improvement.

I wanted to upstream these code changes to PHP community.
I searched the wed but i didnt find proper guide to upstream the code to
php.

Please help me by  providing the information how to upstream my code
changes to php  source code community.


Thanks,
Shahina Rabbani
---End Message---


php-general Digest 11 Aug 2013 22:10:16 -0000 Issue 8329

2013-08-11 Thread php-general-digest-help

php-general Digest 11 Aug 2013 22:10:16 - Issue 8329

Topics (messages 321836 through 321836):

[php-general] gibberish output when using the loadHTMLFile() function.
321836 by: atar

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---

Hi there!!

When I'm trying to load an external html document with the loadHTMLFile()
function and then I use the saveHTML() function to output its content,
some text in the external html document which is written in hebrew is
displayed in a gibberish format. is anyone here has an idea how to solve
this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.
---End Message---


[PHP] [php-general] gibberish output when using the loadHTMLFile() function.

2013-08-11 Thread atar

Hi there!!

When I'm trying to load an external html document with the loadHTMLFile()
function and then I use the saveHTML() function to output its content,
some text in the external html document which is written in hebrew is
displayed in a gibberish format. is anyone here has an idea how to solve
this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.

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



php-general Digest 10 Aug 2013 14:42:50 -0000 Issue 8328

2013-08-10 Thread php-general-digest-help

php-general Digest 10 Aug 2013 14:42:50 - Issue 8328

Topics (messages 321825 through 321835):

Ambiguous?
321825 by: Karl-Arne Gjersøyen
321826 by: Stuart Dallas
321827 by: Floyd Resler
321828 by: richard gray

fpdf problem?
321829 by: Jim Giner
321830 by: Tamara Temple
321831 by: Jim Giner
321832 by: Jim Giner
321833 by: Jan Ehrhardt
321834 by: Jim Giner

'buffer sizes' ?
321835 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


--
---BeginMessage---
1) query
foreach($varenr_inn_pa_lager as $vnr){
include('../../tilkobling.php');
$sql = SELECT * FROM exan,dynamit WHERE varenr = '$vnr' LIMIT
1;
$resultat = mysql_query($sql, $tilkobling) or
die(mysql_error());

2) Result:
Column 'varenr' in where clause is ambiguous

3) Tables in MySQL database

mysql SELECT * FROM exan;
++-+---+--+--+-+
| leverandor | valgt_lager | un_nr | varenavn | varenr   | kg_pa_lager |
++-+---+--+--+-+

mysql SELECT * FROM dynamit;
++-+---++---+-++-+
| leverandor | valgt_lager | type  | dim_mm | un_nr |
varenavn| varenr | kg_pa_lager |
++-+---++---+-++-+

4) My question:
What means with ambiguous here?

Thanks.
Karl
---End Message---
---BeginMessage---
On 9 Aug 2013, at 13:00, Karl-Arne Gjersøyen karlar...@gmail.com wrote:

 1) query
 foreach($varenr_inn_pa_lager as $vnr){
include('../../tilkobling.php');
$sql = SELECT * FROM exan,dynamit WHERE varenr = '$vnr' LIMIT
 1;
$resultat = mysql_query($sql, $tilkobling) or
 die(mysql_error());
 
 2) Result:
 Column 'varenr' in where clause is ambiguous
 
 3) Tables in MySQL database
 
 mysql SELECT * FROM exan;
 ++-+---+--+--+-+
 | leverandor | valgt_lager | un_nr | varenavn | varenr   | kg_pa_lager |
 ++-+---+--+--+-+
 
 mysql SELECT * FROM dynamit;
 ++-+---++---+-++-+
 | leverandor | valgt_lager | type  | dim_mm | un_nr |
 varenavn| varenr | kg_pa_lager |
 ++-+---++---+-++-+
 
 4) My question:
 What means with ambiguous here?

The field exists in both tables, so you need to specify which one you mean.

Please learn how to use Google, it knows the answer to almost everything!

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/---End Message---
---BeginMessage---


On Aug 9, 2013, at 8:00 AM, Karl-Arne Gjersøyen karlar...@gmail.com wrote:

 1) query
 foreach($varenr_inn_pa_lager as $vnr){
include('../../tilkobling.php');
$sql = SELECT * FROM exan,dynamit WHERE varenr = '$vnr' LIMIT
 1;
$resultat = mysql_query($sql, $tilkobling) or
 die(mysql_error());
 
 2) Result:
 Column 'varenr' in where clause is ambiguous
 
 3) Tables in MySQL database
 
 mysql SELECT * FROM exan;
 ++-+---+--+--+-+
 | leverandor | valgt_lager | un_nr | varenavn | varenr   | kg_pa_lager |
 ++-+---+--+--+-+
 
 mysql SELECT * FROM dynamit;
 ++-+---++---+-++-+
 | leverandor | valgt_lager | type  | dim_mm | un_nr |
 varenavn| varenr | kg_pa_lager |
 ++-+---++---+-++-+
 
 4) My question:
 What means with ambiguous here?
 
 Thanks.
 Karl

Your field varenr is in both tables you are joining.  Therefore, MySQL 
doesn't know which table it should use the field from.  So, you need to qualify 
it by putting the table name in front of the field.  Such as:
SELECT * FROM exan,dynamit WHERE exan.varenr='$vnr' LIMIT 1

Take care,
Floyd

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


On 09/08/2013 14:00, Karl-Arne Gjersøyen wrote:

1) query
foreach($varenr_inn_pa_lager as $vnr){
 include('../../tilkobling.php');
 $sql = SELECT * FROM exan,dynamit WHERE varenr = '$vnr' LIMIT
1;
 $resultat = mysql_query($sql, $tilkobling) or
die(mysql_error());

2) Result:
Column 'varenr

php-general Digest 9 Aug 2013 10:25:32 -0000 Issue 8327

2013-08-09 Thread php-general-digest-help

php-general Digest 9 Aug 2013 10:25:32 - Issue 8327

Topics (messages 321817 through 321824):

Re: Operand error...
321817 by: Jim Giner
321818 by: Karl-Arne Gjersøyen
321819 by: Jim Giner
321820 by: Karl-Arne Gjersøyen
321821 by: Jim Giner
321822 by: Karl-Arne Gjersøyen
321823 by: Jim Giner

List problem again...
321824 by: Karl-Arne Gjersøyen

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 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:

$oppdater_lager_med_antall_kg = $kg_pa_lager +
$kg_fra_transportdokument_inn_pa_valgt_lager;


result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/index.php* on line *2970

*I have also tried this:
$kg_pa_lager += $kg_fra_transportdokument_inn_pa_valgt_lager;

Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say: No
syntax error

What am I doing wrong this time?

Thanks for your good advice!

Karl


You do a var_dump on each variable to see what type they were defined as.
---End Message---
---BeginMessage---
2013/8/8 Jim Giner jim.gi...@albanyhandball.com

 On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:

 $oppdater_lager_med_antall_kg = $kg_pa_lager +
 $kg_fra_transportdokument_inn_**pa_valgt_lager;


 result:
 *Fatal error*: Unsupported operand types in *
 /Users/karl/Sites/kasen/io/kp/**index.php* on line *2970

 *I have also tried this:

 $kg_pa_lager += $kg_fra_transportdokument_inn_**pa_valgt_lager;

 Both of them return this Fatal error.
 I am using Dreamweaver CS6 and the syntax check in my software say: No
 syntax error

 What am I doing wrong this time?

 Thanks for your good advice!

 Karl

  You do a var_dump on each variable to see what type they were defined as.


NULL array(2) { [0]= string(3) 100 [1]= string(3) 340 }
---End Message---
---BeginMessage---

On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:

2013/8/8 Jim Giner jim.gi...@albanyhandball.com


On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:


$oppdater_lager_med_antall_kg = $kg_pa_lager +
$kg_fra_transportdokument_inn_**pa_valgt_lager;


result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/**index.php* on line *2970

*I have also tried this:

$kg_pa_lager += $kg_fra_transportdokument_inn_**pa_valgt_lager;

Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say: No
syntax error

What am I doing wrong this time?

Thanks for your good advice!

Karl

  You do a var_dump on each variable to see what type they were defined as.



NULL array(2) { [0]= string(3) 100 [1]= string(3) 340 }


That is one var. What is the other var?
---End Message---
---BeginMessage---
2013/8/8 Jim Giner jim.gi...@albanyhandball.com

 On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:

 2013/8/8 Jim Giner jim.gi...@albanyhandball.com

  On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:

  $oppdater_lager_med_antall_kg = $kg_pa_lager +
 $kg_fra_transportdokument_inn_pa_valgt_lager;



 result:
 *Fatal error*: Unsupported operand types in *
 /Users/karl/Sites/kasen/io/kp/index.php* on line *2970


 *I have also tried this:

 $kg_pa_lager += $kg_fra_transportdokument_inn_pa_valgt_lager;


 Both of them return this Fatal error.
 I am using Dreamweaver CS6 and the syntax check in my software say: No
 syntax error

 What am I doing wrong this time?

 Thanks for your good advice!

 Karl

   You do a var_dump on each variable to see what type they were defined
 as.



 NULL array(2) { [0]= string(3) 100 [1]= string(3) 340 }

  That is one var. What is the other var?


Thank you very much!
Now I know the error.. One of those variables are NULL! When I fix it I
think it work!

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

On 8/8/2013 1:56 PM, Karl-Arne Gjersøyen wrote:

2013/8/8 Jim Giner jim.gi...@albanyhandball.com


On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:


2013/8/8 Jim Giner jim.gi...@albanyhandball.com

  On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:


  $oppdater_lager_med_antall_kg = $kg_pa_lager +

$kg_fra_transportdokument_inn_pa_valgt_lager;



result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/index.php* on line *2970


*I have also tried this:

$kg_pa_lager += $kg_fra_transportdokument_inn_pa_valgt_lager;


Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say: No
syntax error

What am I doing wrong this time?

Thanks for your good advice!

Karl

   You do a var_dump on each variable to see what type they were defined
as.





NULL array(2) { [0]= string(3) 100 [1]= string(3) 340

php-general Digest 8 Aug 2013 17:32:46 -0000 Issue 8326

2013-08-08 Thread php-general-digest-help

php-general Digest 8 Aug 2013 17:32:46 - Issue 8326

Topics (messages 321812 through 321816):

Re: Class Auto-Assigning to Variable
321812 by: Brian Smither
321813 by: Ashley Sheridan
321814 by: Brian Smither
321815 by: Ashley Sheridan

Operand error...
321816 by: Karl-Arne Gjersøyen

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---

 $hello = $clsHello;

If that conceptual statement (or any occurance of the conceptual $hello) were 
in the code, then my (really good) Find feature of my code editor would have 
found it.


 There are only a few variables that get assigned as side effects of
  functions, but they have very specific names, and none of them are
 $hello (but I'm guessing that's not the actual variable name)

I have two dozen classes in this application. In every case, there will be a 
variable, the name of which is a lowercase variant of the class name, to which 
is assigned an instance of the class, when the class's construct() function 
completes. The example informs you of this.


 Somewhere in your code there is something that is assigning to $hello.
 Find everything that's doing that and look at each instance in detail.

I have. Many times. What I am looking for is a side-effect -- something not 
obvious. (This application does not use an eval() function where some 
obfuscated string manipulation would play this out.)


 I would say for definite that it's some of the surrounding code,

Exactly. No sooner and no later than precisely when the class's construct() 
function ends, and control is given to the next statement after the one that 
instantiated that class.


 probably something similar to this:

Let's explore this statement:

 $GLOBALS[strtolower(get_class($this))] = $this;

May I infer that the declaration of $GLOBALS['hello'] will, at the same time, 
also create $hello (without a statement declaring such)?

This:
http://php.net/manual/en/reserved.variables.globals.php
implies the opposite direction.




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



I have two dozen classes in this application. In every case, there will
be a variable, the name of which is a lowercase variant of the class
name, to which is assigned an instance of the class, when the class's
construct() function completes. The example informs you of this.


Actually, as we've explained, your example does _not_ show this, it works as 
expected and throws a notice, from which can be inferred there is other code 
doing this


 I would say for definite that it's some of the surrounding code,

Exactly. No sooner and no later than precisely when the class's
construct() function ends, and control is given to the next statement
after the one that instantiated that class.


Is your class maybe inheriting from another one and that contains the code 
causing this issue?


 probably something similar to this:

Let's explore this statement:

 $GLOBALS[strtolower(get_class($this))] = $this;

May I infer that the declaration of $GLOBALS['hello'] will, at the same
time, also create $hello (without a statement declaring such)?

The $GLOBALS array is what's known as a super global. Elements within the array 
are reflected as global variables and vice-versa.


This:
http://php.net/manual/en/reserved.variables.globals.php
implies the opposite direction.


Not sure what you mean, but this super global works both ways. Don't 
necessarily get hung up on this being the exact code, it's just a proof of 
concept of how it /might/ be happening. Like I said, there are probably other 
ways too.


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

Thanks,
Ash
---End Message---
---BeginMessage---
Your example does _not_ show this, it works
as expected and throws a notice, from which can be inferred there is other
code doing this

Or relevant code having a side-effect not currently realized.


Is your class maybe inheriting from another one and that contains the code
causing this issue?

No.


May I infer that the declaration of $GLOBALS['hello'] will, at the same
time, also create $hello (without a statement declaring such)?

The $GLOBALS array is what's known as a super global. Elements within the
array are reflected as global variables and vice-versa.


Let's refine the conceptual example:

class Hello {
private $_world = 'World';
function __construct(){}
}

$GLOBALS['hello'] = new Hello();

echo 'The variable $hello is '.gettype($hello).\n.print_r($hello,true);

Can we then postulate that the value of $GLOBALS['hello'] will also be revealed 
in $hello, even though $hello was never formally declared?

I know that $GLOBALS['hello'] has a universal scope

php-general Digest 7 Aug 2013 08:47:24 -0000 Issue 8324

2013-08-07 Thread php-general-digest-help

php-general Digest 7 Aug 2013 08:47:24 - Issue 8324

Topics (messages 321804 through 321804):

add call_func() syntax instead call_user_func_array()
321804 by: Szopen Xiao

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---
https://bugs.php.net/bug.php?id=65410
above  feate bug  my implement the syntax think, request master of PHP
 internals developer help complete
my submit code learn the foreach
---End Message---


php-general Digest 7 Aug 2013 21:15:54 -0000 Issue 8325

2013-08-07 Thread php-general-digest-help

php-general Digest 7 Aug 2013 21:15:54 - Issue 8325

Topics (messages 321805 through 321811):

Class Auto-Assigning to Variable
321805 by: Brian Smither
321806 by: Sebastian Krebs
321807 by: Brian Smither
321808 by: Ashley Sheridan
321809 by: Brian Smither
321810 by: Stuart Dallas
321811 by: Ashley Sheridan

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---
I have a situation where, for some unknown reason, where each class that 
finishes its __contruct{} function, that class gets automatically assigned to a 
variable - other than the variable I specify.

Conceptually:

class Hello { private $_world = 'World'; __construct(){} }

$clsHello = new Hello();

echo 'The variable $hello is '.gettype($hello).\n.print_r($hello,true);

Output:
The variable $hello is object
Hello Object
(
[_world:Hello:private] = World
)

There is no statement in my application that assigns an instance of the class 
to another variable, the name being a lowercase variant of the class name.

Would there be a PHP function that would do this as a side-effect?

I am more interested in learning what is happening as opposed to rolling back 
to a previous version. (A backup copy functions fine. A file compare does not 
reveal any likely suspects.)

PHP5.4.17-NTS-VC9 (Windows XP-SP3)



---End Message---
---BeginMessage---
2013/8/7 Brian Smither bhsmit...@gmail.com

 I have a situation where, for some unknown reason, where each class that
 finishes its __contruct{} function, that class gets automatically assigned
 to a variable - other than the variable I specify.

 Conceptually:

 class Hello { private $_world = 'World'; __construct(){} }


This isn't even valid PHP


 $ php -a
Interactive shell

php  class Hello { private $_world = 'World'; __construct(){} }
PHP Parse error:  syntax error, unexpected '__construct' (T_STRING),
expecting function (T_FUNCTION) in php shell code on line 1
php 



 $clsHello = new Hello();

 echo 'The variable $hello is '.gettype($hello).\n.print_r($hello,true);

 Output:
 The variable $hello is object
 Hello Object
 (
 [_world:Hello:private] = World
 )

 There is no statement in my application that assigns an instance of the
 class to another variable, the name being a lowercase variant of the class
 name.

 Would there be a PHP function that would do this as a side-effect?

 I am more interested in learning what is happening as opposed to rolling
 back to a previous version. (A backup copy functions fine. A file compare
 does not reveal any likely suspects.)

 PHP5.4.17-NTS-VC9 (Windows XP-SP3)




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




-- 
github.com/KingCrunch
---End Message---
---BeginMessage---
Second go around:

I have a situation where, for some unknown reason, where each class that 
finishes its __contruct{} function, that class gets automatically assigned to a 
variable - other than the variable I specify.

Conceptually (a little bit better on the conceptualizing):

class Hello {
private $_world = 'World';
function __construct(){}
}

$clsHello = new Hello();

echo 'The variable $hello is '.gettype($hello).\n.print_r($hello,true);

Output:
The variable $hello is object
Hello Object
(
[_world:Hello:private] = World
)

There is no statement in my application that assigns an instance of the class 
to another variable, the name being a lowercase variant of the class name.

Would there be a PHP function that would do this as a side-effect?

I am more interested in learning what is happening as opposed to rolling back 
to a previous version. (A backup copy functions fine. A file compare does not 
reveal any likely suspects.)

PHP5.4.17-NTS-VC9 (Windows XP-SP3)



---End Message---
---BeginMessage---
On Wed, 2013-08-07 at 13:11 -0600, Brian Smither wrote:

 Second go around:
 
 I have a situation where, for some unknown reason, where each class that 
 finishes its __contruct{} function, that class gets automatically assigned to 
 a variable - other than the variable I specify.
 
 Conceptually (a little bit better on the conceptualizing):
 
 class Hello {
 private $_world = 'World';
 function __construct(){}
 }
 
 $clsHello = new Hello();
 
 echo 'The variable $hello is '.gettype($hello).\n.print_r($hello,true);
 
 Output:
 The variable $hello is object
 Hello Object
 (
 [_world:Hello:private] = World
 )
 
 There is no statement in my application that assigns an instance of the class 
 to another variable, the name being a lowercase variant of the class name.
 
 Would there be a PHP function that would do this as a side-effect?
 
 I am more interested in learning what

php-general Digest 6 Aug 2013 16:10:17 -0000 Issue 8323

2013-08-06 Thread php-general-digest-help

php-general Digest 6 Aug 2013 16:10:17 - Issue 8323

Topics (messages 321802 through 321803):

Re: how to see all sessions sets in server
321802 by: Alessandro Pellizzari

Re: Stripe Connect in the UK + PHP Integration.
321803 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


--
---BeginMessage---
Il Sun, 04 Aug 2013 20:47:37 +0430, Farzan Dalaee ha scritto:

Please use better quoting.

 So best way is use a script(javascript) to send ajax to server every 5
 second to check users is logged in or not? Is that okey?

It depends.

 I want to write chat module like facebook and i need a solution to find
 online users and way to send messages when users chat together, does any
 one write similar module like that?

Then knowing who is online is maybe the last of your problems.

You have to find a way to send the message to user B when user A 
writes something.

You absolutely need javascript. You just need to find out how to connect 
to the server. Have a look at socket.io, and find a php library that 
supports it. I think it is the easiets way.

Be aware that the load on your server will be huge, growing exponentially 
with the number of online users. You can't escape it, except by using 
different technologies (XMPP as a protocol, with a javascript client, or 
using node.js with socket.io, for example)

Bye.


---End Message---
---BeginMessage---
On 19 July 2013 16:22, Richard Quadling rquadl...@gmail.com wrote:

 Hi.

 Simple question.

 Has anyone got Stripe Connect, Stripe.js and Stripe PHP SDK operational in
 the UK.

 I'm struggling getting the UK Beta to accept a new account/customer set
 for a UK business or individual, accepting GBP.

 And I'm in the UK Beta!

 Any help would be appreciated. Off list if preferred.

 Regards,

 Richard Quadling.


Just in case anyone comes back with this, I've got it sorted.

The UK Beta is by invite only. So to get our merchants signed up, we had to
email them an invite. They then register, authenticate and then authorise
our app with their account. Very long winded and unnecessary. Fortunately,
Stripe fixed it for us (well, others too probably). Now the signup is via
our app (just like GoCardless) and all working well.

So. Stripe UK is on it's way. Hopefully!


Just seen the price of stripe.co.uk ... £22,000! Ha!



-- 
Richard Quadling
Twitter : @RQuadling
---End Message---


php-general Digest 4 Aug 2013 10:13:26 -0000 Issue 8321

2013-08-04 Thread php-general-digest-help

php-general Digest 4 Aug 2013 10:13:26 - Issue 8321

Topics (messages 321782 through 321783):

how to see all sessions sets in server
321782 by: Farzan Dalaee
321783 by: Alessandro Pellizzari

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---
hi
i want to write online user module for my site and i want to check
$_SESSION['userID'] to find all users id who loged in
but when i echo this code its return only current user detail
how i can see all sessions?

foreach($_SESSION as $k = $v)
{
echo $k.--.$v;
}
 or how i handle online users?
---End Message---
---BeginMessage---
Il Sun, 04 Aug 2013 13:32:55 +0430, Farzan Dalaee ha scritto:

 hi i want to write online user module for my site and i want to check
 $_SESSION['userID'] to find all users id who loged in but when i echo
 this code its return only current user detail how i can see all
 sessions?

You can't.

  or how i handle online users?

Every user has its session.

If you want to have a super user who has access to all the sessions, 
you can use the filesystem functions to read the directory in which the 
sessions get saved (it depends on the server configuration) or you can 
implement a session handler to save all the sessions in the database, and 
give access to that table to one user.

Bye.


---End Message---


php-general Digest 5 Aug 2013 03:24:04 -0000 Issue 8322

2013-08-04 Thread php-general-digest-help

php-general Digest 5 Aug 2013 03:24:04 - Issue 8322

Topics (messages 321784 through 321801):

Re: how to see all sessions sets in server
321784 by: Matijn Woudt
321785 by: Farzan Dalaee
321786 by: Ashley Sheridan
321791 by: Tim Streater
321792 by: Ashley Sheridan
321793 by: Farzan Dalaee
321795 by: Stuart Dallas
321796 by: Ashley Sheridan
321797 by: Matijn Woudt
321798 by: Farzan Dalaee
321799 by: Ashley Sheridan
321801 by: Paul M Foster

What the hell is Begacom?
321787 by: Ashley Sheridan
321788 by: Lester Caine
321789 by: Ashley Sheridan
321790 by: Camilo Sperberg
321794 by: lester.lsces.co.uk
321800 by: Jonesy

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 Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.comwrote:

 hi
 i want to write online user module for my site and i want to check
 $_SESSION['userID'] to find all users id who loged in
 but when i echo this code its return only current user detail
 how i can see all sessions?

 foreach($_SESSION as $k = $v)
 {
 echo $k.--.$v;
 }
  or how i handle online users?


You can only access sessions when you know the session id.
Most sites handle online users in their database, store a timestamp each
time a user loads a page. When you want to display the online users, check
where the timestamp is between now and a few minutes ago. Note that without
javascript (or flash/java/etc) there is no way to truly know if the user
left or not. The session will stay active for a long time, depending on
your php.ini settings.

- Matijn
---End Message---
---BeginMessage---
You mean when user logged in i add new record to table and when logged out i 
delete the row? So if user close the browser without logout how can i find user 
is online or not?

Sent from my iPhone

On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:

 
 
 
 On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.com 
 wrote:
 hi
 i want to write online user module for my site and i want to check
 $_SESSION['userID'] to find all users id who loged in
 but when i echo this code its return only current user detail
 how i can see all sessions?
 
 foreach($_SESSION as $k = $v)
 {
 echo $k.--.$v;
 }
  or how i handle online users?
 
 You can only access sessions when you know the session id.
 Most sites handle online users in their database, store a timestamp each time 
 a user loads a page. When you want to display the online users, check where 
 the timestamp is between now and a few minutes ago. Note that without 
 javascript (or flash/java/etc) there is no way to truly know if the user left 
 or not. The session will stay active for a long time, depending on your 
 php.ini settings.
 
 - Matijn
 
---End Message---
---BeginMessage---
On Sun, 2013-08-04 at 14:56 +0430, Farzan Dalaee wrote:

 You mean when user logged in i add new record to table and when logged out i 
 delete the row? So if user close the browser without logout how can i find 
 user is online or not?
 
 Sent from my iPhone
 
 On Aug 4, 2013, at 14:44, Matijn Woudt tijn...@gmail.com wrote:
 
  
  
  
  On Sun, Aug 4, 2013 at 11:02 AM, Farzan Dalaee farzan.dal...@gmail.com 
  wrote:
  hi
  i want to write online user module for my site and i want to check
  $_SESSION['userID'] to find all users id who loged in
  but when i echo this code its return only current user detail
  how i can see all sessions?
  
  foreach($_SESSION as $k = $v)
  {
  echo $k.--.$v;
  }
   or how i handle online users?
  
  You can only access sessions when you know the session id.
  Most sites handle online users in their database, store a timestamp each 
  time a user loads a page. When you want to display the online users, check 
  where the timestamp is between now and a few minutes ago. Note that without 
  javascript (or flash/java/etc) there is no way to truly know if the user 
  left or not. The session will stay active for a long time, depending on 
  your php.ini settings.
  
  - Matijn
  


Like Matijn said, unless you're using some kind of client-side method to
continually poll the server, you can't know if they've just closed their
browser. There are Javascript events for exiting a page, but they don't
work correctly on Safari and iOS Safari.

You don't have to actually save anything to the DB manually, just
instruct PHP to use the DB for its own sessions, rather than files.

Do you really need to inspect each visitors session in detail, or do you
just need a way to determine how many unique visitors are on the site at
any one time?

Thanks

php-general Digest 3 Aug 2013 09:32:30 -0000 Issue 8319

2013-08-03 Thread php-general-digest-help

php-general Digest 3 Aug 2013 09:32:30 - Issue 8319

Topics (messages 321772 through 321777):

Re: OT - Internet Troubles?…
321772 by: Bastien
321773 by: Daniel

suhosin and 5.4 onwards
321774 by: Nick Edwards
321775 by: Daniel
321776 by: Lester Caine
321777 by: Res

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---
It's just the NSA doing an update. I wonder what they charge for cloud backups?

Bastien Koert

On 2013-08-02, at 3:37 PM, dealTek deal...@gmail.com wrote:

 OT
 
 Anyone having internet troubles?
 
 (also seems to be login database issues too at various places)
 
 like...
 
 
 http://forums.adobe.com/community/dreamweaver
 
 and try to sign in on upper right
 
 i get this
 
 We're sorry, the site area you've requested is unavailable. Please try again 
 later.
 
 and
 
 
 - go to - http://bluehost.com
 
 and try LIVE CHAT in mid page and it also fails...
 
 i get 
 
 Our chat service is currently undergoing maintenance and will be back online 
 shortly. Call us (888) 401-4678 or open a ticket if you need further 
 assistance.
 
 
 and other issues too like
 
 
 also
 
 http://www.downdetector.com/status/time-warner-cable/los-angeles
 Time Warner Cable Los Angeles reports
 
 ugh! #twc #timewarnercable connectivity issues again, and apparently it's 
 effecting a lot of work from home coworkers..get it fixed!! — (@BloodBought3) 
 2013-08-02 07:37:59
 
 
 
 
 
 --
 Thanks,
 Dave - DealTek
 deal...@gmail.com
 [db-3]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
---End Message---
---BeginMessage---
LMAO, no there a big data centre outage: http://enduranceresponse.com/




On Sat, Aug 3, 2013 at 11:53 AM, Bastien phps...@gmail.com wrote:
 It's just the NSA doing an update. I wonder what they charge for cloud 
 backups?

 Bastien Koert

 On 2013-08-02, at 3:37 PM, dealTek deal...@gmail.com wrote:

 OT

 Anyone having internet troubles?

 (also seems to be login database issues too at various places)

 like...


 http://forums.adobe.com/community/dreamweaver

 and try to sign in on upper right

 i get this

 We're sorry, the site area you've requested is unavailable. Please try again 
 later.

 and


 - go to - http://bluehost.com

 and try LIVE CHAT in mid page and it also fails...

 i get

 Our chat service is currently undergoing maintenance and will be back online 
 shortly. Call us (888) 401-4678 or open a ticket if you need further 
 assistance.


 and other issues too like


 also

 http://www.downdetector.com/status/time-warner-cable/los-angeles
 Time Warner Cable Los Angeles reports

 ugh! #twc #timewarnercable connectivity issues again, and apparently it's 
 effecting a lot of work from home coworkers..get it fixed!! — 
 (@BloodBought3) 2013-08-02 07:37:59





 --
 Thanks,
 Dave - DealTek
 deal...@gmail.com
 [db-3]


 --
 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

---End Message---
---BeginMessage---
Ok, so I know this might start flame wars, but... here goes ;)

It seems suhosin  is dead as far as 5.4 goes, now, some make
allegations that it is no longer needed since php has allegedly
incorporated much of its safe guards, but these claims are from self
proclaimed experts (a term i use very loosley) on forums and blogs.

So, is the general opinion here, from actual factual experience  and
not because you read the same trashy bloggers as I did,  in agreeance?
 is it genuinely true that suhosin is now irrelevant with 5.4 upwards
and php is now much safer on its own?

We have always appreciated its work to stop plugins and so forth
escaping local jails by example   open_base  or some other lock-down
type setting, plus injections and so forth.

if php has incorporated such, thats fine, but I have no idea where to
turn to ask for factual information on this, so I'm asking here and
hope that a dev or someone in the inner circle knows the facts, and
not rumours or sumizes, or a tleast more facts than half the self
appointed gurus claim :)

Thanks
Nikki
---End Message---
---BeginMessage---
Well I do not use suhosin as I can lock down PHP with things like
disable_function, disable_classes along with more advance function
such as chroot and mod_security.

On 8/3/13, Nick Edwards nick.z.edwa...@gmail.com wrote:
 Ok, so I know this might start flame wars, but... here goes ;)

 It seems suhosin  is dead as far as 5.4 goes, now, some make
 allegations that it is no longer needed since php has allegedly

php-general Digest 3 Aug 2013 21:47:14 -0000 Issue 8320

2013-08-03 Thread php-general-digest-help

php-general Digest 3 Aug 2013 21:47:14 - Issue 8320

Topics (messages 321778 through 321781):

Re: Sending headers to server
321778 by: Karim Geiger
321781 by: Matijn Woudt

Session Vars not staying active
321779 by: dealTek
321780 by: Daniel P. Brown

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---
Am 02.08.13 18:03, schrieb Miguel Guedes:
 This is strange.  I've just found out that the headers are sent
 correctly if I access the website outside of localhost. I don't
 understand why.

I also don't. I've tried the exactly same code you posted on my
localhost as well and it worked all properly. Weird behaviour, can
anyone explain why this happens?

Regards

Karim

-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537



signature.asc
Description: OpenPGP digital signature
---End Message---
---BeginMessage---
On Sat, Aug 3, 2013 at 11:46 AM, Karim Geiger gei...@b1-systems.de wrote:

 Am 02.08.13 18:03, schrieb Miguel Guedes:
  This is strange.  I've just found out that the headers are sent
  correctly if I access the website outside of localhost. I don't
  understand why.

 I also don't. I've tried the exactly same code you posted on my
 localhost as well and it worked all properly. Weird behaviour, can
 anyone explain why this happens?

 Regards

 Karim


Could it be that you're actually ending up with a different site because
you have configured your vhost to a certain domain?

- Matijn
---End Message---
---BeginMessage---
Hi all,


I am having trouble with session vars.

I'm trying to implement the credit card direct pay method outlined here...

http://developer.authorize.net/api/dpm/

- Basically, page 1 is my form that goes outside my site to the cc gateway 
company then comes back with a result... (PG2)

Problem: if I try to create session vars on page 1 - they don't work on page 2.

Am I correct in thinking that when this process leaves my site and goes to the 
gateway, then returns, it is similar to creating a new session and that is why 
the session vars don't remain active?

Thanks in advance.




--
Thanks,
Dave - DealTek
deal...@gmail.com
[db-3]

---End Message---
---BeginMessage---
On Aug 3, 2013 3:03 PM, dealTek deal...@gmail.com wrote:

 Hi all,


 I am having trouble with session vars.

 I'm trying to implement the credit card direct pay method outlined here...

 http://developer.authorize.net/api/dpm/

 - Basically, page 1 is my form that goes outside my site to the cc
gateway company then comes back with a result... (PG2)

 Problem: if I try to create session vars on page 1 - they don't work on
page 2.

 Am I correct in thinking that when this process leaves my site and goes
to the gateway, then returns, it is similar to creating a new session and
that is why the session vars don't remain active?

 Thanks in advance.

Are you calling session_start() on both pages or at least using a
session auto start?  Also, is the API returning the data by redirecting the
client (browser) or doing a postback?

If the remote server is calling back behind the scenes, then you'll
need a workaround and additional processing, or the ability to pass the
session ID and assume the client-initiated session (not ideal).  If it's
all processed by the browser, the redirection should have no bearing, as
the session will persist based upon the server-side data and the
client-side cookie; the server will have no knowledge of the client's
redirection to the payment gateway (nor any remote destination).
---End Message---


php-general Digest 2 Aug 2013 09:00:27 -0000 Issue 8317

2013-08-02 Thread php-general-digest-help

php-general Digest 2 Aug 2013 09:00:27 - Issue 8317

Topics (messages 321750 through 321756):

Re: Sending headers to server
321750 by: Karim Geiger
321756 by: Miguel Guedes

Re: POST action
321751 by: Larry Garfield
321752 by: Paul M Foster
321755 by: Robert Cummings

Re: SELECT data base on a upper level SELECT
321753 by: iccsi
321754 by: jomali

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---
Hi MiguelOn 08/01/2013 04:04 PM, Miguel Guedes wrote:
 Hello List,
 
 
 I'm running PHP 5.4.9 as CGI (via apache 2.2.22) and can't seem to be 
 able to send headers to the server.
 
 Both,
 
 header('Status: 500 Internal Server Error'); 
 
 and,
 
 header('HTTP/1.1 500 Internal Server Error', true, 500);
 
 result in nothing happening on the client side.
 
 What am I missing?
 

Works for me. What happens exactly? Do you get a 200?

Karim



-- 
Karim Geiger
Auszubildender Fachinformatiker AE

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537



signature.asc
Description: OpenPGP digital signature
---End Message---
---BeginMessage---

Hi Karim,

On 01/08/13 15:40, Karim Geiger wrote:


Works for me. What happens exactly? Do you get a 200?



That's exactly right - I always get a 200.  How can I diagnose this?
---End Message---
---BeginMessage---

On 7/29/13 3:02 PM, Paul M Foster wrote:

On Mon, Jul 29, 2013 at 11:50:01AM -0500, Larry Garfield wrote:


On 7/28/13 9:23 PM, Paul M Foster wrote:

On Sun, Jul 28, 2013 at 08:46:06PM -0500, Larry Garfield wrote:


[snip]



Except as noted above. This is all home-grown, using native PHP
functions designed to do these things, and classes I've written. I
carefully examine each field when writing the POST-handling code with
the idea in mind that no matter what the HTML says, the return value
must conform to what *I* think it should be. No MVC framework written by
others (though I do conform to MVC paradigm).

Paul


Then you're not writing your own form tags from the sound of it;
you're writing your own Form API.  Still an improvements. :-)


No, I'm writing the form tags as well. I write the whole thing, soup to
nuts. But as I'm writing the back end validation stuff, I realize that
what I wrote in the HTML doesn't matter when it comes to hackers and
script kiddies. So I use my bless and validation libraries to tackle
form responses. That's the point I'm making. I understand what you're
saying about using someone else's framework so you can make sure that
tested code is being used to ensure against hacking attempts. But your
pronouncement was so thunderous that I had to provide the exception. If
you hang around here and read a book or two on security, you can write
your own code that handles this stuff. Particularly if you have an
example like CodeIgniter to use, to see how it's done.

(There are times when I *don't* write the HTML. My wife the designer
does. But I still go in and modify it to provide the validation bits
which she can't do. She uses Dreamweaver, so a lot of the time, she
doesn't even know what the raw HTML looks like.)

Paul


So you're writing your own form tags for each specific time you need a 
form, or you wrote your own form builder API that is writing the form 
tags for you?


Because if the former, I claim it's insecure.  The development process 
is insecure, so you will screw up sooner or later.  You're only human.


--Larry Garfield
---End Message---
---BeginMessage---
On Thu, Aug 01, 2013 at 02:35:04PM -0500, Larry Garfield wrote:

[snip]

 
 So you're writing your own form tags for each specific time you need
 a form, or you wrote your own form builder API that is writing the
 form tags for you?

Unless my wife creates the form in Dreamweaver, I write the HTML for the
form fields. Even when she does, I add the proper code to validate each
field and the form overall, using my field validation class, etc.

 
 Because if the former, I claim it's insecure.  The development
 process is insecure, so you will screw up sooner or later.  You're
 only human.

A-ha! That's where you're wrong, Matey! For I am SUPER-CODER! Faster
than a speeding 300 baud modem! More powerful than a teletype! Able
to leap tall procedural functions at a single bound! With my pocket
protector and trusty slide rule, I defend the indefensible and champion
the cause of spaghetti code!

So there! ;-P

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com
---End Message---
---BeginMessage---

On 13-08-01 05:14 PM, Paul M Foster wrote:

On Thu, Aug 01, 2013 at 02:35:04PM -0500, Larry Garfield wrote:

[snip

php-general Digest 1 Aug 2013 14:23:11 -0000 Issue 8316

2013-08-01 Thread php-general-digest-help

php-general Digest 1 Aug 2013 14:23:11 - Issue 8316

Topics (messages 321748 through 321749):

Re: SELECT data base on a upper level SELECT
321748 by: Jim Giner

Sending headers to server
321749 by: Miguel Guedes

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 7/31/2013 9:37 PM, iccsi wrote:

I have 5 SELECT for Department, Manager, supervisor, Group Leader and
Employees
I want to every SELECT list narrow down for an upper SELECT.
For example, once user select Department then all Manager, Supervisor,
Group Leader and Employee list will be narrow down by department and
same for manager and supervisor and so on.

I can use iframe or jQuery to do every level, but it needs to call
iframe or jQuery to 5 levels.
I would like to know are there any better way to handle this situation,

Your help and information is great appreciated,

Regards,


Iccsi,

How about using just one select and add variables to the where clause? 
Set the variable(s) to the values that you want to filter on.


For ex.:

your query is
$sel = 1;
$q = select Department, Manager, supervisor, Group Leader,Employees 
where $sel;


Then when the user selects a department $d:

$sel = Department = '$d';

OR if you have selected a department $d and a manager $m:

$sel = Department ='$d' and Manager='$m';

One query.  A variable 'where' clause.
---End Message---
---BeginMessage---
Hello List,


I'm running PHP 5.4.9 as CGI (via apache 2.2.22) and can't seem to be 
able to send headers to the server.

Both,

header('Status: 500 Internal Server Error'); 

and,

header('HTTP/1.1 500 Internal Server Error', true, 500);

result in nothing happening on the client side.

What am I missing?

---End Message---


php-general Digest 1 Aug 2013 01:37:14 -0000 Issue 8315

2013-07-31 Thread php-general-digest-help

php-general Digest 1 Aug 2013 01:37:14 - Issue 8315

Topics (messages 321743 through 321747):

Re: php 5.3.15 and exception for disabled_functions
321743 by: Bálint Horváth
321744 by: Josef Karliak

OPcache Instead of APC Now?
321745 by: Timmy Turner
321746 by: Jan Ehrhardt

SELECT data base on a upper level SELECT
321747 by: iccsi

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---
Hi,

Maybe you think for ini_set()

http://php.net/manual/en/function.ini-set.php



On Tue, Jul 30, 2013 at 9:22 AM, Josef Karliak karl...@ajetaci.cz wrote:

   Hi there,
   in the php.ini file I've disabled some functions (exec and similar). In
 the php script we must use binary execution - so I had to enable function
 exec again. And here is a question - does php have an option, that I
 could set : this binary file could use this disabled function ? Like :

 disable_functions_binary_**exception = /usr/local/bin/compute_**doomsday
 disable_functions_function_**exception = exec

 :)

 Thanks and best regards

 J.Karliak

 --
 Ma domena pouziva zabezpeceni a kontrolu SPF (www.openspf.org) a
 DomainKeys/DKIM (with ADSP) . Pokud mate problemy s dorucenim emailu,
 zacnete pouzivat metody overeni puvody emailu zminene vyse. Dekuji.
 My domain use SPF (www.openspf.org) and DomainKeys/DKIM (with ADSP)
 policy and check. If you've problem with sending emails to me, start
 using email origin methods mentioned above. Thank you.

 --**--**
 This message was sent using IMP, the Internet Messaging Program.



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


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

  Hi,
  interesting function, but disable_function is configurable only  
from php.ini file :-/

  J.K.

Cituji Bálint Horváth hbal...@gmail.com:


Hi,

Maybe you think for ini_set()

http://php.net/manual/en/function.ini-set.php



On Tue, Jul 30, 2013 at 9:22 AM, Josef Karliak karl...@ajetaci.cz wrote:


  Hi there,
  in the php.ini file I've disabled some functions (exec and similar). In
the php script we must use binary execution - so I had to enable function
exec again. And here is a question - does php have an option, that I
could set : this binary file could use this disabled function ? Like :

disable_functions_binary_**exception = /usr/local/bin/compute_**doomsday
disable_functions_function_**exception = exec

:)

Thanks and best regards

J.Karliak

--
Ma domena pouziva zabezpeceni a kontrolu SPF (www.openspf.org) a
DomainKeys/DKIM (with ADSP) . Pokud mate problemy s dorucenim emailu,
zacnete pouzivat metody overeni puvody emailu zminene vyse. Dekuji.
My domain use SPF (www.openspf.org) and DomainKeys/DKIM (with ADSP)
policy and check. If you've problem with sending emails to me, start
using email origin methods mentioned above. Thank you.

--**--**
This message was sent using IMP, the Internet Messaging Program.



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








--
Ma domena pouziva zabezpeceni a kontrolu SPF (www.openspf.org) a
DomainKeys/DKIM (with ADSP) . Pokud mate problemy s dorucenim emailu,
zacnete pouzivat metody overeni puvody emailu zminene vyse. Dekuji.
My domain use SPF (www.openspf.org) and DomainKeys/DKIM (with ADSP)
policy and check. If you've problem with sending emails to me, start
using email origin methods mentioned above. Thank you.


This message was sent using IMP, the Internet Messaging Program.

---End Message---
---BeginMessage---
I was looking through the changelog for PHP 5.5 and noticed the Zend
OPcache. Will this be replacing APC? (Is APC still being maintained?)

The reason I'm asking is because I use APC's data caching feature heavily,
which Zend's OPcache (currently) does not offer. Given that APC's shared
memory cache is probably as fast as (non-distributed) caching gets (for PHP
anyways), it would be a shame to see it go in the future.
---End Message---
---BeginMessage---
Timmy Turner in php.general (Tue, 30 Jul 2013 19:02:43 +0200):
I was looking through the changelog for PHP 5.5 and noticed the Zend
OPcache. Will this be replacing APC? (Is APC still being maintained?)

The reason I'm asking is because I use APC's data caching feature heavily,
which Zend's OPcache (currently) does not offer. Given that APC's shared
memory cache is probably as fast as (non-distributed) caching gets (for PHP
anyways), it would be a shame to see it go in the future.

OPcache

php-general Digest 30 Jul 2013 07:22:16 -0000 Issue 8314

2013-07-30 Thread php-general-digest-help

php-general Digest 30 Jul 2013 07:22:16 - Issue 8314

Topics (messages 321740 through 321742):

OpenLDAP password policy response
321740 by: Andrius Kulbis

Re: POST action
321741 by: Paul M Foster

php 5.3.15 and exception for disabled_functions
321742 by: Josef Karliak

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---

Hello,

I'm trying to pull the password policy response message from ldap_bind() 
method: password is expiring, password expired etc.


While checking the packet content from OpenLDAP after ldap_bind() 
request, with Wireshark, there is a control hooked to the ldap_bind() 
response, were the message code and message text about password 
expiration is, but I can't manage to parse that message from response.


I set the password policy request server control before the bind with 
ldap_set_option().

Any workaround or what am I doing wrong?

pre
?php

$address = 'x.x.x.x';
$dn = 'eduPersonPrincipalName=ex@ex,ou=People,ou=Users,dc=exa,dc=com';
$password = 'secret';

if($link = ldap_connect($address))
{
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, 3);
$ppolicy_control = array(oid = 
1.3.6.1.4.1.42.2.27.8.5.1,iscritical = true);

if(!ldap_set_option($link,LDAP_OPT_SERVER_CONTROLS,array($ppolicy_control)))
{
echo SERVER_CONTROLS not set\n;
}

if(ldap_bind($link, $dn, $password))
{
if($result = ldap_search($link, $dn, '(|(uid=ex))'))
{
$return = ldap_parse_result($link, $result, $errcode, 
$matcheddn, $errormsg, $ldapreferrals);

var_dump($return);
var_dump($errcode);
var_dump($matcheddn);
var_dump($errormsg);
var_dump($ldapreferrals);

}
}
else
{
echo 'Not Bound';
}
}
ldap_unbind($link);
?
/pre

--
REGARDS,
Andrius Kulbis

---End Message---
---BeginMessage---
On Mon, Jul 29, 2013 at 11:50:01AM -0500, Larry Garfield wrote:

 On 7/28/13 9:23 PM, Paul M Foster wrote:
 On Sun, Jul 28, 2013 at 08:46:06PM -0500, Larry Garfield wrote:

[snip]

 
 Except as noted above. This is all home-grown, using native PHP
 functions designed to do these things, and classes I've written. I
 carefully examine each field when writing the POST-handling code with
 the idea in mind that no matter what the HTML says, the return value
 must conform to what *I* think it should be. No MVC framework written by
 others (though I do conform to MVC paradigm).
 
 Paul
 
 Then you're not writing your own form tags from the sound of it;
 you're writing your own Form API.  Still an improvements. :-)

No, I'm writing the form tags as well. I write the whole thing, soup to
nuts. But as I'm writing the back end validation stuff, I realize that
what I wrote in the HTML doesn't matter when it comes to hackers and
script kiddies. So I use my bless and validation libraries to tackle
form responses. That's the point I'm making. I understand what you're
saying about using someone else's framework so you can make sure that
tested code is being used to ensure against hacking attempts. But your
pronouncement was so thunderous that I had to provide the exception. If
you hang around here and read a book or two on security, you can write
your own code that handles this stuff. Particularly if you have an
example like CodeIgniter to use, to see how it's done.

(There are times when I *don't* write the HTML. My wife the designer
does. But I still go in and modify it to provide the validation bits
which she can't do. She uses Dreamweaver, so a lot of the time, she
doesn't even know what the raw HTML looks like.)

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com
---End Message---
---BeginMessage---

  Hi there,
  in the php.ini file I've disabled some functions (exec and  
similar). In the php script we must use binary execution - so I had to  
enable function exec again. And here is a question - does php have  
an option, that I could set : this binary file could use this disabled  
function ? Like :


disable_functions_binary_exception = /usr/local/bin/compute_doomsday
disable_functions_function_exception = exec

:)

Thanks and best regards

J.Karliak

--
Ma domena pouziva zabezpeceni a kontrolu SPF (www.openspf.org) a
DomainKeys/DKIM (with ADSP) . Pokud mate problemy s dorucenim emailu,
zacnete pouzivat metody overeni puvody emailu zminene vyse. Dekuji.
My domain use SPF (www.openspf.org) and DomainKeys/DKIM (with ADSP)
policy and check. If you've problem with sending emails to me, start
using email origin methods mentioned above. Thank you.


This message was sent using IMP

php-general Digest 29 Jul 2013 16:50:06 -0000 Issue 8313

2013-07-29 Thread php-general-digest-help

php-general Digest 29 Jul 2013 16:50:06 - Issue 8313

Topics (messages 321731 through 321739):

Re: POST action
321731 by: Larry Garfield
321732 by: Jim Giner
321733 by: Ashley Sheridan
321734 by: Jim Giner
321735 by: Robert Cummings
321736 by: Robert Cummings
321737 by: Larry Garfield
321738 by: Paul M Foster
321739 by: Larry Garfield

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 07/28/2013 12:14 PM, iccsi wrote:

form action=action.php method=post
pYour name: input type=text name=name //p
pYour age: input type=text name=age //p
pinput type=submit //p
/formIn the PHP tutorial manual, it says that we can have post 
action to the form itself just like above coding.I would like to know 
in the real projects, can we have action to the same PHP file, since 
that we only need have one filebut not 2 files foe POST request,Your 
help and information is great appreciated,regards,Iccsi,


Real projects to all kinds of things.  Which is best depends on who 
you ask. :-)


I would argue that there's 3 good approaches, both of which are viable:

1) Define your form abstractly via an API, and have the API detect the 
presence of POST request and then process the form after it's built.  
That means you do submit back to the same URL.  (Drupal 7 and earlier do 
this.)


2) Put 2 separate request handlers / controllers at the same path, one 
for GET and one for POST.  So you submit back to the same URL but an 
entirely different piece of code responds to it.  (This requires a good 
routing system that can differentiate between GET and POST.)


3) Every form is defined as its own object somewhere with a unique ID.  
All forms post to the same URL but include the form ID.  Code at that 
URL looks up the form object by ID and maps the submitted data to it to 
know what to do with it.


Note that in all 3 cases you're defining a form via an API of some 
kind.  You are not writing form tags yourself.  Don't do that. Ever.  I 
promise you that you will have a security hole or six if you do.  Use a 
good form handling API for building forms.  That's what good Real 
projects do.  There are a lot out there.  Most fullstack frameworks or 
CMSes have one built in (I know Drupal and Code Ignighter do, although 
they're quite different), and there are reasonably stand-alone 
components available in both Symfony2 Components and Zend Framework.  
Please don't write your own.  There are too many good ones (and even 
more bad ones, of course) already out there that have been security 
hardened.


--Larry Garfield
---End Message---
---BeginMessage---

On 7/28/2013 1:26 PM, Larry Garfield wrote:

On 07/28/2013 12:14 PM, iccsi wrote:

form action=action.php method=post
pYour name: input type=text name=name //p
pYour age: input type=text name=age //p
pinput type=submit //p
/formIn the PHP tutorial manual, it says that we can have post
action to the form itself just like above coding.I would like to know
in the real projects, can we have action to the same PHP file, since
that we only need have one filebut not 2 files foe POST request,Your
help and information is great appreciated,regards,Iccsi,


Real projects to all kinds of things.  Which is best depends on who
you ask. :-)

I would argue that there's 3 good approaches, both of which are viable:

1) Define your form abstractly via an API, and have the API detect the
presence of POST request and then process the form after it's built.
That means you do submit back to the same URL.  (Drupal 7 and earlier do
this.)

2) Put 2 separate request handlers / controllers at the same path, one
for GET and one for POST.  So you submit back to the same URL but an
entirely different piece of code responds to it.  (This requires a good
routing system that can differentiate between GET and POST.)

3) Every form is defined as its own object somewhere with a unique ID.
All forms post to the same URL but include the form ID.  Code at that
URL looks up the form object by ID and maps the submitted data to it to
know what to do with it.

Note that in all 3 cases you're defining a form via an API of some
kind.  You are not writing form tags yourself.  Don't do that. Ever.  I
promise you that you will have a security hole or six if you do.  Use a
good form handling API for building forms.  That's what good Real
projects do.  There are a lot out there.  Most fullstack frameworks or
CMSes have one built in (I know Drupal and Code Ignighter do, although
they're quite different), and there are reasonably stand-alone
components available in both Symfony2 Components and Zend Framework.
Please don't write your own.  There are too many

php-general Digest 28 Jul 2013 17:14:49 -0000 Issue 8312

2013-07-28 Thread php-general-digest-help

php-general Digest 28 Jul 2013 17:14:49 - Issue 8312

Topics (messages 321726 through 321730):

Re: From 24/7/2013 to 2013-07-24
321726 by: Jim Giner
321727 by: Robert Cummings
321728 by: Tamara Temple
321729 by: Tamara Temple

POST action
321730 by: iccsi

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 7/26/2013 5:29 PM, Robert Cummings wrote:

On 13-07-26 04:38 PM, jomali wrote:

On Fri, Jul 26, 2013 at 1:08 PM, Robert Cummings
rob...@interjinn.comwrote:


On 13-07-26 11:42 AM, jomali wrote:


On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen
karlar...@gmail.com

wrote:


  Below is something I try that ofcourse not work because of rsosort.

Here is my code:
---
$lagret_dato = $_POST['lagret_dato'];
  foreach($lagret_dato as $dag){

  $dag = explode(/, $dag);
 rsort($dag);
  $dag = implode(-, $dag);
  var_dump($dag);

What I want is a way to rewrite contents of a variable like this:

  From 24/7/2013 to 2013-07-24

Is there a way in PHP to do this?

Thank you very much.

Karl



$conv_date = str_replace('/', '-','24/7/2013');
echo date('Y-m-d', strtotime($conv_date));
Result: 2013-07-24



It would be better if you reformatted first since this is ambiguous when
you have the following date:

 6/7/2013




Here's a completely unambiguous solution:

?php

 $old = '24/7/2013';

 $paddy = function( $bit ){ return str_pad( $bit, 2, '0',
STR_PAD_LEFT
); };
 $new = implode( '-', array_map( $paddy, array_reverse( explode(
'/',
$old ) ) ) );

 echo $new.\n;

?

Cheers,
Rob.


The original question was  about reformatting a European (Day/Month/Year)
date. Your solution does not address this problem. Mine assumes the
European date format explicitly.


Jomali,

Your solution is broken. The original poster requested the following:

  What I want is a way to rewrite contents of a variable like this:
 
From 24/7/2013 to 2013-07-24

Your solution makes use of the strtodate(). A useful strategy EXCEPT (as
you have already noted) the date follows the European formatting rules
of dd/mm/ since the 24 as the first number makes that obvious.
HOWEVER, you failed to realize the following (from the PHP online manual):

 Dates in the m/d/y or d-m-y formats are disambiguated by looking
 at the separator between the various components: if the separator
 is a slash (/), then the American m/d/y is assumed; whereas if
 the separator is a dash (-) or a dot (.), then the European d-m-y
 format is assumed.

And so, as soon as an abiguous date arises, the solution will be
incorrect because strtotime() will presume an American format due to the
appearance of the slash instead of the hyphen. It is dangerous to rely
on magical functions like strtotime() unless you completely understand
how ambiguity is resolved.

Another solution that was posted only re-ordered the elements and you
likely noticed that there is a single digit 7 in the source date and in
the response date it has been 0 padded to conform to the standard
-mm-dd date format. The other solution does not do this and so it is
also incorrect.

And so it follows, that my solution, thus far, is the only solution
posted that actually meets the requirements. Why you think my solution
does not perform is beyond me since a simple run of the code would
output the correct answer (yes I did test)-- mine also presumes the
European ordering for all input with components separated by a slash.

Cheers,
Rob.

And my solution doesn't work?
---End Message---
---BeginMessage---

On 13-07-26 05:33 PM, Jim Giner wrote:

On 7/26/2013 5:29 PM, Robert Cummings wrote:

And so it follows, that my solution, thus far, is the only solution
posted that actually meets the requirements. Why you think my solution
does not perform is beyond me since a simple run of the code would
output the correct answer (yes I did test)-- mine also presumes the
European ordering for all input with components separated by a slash.

Cheers,
Rob.



And my solution doesn't work?



I don't see any padding happening in your solution. Your solution produced:

2013-7-24

The required solution is:

2013-07-24

:)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
---End Message---
---BeginMessage---

On Jul 26, 2013, at 4:18 AM, Karl-Arne Gjersøyen karlar...@gmail.com wrote:

 Below is something I try that ofcourse not work because of rsosort.
 Here

php-general Digest 26 Jul 2013 09:18:07 -0000 Issue 8310

2013-07-26 Thread php-general-digest-help

php-general Digest 26 Jul 2013 09:18:07 - Issue 8310

Topics (messages 321704 through 321715):

Re: What wrong am I doing now?
321704 by: Karl-Arne Gjersøyen
321705 by: Matijn Woudt
321706 by: Sebastian Krebs
321707 by: Jim Giner
321708 by: Matijn Woudt
321709 by: Jim Giner

Quick Q.
321710 by: Richard Quadling
321711 by: Matijn Woudt
321713 by: Richard Quadling
321714 by: Matijn Woudt

Re: COM - Assigning to method.
321712 by: Richard Quadling

From 24/7/2013 to 2013-07-24
321715 by: Karl-Arne Gjersøyen

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---
http://www.php.net/manual/en/datetime.format.php have the solution. Sorry
for asking before I look at php.net!!!

Karl

-- Forwarded message --
From: Karl-Arne Gjersøyen karlar...@gmail.com
Date: 2013/7/24
Subject: What wrong am I doing now?
To: PHP Mailinglist php-gene...@lists.php.net


mysql SELECT DATE_FORMAT(dato, '%e-%c-%Y') FROM transportdokument WHERE
dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;
+---+
| DATE_FORMAT(dato, '%e-%c-%Y') |
+---+
| 24-7-2013 |
| 23-7-2013 |
+---+
2 rows in set (0.00 sec)

mysql


// My PHP code looks like this.
// -
$sql = SELECT DATE_FORMAT(dato, '%e-%c-%Y') FROM transportdokument WHERE
dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;
$resultat = mysql_query($sql, $tilkobling) or die(mysql_error());

while($rad = mysql_fetch_array($resultat)){
$dato = $rad['dato'];
var_dump($dato);

I gott NULL,NULL here and believe it is something with my PHP Source that
is wrong when using DATE_FORMAT. As you see above it work in terminal.

I hope this not is off-topic for the list. If so, I am sorry for it and
hope you can give me advice about a good MySQL list for newbie's.

Thanks again for your help!

Karl
---End Message---
---BeginMessage---
On Wed, Jul 24, 2013 at 2:19 PM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 mysql SELECT DATE_FORMAT(dato, '%e-%c-%Y') FROM transportdokument WHERE
 dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;
 +---+
 | DATE_FORMAT(dato, '%e-%c-%Y') |
 +---+
 | 24-7-2013 |
 | 23-7-2013 |
 +---+
 2 rows in set (0.00 sec)

 mysql


 // My PHP code looks like this.
 // -
 $sql = SELECT DATE_FORMAT(dato, '%e-%c-%Y') FROM transportdokument WHERE
 dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;
 $resultat = mysql_query($sql, $tilkobling) or die(mysql_error());

 while($rad = mysql_fetch_array($resultat)){
 $dato = $rad['dato'];


$rad['dato'] probably doesn't exist because you used DATE_FORMAT.
Either use $rad[0], or use the following SQL:

$sql = SELECT DATE_FORMAT(dato, '%e-%c-%Y') AS dato FROM transportdokument
WHERE dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;

Regards,

Matijn
---End Message---
---BeginMessage---
Hi,

Just want to mention: ext/mysel is deprecated. Use MySQLi, or PDO_MYSQL
instead. :)

Regards,
Sebastian


2013/7/24 Karl-Arne Gjersøyen karlar...@gmail.com

 http://www.php.net/manual/en/datetime.format.php have the solution. Sorry
 for asking before I look at php.net!!!

 Karl

 -- Forwarded message --
 From: Karl-Arne Gjersøyen karlar...@gmail.com
 Date: 2013/7/24
 Subject: What wrong am I doing now?
 To: PHP Mailinglist php-gene...@lists.php.net


 mysql SELECT DATE_FORMAT(dato, '%e-%c-%Y') FROM transportdokument WHERE
 dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;
 +---+
 | DATE_FORMAT(dato, '%e-%c-%Y') |
 +---+
 | 24-7-2013 |
 | 23-7-2013 |
 +---+
 2 rows in set (0.00 sec)

 mysql


 // My PHP code looks like this.
 // -
 $sql = SELECT DATE_FORMAT(dato, '%e-%c-%Y') FROM transportdokument WHERE
 dato = '2013-07-20' AND dato = '2013-07-24' GROUP BY dato DESC;
 $resultat = mysql_query($sql, $tilkobling) or die(mysql_error());

 while($rad = mysql_fetch_array($resultat)){
 $dato = $rad['dato'];
 var_dump($dato);

 I gott NULL,NULL here and believe it is something with my PHP Source that
 is wrong when using DATE_FORMAT. As you see above it work in terminal.

 I hope this not is off-topic for the list. If so, I am sorry for it and
 hope you can give me advice about a good

php-general Digest 26 Jul 2013 21:29:46 -0000 Issue 8311

2013-07-26 Thread php-general-digest-help

php-general Digest 26 Jul 2013 21:29:46 - Issue 8311

Topics (messages 321716 through 321725):

Re: From 24/7/2013 to 2013-07-24
321716 by: Přemysl Fiala
321717 by: Karl-Arne Gjersøyen
321718 by: Jim Giner
321719 by: Jim Giner
321720 by: Alejandro Michelin Salomon
321721 by: jomali
321722 by: Robert Cummings
321723 by: jomali
321724 by: Alejandro Michelin Salomon
321725 by: Robert Cummings

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---

Hello,

try  - reference

 foreach($lagret_dato as $dag) or something like this :-)

Premek.

On Fri, 26 Jul 2013 11:18:03 +0200, Karl-Arne Gjersøyen  
karlar...@gmail.com wrote:



Below is something I try that ofcourse not work because of rsosort.
Here is my code:
---
$lagret_dato = $_POST['lagret_dato'];
foreach($lagret_dato as $dag){

$dag = explode(/, $dag);
   rsort($dag);
$dag = implode(-, $dag);
var_dump($dag);

What I want is a way to rewrite contents of a variable like this:

From 24/7/2013 to 2013-07-24

Is there a way in PHP to do this?

Thank you very much.

Karl


---End Message---
---BeginMessage---
2013/7/26 Davi Marcondes Moreira davi.marcondes.more...@gmail.com

 Hi! I suggest you to try this:

 $foo = DateTime::createFromFormat('d/m/Y');
 $newDate = $foo-format('Y-m-d');



Thank you veyr much. With a small modification this work perfec!

Karl


  Em 26/07/2013 09:19, Karl-Arne Gjersøyen karlar...@gmail.com
 escreveu:

 Below is something I try that ofcourse not work because of rsosort.
 Here is my code:
 ---
 $lagret_dato = $_POST['lagret_dato'];
 foreach($lagret_dato as $dag){

 $dag = explode(/, $dag);
rsort($dag);
 $dag = implode(-, $dag);
 var_dump($dag);

 What I want is a way to rewrite contents of a variable like this:

 From 24/7/2013 to 2013-07-24

 Is there a way in PHP to do this?

 Thank you very much.

 Karl


---End Message---
---BeginMessage---
I think you should change from using 'rsort' ( a SORT function) to 
'array_reverse', a simple reverse function.

Your example of what you desire is wrong.
24-7-2013 will give you the 2013-24-7 that you want.
Here is my sample code.  Try it yourself.

?
$dag = array(24/7/2013);
echo Began with: ;var_dump( $dag);
echo br**br;
echo Try using rsortbr;
$dagparts = explode(/,$dag[0]);
echo dagparts: ;
var_dump($dagparts);
echo br**br;
rsort($dagparts);
echo sorted dagparts: ;
var_dump($dagparts);
echo br**br;
$newdag = implode(-,$dagparts);
echo newdag: ;
var_dump($newdag);
echo br**br;
echo Now use array_reversebr;
$dagparts = explode(/,$dag[0]);
echo dagparts: ;
var_dump($dagparts);
echo br**br;
$dagparts = array_reverse($dagparts);
echo REVERSED dagparts: ;
var_dump($dagparts);
echo br**br;
$newdag = implode(-,$dagparts);
echo newdag: ;
var_dump($newdag);
echo br**br;

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

On 7/26/2013 10:10 AM, Jim Giner wrote:

I think you should change from using 'rsort' ( a SORT function) to
'array_reverse', a simple reverse function.
Your example of what you desire is wrong.
24-7-2013 will give you the 2013-24-7 that you want.


oops.
I meant to say will NOT give you the 2013-2407 that you want.

---End Message---
---BeginMessage---
Use this:

echo preg_replace('#(\d{2})/(\d{2})/(\d{4})#' , \\3-\\2-\\1, '24/07/2013'
); RESULT = 2013-07-24

Alejandro M.S


-Mensagem original-
De: Jim Giner [mailto:jim.gi...@albanyhandball.com] 
Enviada em: sexta-feira, 26 de julho de 2013 11:12
Para: php-gene...@lists.php.net
Assunto: Re: [PHP] From 24/7/2013 to 2013-07-24

On 7/26/2013 10:10 AM, Jim Giner wrote:
 I think you should change from using 'rsort' ( a SORT function) to 
 'array_reverse', a simple reverse function.
 Your example of what you desire is wrong.
 24-7-2013 will give you the 2013-24-7 that you want.

oops.
I meant to say will NOT give you the 2013-2407 that you want.


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


---End Message---
---BeginMessage---
On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 Below is something I try that ofcourse not work because of rsosort.
 Here is my code:
 ---
 $lagret_dato = $_POST['lagret_dato'];
 foreach($lagret_dato as $dag){

 $dag = explode(/, $dag);
rsort($dag);
 $dag = implode(-, $dag);
 var_dump($dag);

 What I want is a way to rewrite contents of a variable like this:

 From 24/7/2013 to 2013-07-24

 Is there a way in PHP to do this?

 Thank

php-general Digest 24 Jul 2013 12:19:21 -0000 Issue 8309

2013-07-24 Thread php-general-digest-help

php-general Digest 24 Jul 2013 12:19:21 - Issue 8309

Topics (messages 321698 through 321703):

Re: /tmp/directory
321698 by: Daniel Brown
321702 by: Tedd Sperling

Re: How to extract php source code from joomla
321699 by: Yoinier Hernandez Nieves
321701 by: richard gray

Re: Foreach and mydql_query problem
321700 by: Karl-Arne Gjersøyen

What wrong am I doing now?
321703 by: Karl-Arne Gjersøyen

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 Mon, Jul 22, 2013 at 10:10 PM, Tedd Sperling t...@sperling.com wrote:
 On Jul 22, 2013, at 4:10 PM, Matijn Woudt tijn...@gmail.com wrote:

 On Mon, Jul 22, 2013 at 5:20 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:

 I should know this, but I don't.

 Where is the /tmp/ directory?

 You see, I have a client where his host has apparently changed the /tmp/
 directory permissions such that old php/mysql scripts cannot write to the
 /tmp/ directory anymore -- they did at one time.

 So, how do I fix it?

 Cheers,

 tedd


 Switch host? /tmp is required by the FHS and POSIX standards (writable for
 any user), any host changing that should have no customers.

 - Matijn


 Good point -- we will add that reason to the many other reasons why we are 
 changing host.

 Keep in mind, the installed software worked for nearly a decade and now the 
 host has changed something that caused this error, but the current host 
 doesn't seem to know what happened.

If it's /tmp, it's /tmp.  The leading slash indicates that it's in
the filesystem root.  However, if it's just tmp, then it could - and
probably is - under the client's home directory.  Unless they're
chrooted; then it could be displayed as /tmp, but would actually be
virtualized by the OS, where /tmp isn't really /tmp, but could be
/var/virtfs/user/tmp.

Confusing?  Sure.  Off-topic for the list?  Sort of, but that's
easy enough to change.

Since you can't use get_sys_temp_dir() on 4.3.10, you should
instead see if $_ENV contains an array key for TMP, TMPDIR, or TEMP.
Or, if you'd rather, you can use getenv('TMP') and the like.  It
doesn't mean that you'll get any useful information back (or anything
at all, necessarily), but it's another thing to try when using such an
antiquated version (I believe it was released at the end of 2004).

--
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/
---End Message---
---BeginMessage---
On Jul 23, 2013, at 9:55 AM, Daniel Brown danbr...@php.net wrote:
 
 
If it's /tmp, it's /tmp.  The leading slash indicates that it's in
 the filesystem root.  However, if it's just tmp, then it could - and
 probably is - under the client's home directory.  Unless they're
 chrooted; then it could be displayed as /tmp, but would actually be
 virtualized by the OS, where /tmp isn't really /tmp, but could be
 /var/virtfs/user/tmp.
 
Confusing?  Sure.  Off-topic for the list?  Sort of, but that's
 easy enough to change.
 
Since you can't use get_sys_temp_dir() on 4.3.10, you should
 instead see if $_ENV contains an array key for TMP, TMPDIR, or TEMP.
 Or, if you'd rather, you can use getenv('TMP') and the like.  It
 doesn't mean that you'll get any useful information back (or anything
 at all, necessarily), but it's another thing to try when using such an
 antiquated version (I believe it was released at the end of 2004).

Thanks Daniel.

tedd


_
t...@sperling.com
http://sperling.com

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

El 22/07/13 15:49, elk dolk escribió:

Thank you for the quick response ! What I am trying to do : I have to complete 
two university projects for

  my professor !

project One  : Make an online shop and must use the following components in it


Shopping cart, Catalog of products, payment gateway , user login and user 
activity log .

You can use Prestashop, Magento, Oscommerce, etc, and modify at you're 
needed.


project Two : Implementing of a B2B sell-side portal with negotiation mechanism.


You can modify above softwares to this purpose.

Thanks

As I am familiar with php and My.SQL and I have only 20 days to complete those 
projects !  I thought it's
(...)

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

php-general Digest 23 Jul 2013 13:05:02 -0000 Issue 8308

2013-07-23 Thread php-general-digest-help

php-general Digest 23 Jul 2013 13:05:02 - Issue 8308

Topics (messages 321692 through 321697):

Re: /tmp/directory
321692 by: Matijn Woudt
321694 by: Tedd Sperling

Re: How to extract php source code from joomla
321693 by: Ashley Sheridan
321695 by: Tedd Sperling
321696 by: elk dolk
321697 by: Tedd Sperling

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 Mon, Jul 22, 2013 at 5:20 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:

 I should know this, but I don't.

 Where is the /tmp/ directory?

 You see, I have a client where his host has apparently changed the /tmp/
 directory permissions such that old php/mysql scripts cannot write to the
 /tmp/ directory anymore -- they did at one time.

 So, how do I fix it?

 Cheers,

 tedd


Switch host? /tmp is required by the FHS and POSIX standards (writable for
any user), any host changing that should have no customers.

- Matijn
---End Message---
---BeginMessage---
On Jul 22, 2013, at 4:10 PM, Matijn Woudt tijn...@gmail.com wrote:

 On Mon, Jul 22, 2013 at 5:20 PM, Tedd Sperling t...@sperling.com wrote:
 
 Hi gang:
 
 I should know this, but I don't.
 
 Where is the /tmp/ directory?
 
 You see, I have a client where his host has apparently changed the /tmp/
 directory permissions such that old php/mysql scripts cannot write to the
 /tmp/ directory anymore -- they did at one time.
 
 So, how do I fix it?
 
 Cheers,
 
 tedd
 
 
 Switch host? /tmp is required by the FHS and POSIX standards (writable for
 any user), any host changing that should have no customers.
 
 - Matijn


Good point -- we will add that reason to the many other reasons why we are 
changing host.

Keep in mind, the installed software worked for nearly a decade and now the 
host has changed something that caused this error, but the current host doesn't 
seem to know what happened.

Cheers,

tedd

_
t...@sperling.com
http://sperling.com
---End Message---
---BeginMessage---
On Mon, 2013-07-22 at 13:10 -0700, elk dolk wrote:

 I am allowed to use tools or code by hand , it does not matter ,the professor 
 wants to have the source code.
 
 
 
 


You say tools, but would he consider a full-blown complex CMS as merely
a tool, or not? At this point, I agree, your best option is probably a
CMS with plugins, because 20 days is not much time to build that sort of
thing, and that's coming from someone who develops in PHP for a living.

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


---End Message---
---BeginMessage---
On Jul 22, 2013, at 3:49 PM, elk dolk elkd...@yahoo.com wrote:
 Thank you for the quick response ! What I am trying to do : I have to 
 complete two university projects for
 
  my professor !
 
 project One  : Make an online shop and must use the following components in 
 it 
 
 
 Shopping cart, Catalog of products, payment gateway , user login and user 
 activity log .
 
 
 project Two : Implementing of a B2B sell-side portal with negotiation 
 mechanism.
 
 As I am familiar with php and My.SQL and I have only 20 days to complete 
 those projects !  I thought it's 
 
 better to use Joomla I'll be grateful if you can give me an advice 
 
 
 thank you
 

Sounds more like a client than someone who teaches php.

I couldn't do that from scratch in 20 days and I teach php at college level. 
That's more than my entire 16 weeks course of introductory php. Are you in an 
advanced class?

tedd

_
tedd.sperl...@gmail.com
http://sperling.com
---End Message---
---BeginMessage---


I study for MSc degree at university.




 Are you in an advanced class?---End Message---
---BeginMessage---
On Jul 23, 2013, at 12:15 AM, elk dolk elkd...@yahoo.com wrote:

 I study for MSc degree at university.
 
  Are you in an advanced class?

Ok, congratulations -- you are studying for an MSc -- but that didn't answer 
the question.

So, let me repeat the question:

[1] Are you in an advanced PHP class?

[2] Or is this just an introductory class?


If [1], then the coursework might be understandable, but still very difficult.

If [2], that is far more than what I teach as an Introduction to PHP course.


tedd

_
tedd.sperl...@gmail.com
http://sperling.com
---End Message---


php-general Digest 22 Jul 2013 08:03:50 -0000 Issue 8306

2013-07-22 Thread php-general-digest-help

php-general Digest 22 Jul 2013 08:03:50 - Issue 8306

Topics (messages 321666 through 321668):

Foreach and mydql_query problem
321666 by: Karl-Arne Gjersøyen
321667 by: Tamara Temple
321668 by: Stuart Dallas

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---
Hello again.
I have this this source code that not work as I want...

THe PHP/HTHML form fields is generated by a while loop and looks like this:

input type=number name=number_of_items[] size=6 value=?hp
echo $item; ? required=required


the php source code look like this:
?php
if(!empty($_POST['number_of_itemsi'])){
include('../../connect.php');

foreach($number_of_items as $itemi){
echo $itemibr;

$sql = UPDATE item_table SET number_item = '$item' WHERE date
= '$todays_date' AND sign = '$username';
mysql_query($sql,$connect) or die(mysql_error());
 }
}

?

The problem is:
Foreach list every items as expected in PHP doc and I thought that $sql and
mysql_query should be run five times when I have five items.
But the problem is that only the very last number_of_items is written when
update the form..
I believe this is becayse number_of_items = '$item in $sqk override every
earlier result.

So my querstion is. How to to update the database in this case?

Thanks again for your good advice  and time to help me.

Karl'
---End Message---
---BeginMessage---

On Jul 22, 2013, at 1:19 AM, Karl-Arne Gjersøyen karlar...@gmail.com wrote:

 Hello again.
 I have this this source code that not work as I want...
 
 THe PHP/HTHML form fields is generated by a while loop and looks like this:
 
 input type=number name=number_of_items[] size=6 value=?hp
 echo $item; ? required=required
 
 
 the php source code look like this:
 ?php
 if(!empty($_POST['number_of_itemsi'])){
include('../../connect.php');
 
foreach($number_of_items as $itemi){
echo $itemibr;
 
$sql = UPDATE item_table SET number_item = '$item' WHERE date
 = '$todays_date' AND sign = '$username';
mysql_query($sql,$connect) or die(mysql_error());
 }
 }
 
 ?
 
 The problem is:
 Foreach list every items as expected in PHP doc and I thought that $sql and
 mysql_query should be run five times when I have five items.
 But the problem is that only the very last number_of_items is written when
 update the form..
 I believe this is becayse number_of_items = '$item in $sqk override every
 earlier result.
 
 So my querstion is. How to to update the database in this case?
 
 Thanks again for your good advice  and time to help me.
 
 Karl'

Either the code you posted isn't the actual code, or if it is, the errors 
should be rather obvious. Post *actual* code.

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

On 22 Jul 2013, at 08:04, Tamara Temple tamouse.li...@gmail.com wrote:

 On Jul 22, 2013, at 1:19 AM, Karl-Arne Gjersøyen karlar...@gmail.com wrote:
 
 Hello again.
 I have this this source code that not work as I want...
 
 THe PHP/HTHML form fields is generated by a while loop and looks like this:
 
 input type=number name=number_of_items[] size=6 value=?hp
 echo $item; ? required=required
 
 
 the php source code look like this:
 ?php
 if(!empty($_POST['number_of_itemsi'])){
   include('../../connect.php');
 
   foreach($number_of_items as $itemi){
   echo $itemibr;
 
   $sql = UPDATE item_table SET number_item = '$item' WHERE date
 = '$todays_date' AND sign = '$username';
   mysql_query($sql,$connect) or die(mysql_error());
}
 }
 
 ?
 
 The problem is:
 Foreach list every items as expected in PHP doc and I thought that $sql and
 mysql_query should be run five times when I have five items.
 But the problem is that only the very last number_of_items is written when
 update the form..
 I believe this is becayse number_of_items = '$item in $sqk override every
 earlier result.
 
 So my querstion is. How to to update the database in this case?
 
 Thanks again for your good advice  and time to help me.
 
 Karl'
 
 Either the code you posted isn't the actual code, or if it is, the errors 
 should be rather obvious. Post *actual* code.

The error is rather obvious: it loops around an array running an update 
statement that will modify a single row in the table, so it's not surprising 
that it appears like only the last entry in the array has been stored.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/---End Message---


php-general Digest 21 Jul 2013 19:46:44 -0000 Issue 8305

2013-07-21 Thread php-general-digest-help

php-general Digest 21 Jul 2013 19:46:44 - Issue 8305

Topics (messages 321665 through 321665):

Re: strip_tags
321665 by: Matijn Woudt

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---
Op 21 jul. 2013 02:53 schreef Tedd Sperling t...@sperling.com het
volgende:


 On Jul 20, 2013, at 5:34 PM, Frank Arensmeier farensme...@gmail.com
wrote:

  20 jul 2013 kl. 18:25 skrev Tedd Sperling t...@sperling.com:
 
  Hi gang:
 
  I've been using
 
$str = strip_tags($str, $allowable)
 
  as it is described via the manuals:
 
  http://php.net/manual/en/function.strip-tags.php
 
  The problem I've found is the tags br and br / are not
stripped.
 
  How do you strip all tags, but leave some tags (such as b, i, and
u -- I know these are depreciated, but my client wants them anyway).
 
  From the manual:
  allowable_tags
  You can use the optional second parameter to specify tags which should
not be stripped.
 
  Note:
  HTML comments and PHP tags are also stripped. This is hardcoded and can
not be changed with allowable_tags.
 
  Note:
  This parameter should not contain whitespace. strip_tags() sees a tag
as a case-insensitive string between  and the first whitespace or . It
means that strip_tags(br/, br) returns an empty string.
 
  It's all there… ;-)
 
  Cheers,
  /frank
 

 Yeah, but that wasn't the problem -- it was my mistake in coding.

 In any event, I figured it out.

 tedd


Could you perhaps post what the problem was so that when someone searches
for it they will have the answer right here?

- Matijn
---End Message---


php-general Digest 20 Jul 2013 16:21:53 -0000 Issue 8303

2013-07-20 Thread php-general-digest-help

php-general Digest 20 Jul 2013 16:21:53 - Issue 8303

Topics (messages 321651 through 321658):

Re: PHP and Powershell
321651 by: Alan Loos
321653 by: Serge Fonville
321654 by: Alan Loos
321655 by: Serge Fonville
321656 by: Tedd Sperling
321657 by: Alan Loos

Stripe Connect in the UK + PHP Integration.
321652 by: Richard Quadling

query order issue
321658 by: dealTek

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---
Thank you for your response Serge!
  The computer name  is for the invoke-command, ComputerName has to be 
specified to tell the computer where the command is to be routed. Since I want 
this to run locally over PHP I figured that it would be a good way to avoid 
running a script as I have read online that when it can be avoided it's a good 
practice (I also couldn't get this to work properly... :) But that is a side 
note). The piece that outputs the extra RunSpaceID and the PSComputerName is 
the $_.Status portion of everything.

If someone knows how to cut it out that would be fine but really I just need to 
pull the Target Name and the Value from result. For the attached example it 
would be $IQNTarget = iqn.2013-04.com.widget:Target1 and $Value = NotConnected 
(Which there are two options for this which is Connected or NotConnected).

To use Select Object here would I do Select-Object $Value?

Alan Loos | Flash Anywhere Project
T 925-640-2977 | alan.l...@genco.commailto:alan.l...@genco.com

CONFIDENTIALITY NOTICE: This e-mail and the attachment(s) hereto (if any) 
contain confidential information that is privileged and intended only for the 
addressee(s) hereof. If you are not an intended recipient, you are hereby 
notified that any disclosure, copying, distribution or use of this e-mail 
and/or the accompanying attachment(s) is strictly prohibited. If you have 
received this e-mail in error, please immediately notify the sender by return 
e-mail.

From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
Sent: Friday, July 19, 2013 3:05 AM
To: Alan Loos
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP and Powershell

Hi,

Although this is more powershell related than PHP...

When Powershell returns an object, you can pipe the output through 
Select-Object to get only certain object properties.

To better answer your question:
First, why do you specify ComputerName as 127.0.0.1 if the credential is 
already specified?
Also, perhaps it is easier to create a .ps1 file that you run, especially for 
readability.

HTH

Wh

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table

2013/7/18 Alan Loos alan.l...@genco.commailto:alan.l...@genco.com
Good morning everyone,
  First time posting in here, although I've been listening in for a few weeks 
now.
So this one has got me stumped, I am fairly new to PHP but I cannot seem to 
Google through this one.
I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which is 
ultimately what I'm struggling with. Please see below for script snips and 
explanations.

Also if there are any best practices you would recommend I'm open to it being 
that I am fairly new and self-taught to PHP scripting.


I have a bit of code I've put together (as ugly as it is) as follows in line:
?php


###
## Variables ##
###

$TargetName = Target1;
$login = \$cred = New-Object System.Management.Automation.PSCredential 
-ArgumentList 
@('administra...@widget.commailto:administra...@widget.com',(ConvertTo-SecureString
 -String 'MyPassword' -AsPlainText -Force));
$command = Invoke-Command -computername 127.0.0.1 -credential \$cred 
-scriptblock { Get-IscsiServerTarget -TargetName  . $TargetName .  | % { 
\$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck 
-SkipCNCheck -SkipRevocationCheck);
$psCMD = powershell -ExecutionPolicy Unrestricted -command \$login; 
$command\ NUL;



## Variable Checking (For Debug Mode) ##


#echo \$psCMD = $psCMD;



## Run Script ##


exec($psCMD,$out);



## Output ##


echo ('pre');
print_r($out);
echo ('/pre');


###
## End Of Script ##
###

echo End Of Scene;

?

The issue I have is that it feeds back:

Array
(
[0] = iqn.2013-04.com.widget:Target1
[1] =
[2] = PSComputerName RunspaceId Value
[3

php-general Digest 18 Jul 2013 13:43:07 -0000 Issue 8300

2013-07-18 Thread php-general-digest-help

php-general Digest 18 Jul 2013 13:43:07 - Issue 8300

Topics (messages 321624 through 321632):

Re: Premature end of script
321624 by: Daniel Brown
321625 by: Jim Giner

Error checking ON
321626 by: Tedd Sperling
321627 by: Jim Giner
321628 by: Daniel Brown
321629 by: Tedd Sperling
321630 by: Jim Lucas

zend framework  getIdentity
321631 by: Dan Joseph

Split/Group date together.
321632 by: Karl-Arne Gjersøyen

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 Wed, Jul 17, 2013 at 11:22 AM, R B rbp...@gmail.com wrote:
 Hello,

 5 years ago, y developed a php system and was working fine. But 20 days
 ago, when y try to access to some pages (not all the pages), in the log
 appears this message and the page is not displayed:

 == /usr/local/apache/logs/error_log ==
 [Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
 script
 headers: /home/capitale/public_html/miembros/myscript.php

 Can you help me please with this error?

It's the vaguest of all errors and the bane of the existence of
any developer who comes across it (at least it's rarer in PHP than it
was in Perl years ago).  Essentially, it would require a lot more
information that what's been provided for us to help you debug.

What things have changed in the last month?  Have you upgraded
PHP?  Made any changes to the code or any of the dependencies?  Is the
server out of available disk space?  Is something causing it to run
out of memory?  What happens when you run the same script from the
CLI?  What do you see when you enable all errors and error reporting?


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

On 7/17/2013 11:22 AM, R B wrote:

Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

== /usr/local/apache/logs/error_log ==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.

Since you state that you haven't made any changes to the system (in 
general), I'm going to guess that you modified an 'included' file and it 
has an error in it, such as an unmatched curly brace.  As Dan said, turn 
on all error checking and reporting and see what message you get.
---End Message---
---BeginMessage---
Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since you state that you haven't made any changes to the system (in general), 
 I'm going to guess that you modified an 'included' file and it has an error 
 in it, such as an unmatched curly brace.  As Dan said, turn on all error 
 checking and reporting and see what message you get.

This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

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

On 7/17/2013 11:49 AM, Tedd Sperling wrote:

Hi gang:

Considering:

On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:


Since you state that you haven't made any changes to the system (in general), 
I'm going to guess that you modified an 'included' file and it has an error in 
it, such as an unmatched curly brace.  As Dan said, turn on all error checking 
and reporting and see what message you get.


This is what I do for error checking:

ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', 'error_log');  

Is this:

1. Sufficient?

2. An overkill?

3. OK?

4. OR, better served with this (and provide an example).

Cheers,

tedd

_
t...@sperling.com
http://sperling.com

When I'm in development mode, I leave out the last two settings and take 
my error messages from the screen.  Simpler, quicker.  I use an include 
file that is based upon a switch.  When it's on, I set my devl settings, 
when not, I set my prod settings.
---End Message---
---BeginMessage---
On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 Considering:

 On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Since

php-general Digest 19 Jul 2013 01:53:46 -0000 Issue 8301

2013-07-18 Thread php-general-digest-help

php-general Digest 19 Jul 2013 01:53:46 - Issue 8301

Topics (messages 321633 through 321645):

Re: Split/Group date together.
321633 by: Bastien Koert
321634 by: Larry Garfield

PHP and Powershell
321635 by: Alan Loos

I am completely lost and need an advice (beginner)
321636 by: php colos
321637 by: shiplu
321638 by: Daniel Brown
321639 by: Carsten Jensen
321640 by: Sebastian Krebs

pass parameter from client to server
321641 by: iccsi
321642 by: Daniel Brown
321643 by: Tedd Sperling
321644 by: Tedd Sperling
321645 by: Joshua Kehn

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---
Normally, what I do here is handle that in the loop to display the records
... so start by adding an order by clause to keep the dates together

SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013' order by dato

$prior_date = ;

$sHTML = table;

while($rows = mysql_fetch_array($result)){

if ($prior_date != $rows['dato']){
if($open_table){
   $sHTML .= /tabletable;
   $prior_date = $rows['dato'];
 }
}
$sHTML .= tr;
$sHTML .= td. $rows['dato'] . /td;
$sHTML .= td. $rows['some_field'] . /td;
$sHTML .= td. $rows['another_field'] . /td;
$sHTML .= td. $rows['third_field'] . /td;
$sHTML .= /tr;
}

$sHTML .= /table;


On Thu, Jul 18, 2013 at 9:43 AM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 Hello again.
 In my program I have this:

 mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
 = '18/7/2013';

 This list all reccrds for 3 days. I need a way to split it up for every day
 even when the requst is as above and don't know in what way I can do it.

 I like to have all records for day 16 in one table in PHP/HTML and all
 records for day 17 in another table.
 i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

 I hope for your help and advice to do also this correct.

 Thank you for your time and effort!

 Karl




-- 

Bastien

Cat, the other other white meat
---End Message---
---BeginMessage---
If I understand you correctly, I call what you're trying to do PHP 
group by, and did a write up on it a few years back:


http://www.garfieldtech.com/blog/php-group-by-with-arrays

--Larry Garfield

On 7/18/13 8:43 AM, Karl-Arne Gjersøyen wrote:

Hello again.
In my program I have this:

mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013';

This list all reccrds for 3 days. I need a way to split it up for every day
even when the requst is as above and don't know in what way I can do it.

I like to have all records for day 16 in one table in PHP/HTML and all
records for day 17 in another table.
i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

I hope for your help and advice to do also this correct.

Thank you for your time and effort!

Karl

---End Message---
---BeginMessage---
Good morning everyone,
  First time posting in here, although I've been listening in for a few weeks 
now.
So this one has got me stumped, I am fairly new to PHP but I cannot seem to 
Google through this one.
I cannot figure out how to 'exclude' PSComputerName and RunspaceId, which is 
ultimately what I'm struggling with. Please see below for script snips and 
explanations.

Also if there are any best practices you would recommend I'm open to it being 
that I am fairly new and self-taught to PHP scripting.


I have a bit of code I've put together (as ugly as it is) as follows in line:
?php


###
## Variables ##
###

$TargetName = Target1;
$login = \$cred = New-Object System.Management.Automation.PSCredential 
-ArgumentList @('administra...@widget.com',(ConvertTo-SecureString -String 
'MyPassword' -AsPlainText -Force));
$command = Invoke-Command -computername 127.0.0.1 -credential \$cred 
-scriptblock { Get-IscsiServerTarget -TargetName  . $TargetName .  | % { 
\$_.TargetIqn, \$_.Status}} -SessionOption (New-PSSessionOption -SkipCACheck 
-SkipCNCheck -SkipRevocationCheck);
$psCMD = powershell -ExecutionPolicy Unrestricted -command \$login; 
$command\ NUL;



## Variable Checking (For Debug Mode) ##


#echo \$psCMD = $psCMD;



## Run Script ##


exec($psCMD,$out);



## Output ##


echo ('pre');
print_r($out);
echo ('/pre');


###
## End Of Script ##
###

echo End Of Scene;

?

The issue I have is that it feeds back:

Array
(
[0] = iqn.2013-04.com.widget:Target1
[1] =
[2

php-general Digest 17 Jul 2013 15:23:04 -0000 Issue 8299

2013-07-17 Thread php-general-digest-help

php-general Digest 17 Jul 2013 15:23:04 - Issue 8299

Topics (messages 321621 through 321623):

Re: How to read PHP-FPM config values using phpinfo
321621 by: Daniel
321622 by: Amiya Maji

Premature end of script
321623 by: R B

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---
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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

---End Message---
---BeginMessage---
Daniel, thanks for asking. 
I do have Apache correctly configured to use fpm, in fact, phpinfo shows 
php-fpm as the cgi module. Only problem is to read (or dump) the Fpm configs 
from phpinfo.

Regards,
Amiya.




 Original message 
From: Daniel danielx...@gmail.com 
Date: 07/16/2013  9:48 PM  (GMT-05:00) 
To: Amiya Maji am...@purdue.edu 
Cc: php-gene...@lists.php.net 
Subject: Re: [PHP] How to read PHP-FPM config values using phpinfo 
 
Hi there,

Just a question, do you have Apache configured to use the PHP-FPM and
not the Apache module? That something that people can mess up on.

Thanks :)



On Wed, Jul 17, 2013 at 9:58 AM, Amiya Maji am...@purdue.edu wrote:
 Hi all,

 I am using PHP-FPM with Apache 2.4. I periodically change my php-fpm.conf
 and reload it by sending USR2 signal to the FPM process. Is there a way to
 print the updated parameters in FPM using phpinfo().
 At present I am not seeing any FPM specific parameters in phpinfo. Any
 suggestion is appreciated.

 Thanks!
 Amiya.

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

---End Message---
---BeginMessage---
Hello,

5 years ago, y developed a php system and was working fine. But 20 days
ago, when y try to access to some pages (not all the pages), in the log
appears this message and the page is not displayed:

== /usr/local/apache/logs/error_log ==
[Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of
script
headers: /home/capitale/public_html/miembros/myscript.php

Can you help me please with this error?

Thank you.
---End Message---


php-general Digest 16 Jul 2013 23:58:16 -0000 Issue 8298

2013-07-16 Thread php-general-digest-help

php-general Digest 16 Jul 2013 23:58:16 - Issue 8298

Topics (messages 321617 through 321620):

Kickstarter Project on Massive Log data Aggregation and Processing with Open 
Source Software
321617 by: Israel Ekpo
321618 by: Daniel Brown

Problem with dba_open() on db4 database
321619 by: Thorsten Göllner

How to read PHP-FPM config values using phpinfo
321620 by: Amiya Maji

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---
Hi Everyone,

I just launched a Kickstarter project that will fund the creation of a
course on how to aggregate, process, search and visualize massive log data
using open source software.

I believe some of the folks on the user mailing list would find this
helpful.

Web applications do generate a lot of log data and I believe that knowing
how to deal with it could be very valuable.

Is it OK to send out an email with a summary of what the project is about?
---End Message---
---BeginMessage---
On Jul 15, 2013 11:29 PM, Israel Ekpo israele...@gmail.com wrote:

 Hi Everyone,

[snip!]

No.  Good luck with your endeavor, but please do not broadcast it to
this list.
---End Message---
---BeginMessage---

Hi,

I am using a db4 database to store some values (on the local 
filesystem). Here the sample code:


$handle = dba_open(/var/cache/mydb.db, cd, db4);
[...]
$result = dba_replace($key, serialize($data), $handle);
[...]
dba_close($handle);

This Code is used in a CLI-Script (in an Asterisk-AGI-Script) and will 
be used by some processes in parallel. The online documentation 
(http://de1.php.net/manual/en/function.dba-open.php) shows, that the 
function should wait if more than a process has a lock on the 
database. This works fine if I use the script an execute it in differnt 
shells in parallel.


But SOMETIMES(!) I get (in the Asterisk-Environment) the following error 
message:
dba_open(/var/cache/mydb.db,cd): Driver initialization failed for 
handler: db4: Unable to establish lock (database file already open)


So it seems, that the function dba_open() returns immediatly without 
waiting for lock release. But I do not know why ... ?!


I am using the following versions:
Ubuntu 12.04. LTS (up to date) with PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch

Any idea?

Thank in advance
-Thorsten-





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

Hi all,

I am using PHP-FPM with Apache 2.4. I periodically change my 
php-fpm.conf and reload it by sending USR2 signal to the FPM process. Is 
there a way to print the updated parameters in FPM using phpinfo().
At present I am not seeing any FPM specific parameters in phpinfo. Any 
suggestion is appreciated.


Thanks!
Amiya.
---End Message---


php-general Digest 15 Jul 2013 08:21:53 -0000 Issue 8296

2013-07-15 Thread php-general-digest-help

php-general Digest 15 Jul 2013 08:21:53 - Issue 8296

Topics (messages 321612 through 321613):

Re: COM - Assigning to method.
321612 by: Andrew Ballard
321613 by: Adam Nicholls

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 Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote:

 Richard - I've tried that I get an error about it not being defined as
 property of the object.

 Andrew - do you mean try using the method Richard has shown?

 Cheers
 Adam.

 On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:
 
 
 
  On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:
 
  On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
  
   Hi Guys/Gals,
  
   I'm doing some integration work with a COM API and according to their
   documentation to save data in the API, you have to assign to the
   method.
  
   This is their example in Visual Basic:
  
  
 
  -
   Set oBank = New CBank
   oBank.Init Application.SessionContext
   With oBank
   .Fields(BANK_fld_ACCOUNT_NAME) = Test account
   .Fields(BANK_fld_ACCOUNT_NO) = 12345
   .Fields(BANK_fld_BANK) = Bank of the Nation
   .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
   End With
   oBank.Save
  
 
  -
  
   Obviously in PHP is isn't possible to assign to a method in this way
   (thats what parameters are for!) So I'm at a bit of a loose end. I'm
   wondering if anyone else has come across this? Or am I missing
   something obvious in PHP's implementation of the COM that allows me to
   work around this?
  
   My PHP Code is looks like this:
  
 
  -
   $API = new COM('API7.API');
   $API-Init($SerialNo, $Login, '', 1, '', 1);
   $API-SignOutOnTerminate = True;
  
   $Record = new COM(Data.Record);
   $Record-Init($API-SessionContext);
  
   $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
  
 
  -
  
   I've also tried (below) but the API says wrong number of parameters
   $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
  
   I've also tried something crazy like this (below) but that overwrites
   the $Record object.
   $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
   $_R = 'Test Account';
  
  
   Any ideas? Is it possible?
  
  
   Many Thanks
   Adam Nicholls
  
 
  That example isn't assigning values to method return value. Fields is a
  collection of ADO Field objects. The default property of a Field object is
  its Value property, so the shorthand is simply assigning the values of the
  variables to the value of each field in a record within a Recordset.
 
  Andrew
 
 
  So ..
 
  $oBank-BANK_fld_ACCOUNT_NAME = Test account;
 
  sort of thing.
 
  --
  Richard Quadling
  Twitter : @RQuadling



 --
 Adam Nicholls

Richard has the general idea correct, but as I recall it is a little
more involved because it's COM. I've never done that much with COM in
PHP because it was always such a pain. The example you posted probably
used to require com_set() in PHP 4, although it looks like that has
been deprecated in favor of a more typical OO syntax in PHP 5. Is
there any chance there is a PHP version of the library that you can
work with to avoid COM? If not, hopefully what follows will help start
you on the right direction.

A more explicit version of your original VBScript example looks like this:

Set oBank = New CBank
oBank.Init Application.SessionContext

Set oField = oBank.Fields(BANK_fld_ACCOUNT_NAME)
oField.Value = Test account
Set oField = oBank.Fields(BANK_fld_ACCOUNT_NO)
oField.Value = 12345
Set oField = oBank.Fields(BANK_fld_BANK)
oField.Value = Bank of the Nation
Set oField = oBank.Fields(BANK_fld_BRANCH_NAME)
oField.Value = State Street Branch

oBank.Save


I'm not familiar with your CBank COM class, but the rest of it looks
like it is similar to the COM('ADODB.Recordset'). If so, a rough
translation of your original example should resemble this:

?php
// I'm not familiar with this object, so I'm guessing on the call to
instantiate it here.
$oBank = new COM('CBank');

/**
Application.SessionContext in the original refers to an object that is
global to every request in an application. PHP does not have such a
global registry, so I'm not sure where you're $config needs to come
from.
*/
$oBank-Init($config);

/**
I am assuming that BANK_fld_ACCOUNT_NAME

php-general Digest 15 Jul 2013 21:26:50 -0000 Issue 8297

2013-07-15 Thread php-general-digest-help

php-general Digest 15 Jul 2013 21:26:50 - Issue 8297

Topics (messages 321614 through 321616):

Re: COM - Assigning to method.
321614 by: Pøemysl Fiala
321615 by: Andrew Ballard

Urgent Requirement - PHP Senior Developer / Seasoned Trainer
321616 by: Nitin Sathawane

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---

Hello,

did you tried var_dump or print_r the $oBank object to see his structure ?

Also you can try:

 $BANK_fld_BRANCH_NAME = 22;
 $oBank-$BANK_fld_BRANCH_NAME  = 'something';


Premek.


On Mon, 15 Jul 2013 10:21:48 +0200, Adam Nicholls inkysp...@gmail.com  
wrote:



Hi Andrew

Thanks for this.

But I'm still getting errors. I think I need to explain a bit more.

Unfortunately there isn't a PHP API for this application I'm trying to
interact with, my goal really is to be able to expose the COM
functionality over a web-service such as SOAP so I can use it in a
CMS. The application I'm trying to integrate with is Blackbuad's
Raiser's Edge - API documentation here:
https://www.blackbaud.com/files/support/guides/re7ent/api.pdf

I think part of the problem is that the field names are also
represented by an integer. So to get data out I would do:

$oBank-Fields(22);   // which maps to BANK_fld_BRANCH_NAME.

When I do:

$oBank-22 = 'blah blah';

I get an error because a property can't be numeric, it has to start as
alpha character. If I use:

$oBank-BANK_fld_BRANCH_NAME = 'blah blah blah';

I get the following error:

Fatal error: Uncaught exception 'com_exception' with message 'Unable
to lookup `BANK_fld_BRANCH_NAME': Unknown name.

I've also tried using your Value property returned by Fields():

$oBank-Fields(22)-Value = 'Blah Blah blah blah';

Which I then get:
PHP Warning:  Creating default object from empty value in [C:\Users]
Fatal error: Call to undefined method variant::Save()

Soo seems nearly impossible to implement a safe way to write to the COM  
API.



At the moment, I'm still in the scoping/prototype stage of my project,
so I'm beginning to think that using this COM API for this project is
a no-go, which is unfortunate. I'm also guessing even if we did
implement this API, exposing it as a Web Service is going to be tricky
for performance sake (given that I've read that COM doesn't
multithread very well??)

Many Thanks
Adam.

On 14 July 2013 22:16, Andrew Ballard aball...@gmail.com wrote:
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com  
wrote:


Richard - I've tried that I get an error about it not being defined as
property of the object.

Andrew - do you mean try using the method Richard has shown?

Cheers
Adam.

On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:



 On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com  
wrote:

 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to  
their

  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

  
-

  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

  
-

 
  Obviously in PHP is isn't possible to assign to a method in this  
way
  (thats what parameters are for!) So I'm at a bit of a loose end.  
I'm

  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows  
me to

  work around this?
 
  My PHP Code is looks like this:
 

  
-

  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test  
Account';//doesn't work

 

  
-

 
  I've also tried (below) but the API says wrong number of  
parameters

  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that  
overwrites

  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any

php-general Digest 14 Jul 2013 19:18:53 -0000 Issue 8295

2013-07-14 Thread php-general-digest-help

php-general Digest 14 Jul 2013 19:18:53 - Issue 8295

Topics (messages 321611 through 321611):

Re: COM - Assigning to method.
321611 by: Adam Nicholls

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---
Richard - I've tried that I get an error about it not being defined as
property of the object.

Andrew - do you mean try using the method Richard has shown?

Cheers
Adam.

On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote:



 On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to their
  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

 -
  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

 -
 
  Obviously in PHP is isn't possible to assign to a method in this way
  (thats what parameters are for!) So I'm at a bit of a loose end. I'm
  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows me to
  work around this?
 
  My PHP Code is looks like this:
 

 -
  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
 

 -
 
  I've also tried (below) but the API says wrong number of parameters
  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that overwrites
  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields is a
 collection of ADO Field objects. The default property of a Field object is
 its Value property, so the shorthand is simply assigning the values of the
 variables to the value of each field in a record within a Recordset.

 Andrew


 So ..

 $oBank-BANK_fld_ACCOUNT_NAME = Test account;

 sort of thing.

 --
 Richard Quadling
 Twitter : @RQuadling



-- 
Adam Nicholls
---End Message---


php-general Digest 13 Jul 2013 16:11:33 -0000 Issue 8294

2013-07-13 Thread php-general-digest-help

php-general Digest 13 Jul 2013 16:11:33 - Issue 8294

Topics (messages 321610 through 321610):

Re: COM - Assigning to method.
321610 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


--
---BeginMessage---
On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote:

 On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote:
 
  Hi Guys/Gals,
 
  I'm doing some integration work with a COM API and according to their
  documentation to save data in the API, you have to assign to the
  method.
 
  This is their example in Visual Basic:
 
 

 -
  Set oBank = New CBank
  oBank.Init Application.SessionContext
  With oBank
  .Fields(BANK_fld_ACCOUNT_NAME) = Test account
  .Fields(BANK_fld_ACCOUNT_NO) = 12345
  .Fields(BANK_fld_BANK) = Bank of the Nation
  .Fields(BANK_fld_BRANCH_NAME) = State Street Branch
  End With
  oBank.Save
 

 -
 
  Obviously in PHP is isn't possible to assign to a method in this way
  (thats what parameters are for!) So I'm at a bit of a loose end. I'm
  wondering if anyone else has come across this? Or am I missing
  something obvious in PHP's implementation of the COM that allows me to
  work around this?
 
  My PHP Code is looks like this:
 

 -
  $API = new COM('API7.API');
  $API-Init($SerialNo, $Login, '', 1, '', 1);
  $API-SignOutOnTerminate = True;
 
  $Record = new COM(Data.Record);
  $Record-Init($API-SessionContext);
 
  $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work
 

 -
 
  I've also tried (below) but the API says wrong number of parameters
  $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account');
 
  I've also tried something crazy like this (below) but that overwrites
  the $Record object.
  $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME');
  $_R = 'Test Account';
 
 
  Any ideas? Is it possible?
 
 
  Many Thanks
  Adam Nicholls
 

 That example isn't assigning values to method return value. Fields is a
 collection of ADO Field objects. The default property of a Field object is
 its Value property, so the shorthand is simply assigning the values of the
 variables to the value of each field in a record within a Recordset.

 Andrew


So ..

$oBank-BANK_fld_ACCOUNT_NAME = Test account;

sort of thing.

-- 
Richard Quadling
Twitter : @RQuadling
---End Message---


  1   2   3   4   5   6   7   8   9   10   >