php-general Digest 2 Jun 2011 17:02:52 -0000 Issue 7340

2011-06-02 Thread php-general-digest-help

php-general Digest 2 Jun 2011 17:02:52 - Issue 7340

Topics (messages 313307 through 313312):

Re: PHP 5.3.3 operator  problem
313307 by: 李白|字一日
313310 by: Lester Caine

Re: notices nightmare - looking for a regex solution
313308 by: Hans Åhlin

Re: [PHP-WEBMASTER] encoding issue
313309 by: Richard Quadling
313311 by: Geoff Shang

Re: phpsadness
313312 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---
both php 5.1.6 and php 5.3.3 are php 5.
but it seems they are different in processing  operator.

2011/6/2 Simon J Welsh si...@welsh.co.nz

 On 2/06/2011, at 2:44 PM, 李白|字一日 wrote:

  hi, all
 
  i currently have a project which using  operator on creating a new
 object.
 
  like:
   $class = new Class();
 
  it works properly in  php 5.1.6,
  but not in php 5.3.3
  and it gives offset errors to me.
 
  is there anyone knows why and how to fix this problem?

 In PHP 5, objects are always assigned by reference, you do not need to make
 it explicit.
 ---
 Simon Welsh
 Admin of http://simon.geek.nz/


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

李白|字一日 wrote:

both php 5.1.6 and php 5.3.3 are php 5.
but it seems they are different in processing  operator.


PHP5.3 changed a lot of things that are more than simple updates so you need to 
treat 5.3 as a major upgrade. It was a sort of PHP6 rather than a .X more minor 
one, so a lot of things now flag warnings.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
---End Message---
---BeginMessage---
2011/6/2 Merlin Morgenstern merli...@fastmail.fm:
 Hi there,

 I am working on a pretty huge site with thousands of files with php code.
 Unfortunatelly the app throws a ton of notices du to missing '' in arrays.
 Of course I could simply disable the output on the dev server to surpress
 notices, but I would rather like to get it fixed.

 Has somebody a good idea on how to fix this automated somehow with regex?

 The vars are right now: $var[element] and should be $var['element']

 I was looking into sed, but I was hoping that there is also a way in php.
 Has anybody a hint on how to get the regex done?

 I appreciate any help on that.

 Best regards,

 Merlin

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



I don't have the time to write a complete script, but here is an idea
(Pseudocode):

Read dir.
Foreach File{

open file
new var $NewFile
new var $Line
  foreach Line{
read new line, look for $?[?]

   tmp var $Pos = strpos($Line, '[')+1
   tmp var $Pos2 = strpos($NewFile, ']')
   tmp var $Ctrl = true

   while($Ctrl){

if( $Line[$Pos] !='$'  $Line[$Pos] != '\'']  $Line[$Pos] !=
'']){ //or some reg match (it's probably the wisest to use so you can
find blank spaces before $ ' or ){

add the content of the line before $Pos-1 to $NewFile
add ' or  to $NewFile
add content between $Pos-1 and $Pos2 to $NewFile
add ' or  and the ']' to $NewFile

   search the rest of the line for more arrays in the same way
$Pos = strpos($Line, '[', $Pos2)
$Pos2 = strpos($Line, ']' , $Pos)
if($Pos == false || $Pos2 == false){
$Ctrl = false
}
}else{
   copy the whole line to $NewFile
}
add \r\n to $NewFile
   }
  }
 save file
}
-- 


**
 Hans Åhlin
   Tel: +46761488019
   icq: 275232967
   http://www.kronan-net.com/
   irc://irc.freenode.net:6667 - TheCoin
**
---End Message---
---BeginMessage---
On 2 June 2011 06:34, bandhu chithi bchi...@gmail.com wrote:
 Hi There,

 I have a website up  running.

 I want to change my developer, but the code of the website is entirely in
 coded format and when i took the backup and passed it on to my new
 developer, they can not read anything and all the .php files looks the same
 except the name of the files.

 So what shall i do to get my code. Being an owner of the website, i don't
 have any control, feeling so helpless.

 Any sort of help is welcome.

 Regards,

 Bandhu


[Moved to PHP General list]

By the sounds it it, the developer has used an encoder to protect his
work from being sold/reused without him being paid for it.

If you are able to supply 1 file (you'd have probably zip the file
first to preserve it's content and have to send it to me directly as
the mailing list 

php-general Digest 3 Jun 2011 05:51:02 -0000 Issue 7341

2011-06-02 Thread php-general-digest-help

php-general Digest 3 Jun 2011 05:51:02 - Issue 7341

Topics (messages 313313 through 313320):

Re: phpsadness
313313 by: Philip Thompson
313318 by: Tamara Temple
313319 by: Paul M Foster

Re: php causes HTTP 500, but results in blank page in apache
313314 by: Sean Greenslade
313317 by: Stephon Chen

Re: smart auto download file
313315 by: Sean Greenslade

INTERNATIONAL MONETARY FUND ?
313316 by: Mr Jones Smith

Re: about php comet
313320 by: 李白|字一日

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 Thu, Jun 2, 2011 at 12:02 PM, Daniel Brown danbr...@php.net wrote:

 On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:
 
  So if I understand, you want an explode() with empty parameters to
 explode
  the host machine?

That's correct.  If it causes too much userland confusion, we can
 alias it as detonate() as well.


It would be nice if there were a Like feature here...

~Philip

-- 
http://lonestarlightandsound.com/
---End Message---
---BeginMessage---


On Jun 2, 2011, at 12:26 PM, Philip Thompson wrote:

On Thu, Jun 2, 2011 at 12:02 PM, Daniel Brown danbr...@php.net  
wrote:



On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:


So if I understand, you want an explode() with empty parameters to  
explode

the host machine?


  That's correct.  If it causes too much userland confusion, we can
alias it as detonate() as well.


Reminds me of the old assembler instruction EPI - execute programmer  
immediately.



It would be nice if there were a Like feature here...


no, please, facebook is already overreaching itself.


---End Message---
---BeginMessage---
On Thu, Jun 02, 2011 at 01:02:26PM -0400, Daniel Brown wrote:

 On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:
 
  So if I understand, you want an explode() with empty parameters to explode
  the host machine?
 
 That's correct.  If it causes too much userland confusion, we can
 alias it as detonate() as well.

It would be so hilarious if this made it into the docs as a (spoof)
command. I could see some n00b skimming over the docs and going, Wait,
what--?

Oh-- how about if the detonate() command just echoed a series of tick
strings to the web page? Can't you just imagine the frantic tech support
calls from n00b PHP coders to the tech support departments of their
hosting companies? Oh crap oh crap! Pick up the phone already! Oh
crap I'm so busted!

Reminds me (obliquely) of an entry in the index for The C Programming
Language for recursion, which points right back to that index page. I
about doubled over when I first discovered it.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com
---End Message---
---BeginMessage---
So do you get the contents of that page in the response? What happens when
you browse to that page manually?
On Jun 1, 2011 2:14 AM, Stephon Chen step...@gmail.com wrote:
 All 403, 404, 500.html are static html pages like:

 div
 500 error happens
 /div

 On Wed, Jun 1, 2011 at 14:10, Tamara Temple tamouse.li...@gmail.com
wrote:


 On May 31, 2011, at 8:14 AM, Stephon Chen wrote:

 Hello Sean,

 Here is my apache config for error handling.
 403, 404 works fine, but 500 shows blank page

 Alias /errorpage/ /usr/local/www/apache22/errorpage/
 Directory /usr/local/www/apache22/errorpage/
 AllowOverride None
 Options -Indexes FollowSymLinks MultiViews
 Order allow,deny
 Allow from all
 /Directory
 #
 ErrorDocument 403 /errorpage/403.html
 ErrorDocument 404 /errorpage/404.html
 ErrorDocument 500 /errorpage/500.html


 What's in 500.html?


---End Message---
---BeginMessage---
Hello Sean,

1. while I directed connected to these error pages such as 403, 404, and
500.html,
they works correctly, showing correct error page

2. but while I use something like header('HTTP/1.1 500') to trigger apache
500
the content of 500.html does not show, but blank page only.
both header('HTTP/1.1 403') and header('HTTP/1.1 404') shows the correct
custom error page.

Thanks a lot
--
stephon

On Fri, Jun 3, 2011 at 07:21, Sean Greenslade zootboys...@gmail.com wrote:

 So do you get the contents of that page in the response? What happens when
 you browse to that page manually?
 On Jun 1, 2011 2:14 AM, Stephon Chen step...@gmail.com wrote:
  All 403, 404, 500.html are static html pages like:
 
  div
  500 error happens
  /div
 
  On Wed, Jun 1, 2011 at 14:10, Tamara Temple tamouse.li...@gmail.com
 wrote:
 
 
  On May 31, 2011, at 8:14 AM, Stephon Chen wrote:
 
  Hello Sean,
 
  Here is my apache config for error handling.
  403, 404 works fine, but 500 shows blank page
 
  Alias /errorpage/ 

[PHP] Re: [PHP-WEBMASTER] encoding issue

2011-06-02 Thread Richard Quadling
On 2 June 2011 06:34, bandhu chithi bchi...@gmail.com wrote:
 Hi There,

 I have a website up  running.

 I want to change my developer, but the code of the website is entirely in
 coded format and when i took the backup and passed it on to my new
 developer, they can not read anything and all the .php files looks the same
 except the name of the files.

 So what shall i do to get my code. Being an owner of the website, i don't
 have any control, feeling so helpless.

 Any sort of help is welcome.

 Regards,

 Bandhu


[Moved to PHP General list]

By the sounds it it, the developer has used an encoder to protect his
work from being sold/reused without him being paid for it.

If you are able to supply 1 file (you'd have probably zip the file
first to preserve it's content and have to send it to me directly as
the mailing list would just bounce it), then I could take a look and
see what I see. Various encoders leave a fingerprint behind - though
not all.

One way you can check to see if an encoder was used is to create a
file called info.php and have it contain ...

?php
phpinfo();

Just those 2 lines.

Place this in the same directory as your existing files on your web server.

Now load http://www.your-site-name-here.com/info.php

Look through the page, seeing if you see anything related to an
encoder. Some that come to mind ... Zend Guard, IONCube, NU-Coder.

If you see something like that, then that suggests a decoder (the
decoders tend to be free and would have been installed when you got
your site working), is being used.


Depending upon the contract you had with the developer, you may be
entitled to the source or not.

I'm guessing you paid for a web site. You got that. You didn't pay
for access to the source.

A bit like buying MS Office. You pay for a license to use the
software. You do not buy the source.


What can you do?

In the first instance, I'd ask the developer for the source. If you've
had a falling out, don't worry. If he is running a proper business, he
shouldn't let personal issue get in the way (too much), but don't pay
too much though. Consider the cost to you of buying the code vs paying
for a new developer to build a copy of the site.

There are other possibilities, but they could have legal repercussions
- essentially reversing the encoding may be considered as an attempt
to bypass a copyright protection system which could contravene the
http://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act.

Personally, for a business, I'd not consider that as an option. If you
use a tool to do this and then rely upon the code that is made
available, you could open yourself up for a nice little law suit.

Please note : I am not a lawyer.

Of course, there could be any other reason why you can't read the
code, but without seeing at least 1 file, it would be hard to say why.

Regards,

Richard Quadling.
-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] PHP 5.3.3 operator problem

2011-06-02 Thread Lester Caine

李白|字一日 wrote:

both php 5.1.6 and php 5.3.3 are php 5.
but it seems they are different in processing  operator.


PHP5.3 changed a lot of things that are more than simple updates so you need to 
treat 5.3 as a major upgrade. It was a sort of PHP6 rather than a .X more minor 
one, so a lot of things now flag warnings.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Re: [PHP-WEBMASTER] encoding issue

2011-06-02 Thread Geoff Shang

On Thu, 2 Jun 2011, Richard Quadling wrote:


There are other possibilities, but they could have legal repercussions
- essentially reversing the encoding may be considered as an attempt
to bypass a copyright protection system which could contravene the
http://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act.


Note that the DMCA is United States legislation and may not be relevant. 
Copyright law is pretty universal though and you could get into trouble 
with this anyway.


Geoff.


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



Re: [PHP] phpsadness

2011-06-02 Thread Daniel Brown
On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:

 So if I understand, you want an explode() with empty parameters to explode
 the host machine?

That's correct.  If it causes too much userland confusion, we can
alias it as detonate() as well.

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

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



Re: [PHP] phpsadness

2011-06-02 Thread Philip Thompson
On Thu, Jun 2, 2011 at 12:02 PM, Daniel Brown danbr...@php.net wrote:

 On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:
 
  So if I understand, you want an explode() with empty parameters to
 explode
  the host machine?

That's correct.  If it causes too much userland confusion, we can
 alias it as detonate() as well.


It would be nice if there were a Like feature here...

~Philip

-- 
http://lonestarlightandsound.com/


Re: [PHP] php causes HTTP 500, but results in blank page in apache

2011-06-02 Thread Sean Greenslade
So do you get the contents of that page in the response? What happens when
you browse to that page manually?
On Jun 1, 2011 2:14 AM, Stephon Chen step...@gmail.com wrote:
 All 403, 404, 500.html are static html pages like:

 div
 500 error happens
 /div

 On Wed, Jun 1, 2011 at 14:10, Tamara Temple tamouse.li...@gmail.com
wrote:


 On May 31, 2011, at 8:14 AM, Stephon Chen wrote:

 Hello Sean,

 Here is my apache config for error handling.
 403, 404 works fine, but 500 shows blank page

 Alias /errorpage/ /usr/local/www/apache22/errorpage/
 Directory /usr/local/www/apache22/errorpage/
 AllowOverride None
 Options -Indexes FollowSymLinks MultiViews
 Order allow,deny
 Allow from all
 /Directory
 #
 ErrorDocument 403 /errorpage/403.html
 ErrorDocument 404 /errorpage/404.html
 ErrorDocument 500 /errorpage/500.html


 What's in 500.html?




Re: [PHP] Re: smart auto download file

2011-06-02 Thread Sean Greenslade
What about an HTTP header redirect? You can set a delay on that AFAIK.
On Jun 1, 2011 10:52 AM, Jonesy gm...@jonz.net wrote:
 On Tue, 31 May 2011 21:01:09 +0100, Stuart Dallas wrote:

 Sometimes I miss the way the web was before javascript :/

 Sometimes???

 Jonesy


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



[PHP] INTERNATIONAL MONETARY FUND ?

2011-06-02 Thread Mr Jones Smith
INTERNATIONAL MONETARY FUND
23 HERBERT MARCULARY AVENUE
WUSE 2 GARKI ABUJA
FEDERAL CAPITAL TERRITORY


Attention



A power of attorney was forwarded to our office this morning by two gentle men, 
one of them is an American national and he is MR DAVID DEANE by name while the 
other person is MR... JACK MORGAN by name a CANADIAN national.



This gentlemen claimed to be your representative, and this power of attorney 
stated that you are dead, they brought an account to replace your information 
in other to claim your fund of $12.5 Million USD which is now lying DORMANT and 
UNCLAIMED, below is the new account they have submitted:


BANK.-HSBC CANADA
Vancouver, CANADA
ACCOUNT NO. 2984-0008-66


Be further informed that this power of attorney also stated that you suffered 
and died of throat cancer. You are therefore given 24hrs to confirm the truth 
in this information, if you are still alive, you are to contact us back 
immediately, because we work 24 hrs just to ensure that we monitor all the 
activities going on in regards to the transfer of beneficiaries’ inheritance 
and contract payment.


You are to call this office +234-816-981-7030 immediately for clarifications on 
this matter as we shall be available 24 hrs to speak with you and give you the 
necessary guidelines on how to ensure that your payment is wired to you 
immediately.


Just also be informed that any further delay from your side could be dangerous, 
as we would not be held responsible of wrong payment.


Kindly reply


Mr Jones Smith





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



Re: [PHP] php causes HTTP 500, but results in blank page in apache

2011-06-02 Thread Stephon Chen
Hello Sean,

1. while I directed connected to these error pages such as 403, 404, and
500.html,
they works correctly, showing correct error page

2. but while I use something like header('HTTP/1.1 500') to trigger apache
500
the content of 500.html does not show, but blank page only.
both header('HTTP/1.1 403') and header('HTTP/1.1 404') shows the correct
custom error page.

Thanks a lot
--
stephon

On Fri, Jun 3, 2011 at 07:21, Sean Greenslade zootboys...@gmail.com wrote:

 So do you get the contents of that page in the response? What happens when
 you browse to that page manually?
 On Jun 1, 2011 2:14 AM, Stephon Chen step...@gmail.com wrote:
  All 403, 404, 500.html are static html pages like:
 
  div
  500 error happens
  /div
 
  On Wed, Jun 1, 2011 at 14:10, Tamara Temple tamouse.li...@gmail.com
 wrote:
 
 
  On May 31, 2011, at 8:14 AM, Stephon Chen wrote:
 
  Hello Sean,
 
  Here is my apache config for error handling.
  403, 404 works fine, but 500 shows blank page
 
  Alias /errorpage/ /usr/local/www/apache22/errorpage/
  Directory /usr/local/www/apache22/errorpage/
  AllowOverride None
  Options -Indexes FollowSymLinks MultiViews
  Order allow,deny
  Allow from all
  /Directory
  #
  ErrorDocument 403 /errorpage/403.html
  ErrorDocument 404 /errorpage/404.html
  ErrorDocument 500 /errorpage/500.html
 
 
  What's in 500.html?
 
 



Re: [PHP] phpsadness

2011-06-02 Thread Tamara Temple


On Jun 2, 2011, at 12:26 PM, Philip Thompson wrote:

On Thu, Jun 2, 2011 at 12:02 PM, Daniel Brown danbr...@php.net  
wrote:



On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:


So if I understand, you want an explode() with empty parameters to  
explode

the host machine?


  That's correct.  If it causes too much userland confusion, we can
alias it as detonate() as well.


Reminds me of the old assembler instruction EPI - execute programmer  
immediately.



It would be nice if there were a Like feature here...


no, please, facebook is already overreaching itself.



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



Re: [PHP] phpsadness

2011-06-02 Thread Paul M Foster
On Thu, Jun 02, 2011 at 01:02:26PM -0400, Daniel Brown wrote:

 On Tue, May 31, 2011 at 22:13, Bill Guion bgu...@comcast.net wrote:
 
  So if I understand, you want an explode() with empty parameters to explode
  the host machine?
 
 That's correct.  If it causes too much userland confusion, we can
 alias it as detonate() as well.

It would be so hilarious if this made it into the docs as a (spoof)
command. I could see some n00b skimming over the docs and going, Wait,
what--?

Oh-- how about if the detonate() command just echoed a series of tick
strings to the web page? Can't you just imagine the frantic tech support
calls from n00b PHP coders to the tech support departments of their
hosting companies? Oh crap oh crap! Pick up the phone already! Oh
crap I'm so busted!

Reminds me (obliquely) of an entry in the index for The C Programming
Language for recursion, which points right back to that index page. I
about doubled over when I first discovered it.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

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



[PHP] Re: about php comet

2011-06-02 Thread 李白|字一日
any idea?

2011/5/25 李白|字一日 calid...@gmail.com

 hello,

 I am every interested in comet applications recently, and sadly found php
 is very weak in this area.

 i am just wondering if it is possible to write an extension to extend the
 ability of the php to easy the way to comet applications?

 if it possible for php to hold the connect from the client when it is in
 fast cgi mode or apache mod php mode?

 thanks.