php-general Digest 21 Jun 2013 12:25:47 -0000 Issue 8272

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

php-general Digest 21 Jun 2013 12:25:47 - Issue 8272

Topics (messages 321440 through 321443):

Re: A Strange Problem
321440 by: Tedd Sperling
321442 by: tamouse mailing lists

Re: [PHP-DEV] PHP 5.5.0 final has been released!
321441 by: Marco Pivetta
321443 by: Ravi Gehlot

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 Jun 20, 2013, at 7:12 PM, Stuart Dallas stu...@3ft9.com wrote:
 Whatever the reason for this, I'd recommend you always specify a path 
 relative to the current script.
 
 In PHP 5.3+:
 
 $fcontents = file(__DIR__.'/docs/admin-email.txt');
 
 Prior to 5.3:
 
 $fcontents = file(dirname(__FILE__).'/docs/admin-email.txt');
 
 -Stuart

-Stuart:

Thats' an excellent idea -- I will do that.

I just don't know why after so many years this problem came up -- I never 
experienced it before -- AND when I am really up against it.

Maybe someone smarter than me (open to many) will explain why it happened.

Cheers,

tedd

_
t...@sperling.com
http://sperling.com
---End Message---
---BeginMessage---
On Jun 20, 2013 7:20 PM, Tedd Sperling t...@sperling.com wrote:

 On Jun 20, 2013, at 7:12 PM, Stuart Dallas stu...@3ft9.com wrote:
  Whatever the reason for this, I'd recommend you always specify a path
relative to the current script.
 
  In PHP 5.3+:
 
  $fcontents = file(__DIR__.'/docs/admin-email.txt');
 
  Prior to 5.3:
 
  $fcontents = file(dirname(__FILE__).'/docs/admin-email.txt');
 
  -Stuart

 -Stuart:

 Thats' an excellent idea -- I will do that.

 I just don't know why after so many years this problem came up -- I never
experienced it before -- AND when I am really up against it.

 Maybe someone smarter than me (open to many) will explain why it happened.

 Cheers,

 tedd

 _
 t...@sperling.com
 http://sperling.com

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


This was aeons ago, but i recall reading somewhere that could not
necessarily trust what directory one's script was executing in so always
spec abs paths. I've been more lax on that lately, but such things appear
from time-to-time.
---End Message---
---BeginMessage---
Well done! Congratulations!
On 20 Jun 2013 23:23, Julien Pauli jpa...@php.net wrote:

 Hello!

 The PHP Development Team would like to announce the immediate release of
 PHP 5.5.0. This release includes a large number of new features and bug
 fixes.

 A separate release announcement is also available. For changes in PHP
 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.

 Release Announcement: http://www.php.net/release_5_5_0.php
 Downloads:http://www.php.net/downloads.php#v5.5
 Changelog:http://www.php.net/ChangeLog-5.php#5.5.0

 Thanks to all contributors that made this new version available.

 regards,

 David Soria Parra  Julien Pauli

---End Message---
---BeginMessage---
Awesome!


On Thu, Jun 20, 2013 at 11:14 PM, Marco Pivetta ocram...@gmail.com wrote:

 Well done! Congratulations!
 On 20 Jun 2013 23:23, Julien Pauli jpa...@php.net wrote:

  Hello!
 
  The PHP Development Team would like to announce the immediate release of
  PHP 5.5.0. This release includes a large number of new features and bug
  fixes.
 
  A separate release announcement is also available. For changes in PHP
  5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.
 
  Release Announcement: http://www.php.net/release_5_5_0.php
  Downloads:http://www.php.net/downloads.php#v5.5
  Changelog:http://www.php.net/ChangeLog-5.php#5.5.0
 
  Thanks to all contributors that made this new version available.
 
  regards,
 
  David Soria Parra  Julien Pauli
 

---End Message---


Re: [PHP] A Strange Problem

2013-06-21 Thread tamouse mailing lists
On Jun 20, 2013 7:20 PM, Tedd Sperling t...@sperling.com wrote:

 On Jun 20, 2013, at 7:12 PM, Stuart Dallas stu...@3ft9.com wrote:
  Whatever the reason for this, I'd recommend you always specify a path
relative to the current script.
 
  In PHP 5.3+:
 
  $fcontents = file(__DIR__.'/docs/admin-email.txt');
 
  Prior to 5.3:
 
  $fcontents = file(dirname(__FILE__).'/docs/admin-email.txt');
 
  -Stuart

 -Stuart:

 Thats' an excellent idea -- I will do that.

 I just don't know why after so many years this problem came up -- I never
experienced it before -- AND when I am really up against it.

 Maybe someone smarter than me (open to many) will explain why it happened.

 Cheers,

 tedd

 _
 t...@sperling.com
 http://sperling.com

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


This was aeons ago, but i recall reading somewhere that could not
necessarily trust what directory one's script was executing in so always
spec abs paths. I've been more lax on that lately, but such things appear
from time-to-time.


Re: [PHP] Re: [PHP-DEV] PHP 5.5.0 final has been released!

2013-06-21 Thread Ravi Gehlot
Awesome!


On Thu, Jun 20, 2013 at 11:14 PM, Marco Pivetta ocram...@gmail.com wrote:

 Well done! Congratulations!
 On 20 Jun 2013 23:23, Julien Pauli jpa...@php.net wrote:

  Hello!
 
  The PHP Development Team would like to announce the immediate release of
  PHP 5.5.0. This release includes a large number of new features and bug
  fixes.
 
  A separate release announcement is also available. For changes in PHP
  5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.
 
  Release Announcement: http://www.php.net/release_5_5_0.php
  Downloads:http://www.php.net/downloads.php#v5.5
  Changelog:http://www.php.net/ChangeLog-5.php#5.5.0
 
  Thanks to all contributors that made this new version available.
 
  regards,
 
  David Soria Parra  Julien Pauli
 



[PHP] Newbie form question

2013-06-21 Thread Karl-Arne Gjersøyen
Hello.

I have an application that generete HTML5 form in PHP.
The form is written in a while loop and therefore the form field has exact
same name for every row in the loop.
And that is the problem. Because when my PHP document shall handle
submitted data it only take the very last row in the while loop and show
the result of it.

if(isset($_POST['update_explosive'])){
$item_serial_number = $_POST['item_serial_number'];
$update_item_in_store = $_POST['update_item_in_store'];

if($item_serial_number === ETX1.22X1000){
echo h1$update_item_in_store/h1;
}
if($item_serial_number === ETX1.17X460){
echo h1$update_item_in_store/h1;
}
}

I think the solution will be to create different and unike fieldname
dymamic. For example I tried to write input type=text name=?php echo
$item_serial_number; ? value=?php echo $item_serial_number; ? in
the HTML5/PHP form.

But the problem is that periode . not is allowed as $variable_name.
I then try to write it this way:

if(isset($_POST['update_explosive'])){
$item_serial_number = $_POST['ETX1.22X1000'];
$update_item_in_store = $_POST['update_item_in_store'];

if($item_serial_number === ETX1.22X1000){
echo h1$update_item_in_store/h1;
}
if($item_serial_number === ETX1.17X460){
echo h1$update_item_in_store/h1;
}
}

But this last part did not make any sense to me. I recive no output when
tried that one.

One problem is that I have between 2 and 25 items with different serial
number. Sometimes only 5 of this shall be updated and other times all 25
items. I like to do this through one simple form and not for one time for
every single item. (I know how to do when select one by one and update
them, but that is a long and hard way for people using my application. A
better solution is to just use one form and view all items there. Then just
write the amount of item in input type=number
name=update_item_in_store size=6 field.)

If you have time to help me *understand* this newbie question by explain or
give me an example or post a link to a tutorial that can help me though, I
am very thankful.

Karl


[PHP] Re: Newbie form question

2013-06-21 Thread Jim Giner

On 6/21/2013 10:09 AM, Karl-Arne Gjersøyen wrote:

Hello.

I have an application that generete HTML5 form in PHP.
The form is written in a while loop and therefore the form field has exact
same name for every row in the loop.
And that is the problem. Because when my PHP document shall handle
submitted data it only take the very last row in the while loop and show
the result of it.

if(isset($_POST['update_explosive'])){
 $item_serial_number = $_POST['item_serial_number'];
 $update_item_in_store = $_POST['update_item_in_store'];

 if($item_serial_number === ETX1.22X1000){
 echo h1$update_item_in_store/h1;
 }
 if($item_serial_number === ETX1.17X460){
 echo h1$update_item_in_store/h1;
 }
 }

I think the solution will be to create different and unike fieldname
dymamic. For example I tried to write input type=text name=?php echo
$item_serial_number; ? value=?php echo $item_serial_number; ? in
the HTML5/PHP form.

But the problem is that periode . not is allowed as $variable_name.
I then try to write it this way:

if(isset($_POST['update_explosive'])){
 $item_serial_number = $_POST['ETX1.22X1000'];
 $update_item_in_store = $_POST['update_item_in_store'];

 if($item_serial_number === ETX1.22X1000){
 echo h1$update_item_in_store/h1;
 }
 if($item_serial_number === ETX1.17X460){
 echo h1$update_item_in_store/h1;
 }
 }

But this last part did not make any sense to me. I recive no output when
tried that one.

One problem is that I have between 2 and 25 items with different serial
number. Sometimes only 5 of this shall be updated and other times all 25
items. I like to do this through one simple form and not for one time for
every single item. (I know how to do when select one by one and update
them, but that is a long and hard way for people using my application. A
better solution is to just use one form and view all items there. Then just
write the amount of item in input type=number
name=update_item_in_store size=6 field.)

If you have time to help me *understand* this newbie question by explain or
give me an example or post a link to a tutorial that can help me though, I
am very thankful.

Karl


Make your names on your input tags like this:
if you currently have
input type='text' name='field1'
then change it to this:
input type='text' name='field1[]'

This will give you an array of in your POST/GET array.



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



[PHP] PHP5 OOP: Abstract classes, multiple inheritance and constructors

2013-06-21 Thread Micky Hulse
Example/working code here:

https://gist.github.com/mhulse/5833826

Couple questions:

1. Is there anything wrong with the way I'm using the abstract class?
If so, how could I improve the logic/setup?

2. Is there a way for me to pass $foo to the parent class, from the
child, without having to ferry that variable through the abstract
class? In other words, is there such a thing as:

parent::parent::__construct($foo);

... I want to have my abstract class constructor do things, yet I'd
like to avoid having to repeat myself for when it comes to passing
constructor arguments from the child.

Any tips would be appreciated. Sorry if silly questions.

Thanks!
Micky

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



[PHP] Re: PHP5 OOP: Abstract classes, multiple inheritance and constructors

2013-06-21 Thread Micky Hulse
On Fri, Jun 21, 2013 at 12:54 PM, Micky Hulse
mickyhulse.li...@gmail.com wrote:
 2. Is there a way for me to pass $foo to the parent class, from the
 child, without having to ferry that variable through the abstract
 class?

I should mention, I'm working on some code where I don't have the
ability to modify the parent class.

I'd still like to know how to improve my demo code in general, but I'm
working on a project where the parent class is off bounds in terms of
modifying.

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



Re: [PHP] PHP 5.5.0 final has been released!

2013-06-21 Thread Julian

Awesome work and the new design for the php.net website is also nice ;)

Am 20.06.2013, 23:22 Uhr, schrieb Julien Pauli jpa...@php.net:


Hello!

The PHP Development Team would like to announce the immediate release of
PHP 5.5.0. This release includes a large number of new features and bug
fixes.

A separate release announcement is also available. For changes in PHP
5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.

Release Announcement: http://www.php.net/release_5_5_0.php
Downloads:http://www.php.net/downloads.php#v5.5
Changelog:http://www.php.net/ChangeLog-5.php#5.5.0

Thanks to all contributors that made this new version available.

regards,

David Soria Parra  Julien Pauli


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



[PHP] Re: [PHP-DEV] [PHP] PHP 5.5.0 final has been released!

2013-06-21 Thread Martin Amps
I second this - great to see both finally available. Fantastic release!

Martin Amps | CIO
www.iCracked.com
iCracked | Redwood City, CA

On Jun 21, 2013, at 2:01 PM, Julian jswprog.mailingli...@gmx.at wrote:

 Awesome work and the new design for the php.net website is also nice ;)
 
 Am 20.06.2013, 23:22 Uhr, schrieb Julien Pauli jpa...@php.net:
 
 Hello!
 
 The PHP Development Team would like to announce the immediate release of
 PHP 5.5.0. This release includes a large number of new features and bug
 fixes.
 
 A separate release announcement is also available. For changes in PHP
 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.
 
 Release Announcement: http://www.php.net/release_5_5_0.php
 Downloads:http://www.php.net/downloads.php#v5.5
 Changelog:http://www.php.net/ChangeLog-5.php#5.5.0
 
 Thanks to all contributors that made this new version available.
 
 regards,
 
 David Soria Parra  Julien Pauli
 
 -- 
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: [PHP-DEV] [PHP] PHP 5.5.0 final has been released!

2013-06-21 Thread Daniel
I hope this will get people like WordPress to get up and support
mysqli out of the box. going to cause big issues if they don't.






On Sat, Jun 22, 2013 at 8:59 AM, Martin Amps ph...@rtin.so wrote:
 I second this - great to see both finally available. Fantastic release!

 Martin Amps | CIO
 www.iCracked.com
 iCracked | Redwood City, CA

 On Jun 21, 2013, at 2:01 PM, Julian jswprog.mailingli...@gmx.at wrote:

 Awesome work and the new design for the php.net website is also nice ;)

 Am 20.06.2013, 23:22 Uhr, schrieb Julien Pauli jpa...@php.net:

 Hello!

 The PHP Development Team would like to announce the immediate release of
 PHP 5.5.0. This release includes a large number of new features and bug
 fixes.

 A separate release announcement is also available. For changes in PHP
 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.

 Release Announcement: http://www.php.net/release_5_5_0.php
 Downloads:http://www.php.net/downloads.php#v5.5
 Changelog:http://www.php.net/ChangeLog-5.php#5.5.0

 Thanks to all contributors that made this new version available.

 regards,

 David Soria Parra  Julien Pauli

 --
 PHP Internals - PHP Runtime Development Mailing List
 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



Re: [PHP] Re: PHP5 OOP: Abstract classes, multiple inheritance and constructors

2013-06-21 Thread David Harkness
There's no way to bypass an overridden method using parent, but you could
add an abstract method that Child would implement.

class Parent
function __construct() {
$this-foo = $this-getFoo();
}

abstract function getFoo();
}

David


Re: [PHP] Re: PHP5 OOP: Abstract classes, multiple inheritance and constructors

2013-06-21 Thread Micky Hulse
Thanks for tips David! I'll play with your suggestion.

I've never used abstract methods, but if I'm understanding the code
you posted, they look pretty useful.

I may be back with questions.

Appreciate the help. :)

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