[PHP] security question of ZCE exam

2009-08-24 Thread Augusto Flavio
Hi all, i'm discutting with my friend about this question for 30 min and i do not agree with he. Here is the question: Why is it important from a security perspective to never display PHP error messages directly to the end user, yet always log them? Answers: (choose 2) Error messages wil

Re: [PHP] preg_replace anything that isn't WORD

2009-08-24 Thread Jonathan Tapicer
For the record Shawn: I received your previous post from Aug 22 and I think that it is the best solution. Jonathan On Tue, Aug 25, 2009 at 12:41 AM, Shawn McKenzie wrote: > hack988 hack988 wrote: >>  Use preg_replace_callback instead! >> preg_replace_callback is better performance than preg_repla

Re: [PHP] preg_replace anything that isn't WORD

2009-08-24 Thread Shawn McKenzie
hack988 hack988 wrote: > Use preg_replace_callback instead! > preg_replace_callback is better performance than preg_replace with /e. > - > code > > $str="cats i saw a cat and a dog"; > $str1=preg_replace_callback("/(

[PHP] Re: unset() something that doesn't exist

2009-08-24 Thread Shawn McKenzie
Ralph Deffke wrote: > causes an error > Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in > C:\wamp\www\TinyCreator\testCrapp6.php on line 42 > > "Tom Worster" wrote in message > news:c6b87877.11463%...@thefsb.org... >> is it the case that unset() does not trigger an erro

Re: [PHP] PHP Shopping Cart Recommendation

2009-08-24 Thread sono-io
The only e-commerce site I've worked on was based on OSCommerce. It's pretty good, easy to integrate new functionality into, and not too much trouble to style up to look the way you want with CSS. Thanks, Ash. I downloaded CRE Loaded, which is an off-shoot of osCommerce, and the latest

Re: [PHP] Is there limitation for switch case: argument's value?

2009-08-24 Thread Keith
Oh I see. I missed out one thing too. There is no need to put the same code under both case 7 & 6 separately, but just under case 6 will do. This is simpler in fact! Thanks Tedd and Torben! I'll fix to this style from now onwards. "tedd" wrote in message news:p06240800c6b84328c...@[192.168.1

Re: [PHP] __destruct() not called ! we shot us in the foot try the script

2009-08-24 Thread Jim Lucas
Ralph Deffke wrote: Sorry to bring it to this thread, but could you respond to Ashley in the "[PHP] wierd behavior on parsing css with no php included" thread. We would like the solution place in the archives to future visitor benefit. Thanks Jim -- PHP General Mailing List (http://www.php.

[PHP] Re: unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
I did start a new topic have a look there; ""Ralph Deffke"" wrote in message news:79.73.03363.43752...@pb1.pair.com... > but it should? shouldn't it how can I destroy a class instance invocing > __detruct() of the class ?!?!? > > > > > -- PHP General Mailing List (http://www.php.net/) To unsu

[PHP] __destruct() not called ! we shot us in the foot try the script

2009-08-24 Thread Ralph Deffke
well I would call this an error in the first view , and some of u where right! and the stuff with the refernce counter seems to be right as well. however I can't see a reason for it as 5.x works through refernces. so unsetting a REFERENCE to the object does not destroy it. How to destroy the obj

[PHP] Re: unset() something that doesn't exist

2009-08-24 Thread Ralph Deffke
causes an error Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in C:\wamp\www\TinyCreator\testCrapp6.php on line 42 "Tom Worster" wrote in message news:c6b87877.11463%...@thefsb.org... > is it the case that unset() does not trigger an error or throw an exception > if it's

[PHP] DOMNode children iteration (was Re: array() returns something weird)

2009-08-24 Thread Szczepan Hołyszewski
Hi Lars and list! New facts about the strange bug initially diagnosed as array() returning NULL: Firstly, the issue is not really about array() returning null, but about full blown UndefinedBehavior(TM) progressively trashing local variables. It just so happened that I noticed it first with a

Re: [PHP] php move_uploaded_file() filesize problem

2009-08-24 Thread Ralph Deffke
I would also be shure that u run into the srcipt time out time. of course there is one limit u can be a little bit under or a little bit above. measure the time with microtime() and compare it with the script time out settings and u will have the answer ralph_def...@yahoo.de ""Thomas Gabrielsen"

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Lupus Michaelis
Ashley Sheridan wrote: That would seem sensible to me though really. A constructor only bears true for the base class, so any classes which inherit it must incorporate all the constructor parts. A destructor doesn't know about further classes which will need to inherit it, so it shouldn't be inh

Re: [PHP] php move_uploaded_file() filesize problem

2009-08-24 Thread Thomas Gabrielsen
"Ryan Cavicchioni" wrote in message news:20090824205810.gc32...@mail.confabulator.net... On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote: Hi I have a problem with uploading files that are bigger than the Master Value allow me to, which is 32 MB. I've set the max_upload_file

Re: [PHP] PHP pages won't open correctly on my server.

2009-08-24 Thread RRT
That link won't load for me. Did you get it to load OK for you? "Ryan Cavicchioni" wrote in message news:20090824192749.ga13...@mail.confabulator.net... > On Mon, Aug 24, 2009 at 01:30:00PM -0500, RRT wrote: >> PHP pages won't open at all on my server. HTML pages open fine, but when >> going

Re: [PHP] php move_uploaded_file() filesize problem

2009-08-24 Thread Ryan Cavicchioni
On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote: > Hi > > I have a problem with uploading files that are bigger than the Master > Value allow me to, which is 32 MB. I've set the max_upload_filesize and > max_post_size in a .htaccess file and the phpinfo() reports the new local

Re: [PHP] php move_uploaded_file() filesize problem

2009-08-24 Thread Ryan Cavicchioni
On Mon, Aug 24, 2009 at 09:54:03PM +0200, Thomas Gabrielsen wrote: > Hi > > I have a problem with uploading files that are bigger than the Master > Value allow me to, which is 32 MB. I've set the max_upload_filesize and > max_post_size in a .htaccess file and the phpinfo() reports the new local

[PHP] unset() something that doesn't exist

2009-08-24 Thread Tom Worster
is it the case that unset() does not trigger an error or throw an exception if it's argument was never set? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread hack988 hack988
i test your codes again,it is work correctly! But for backends compatibly with older php versions my codes is better :),i'm sorry for my mistake at moment. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] preg_replace anything that isn't WORD

2009-08-24 Thread hack988 hack988
Use preg_replace_callback instead! preg_replace_callback is better performance than preg_replace with /e. - code $str="cats i saw a cat and a dog"; $str1=preg_replace_callback("/(dog|cat|.)/is","call_replace",$str);

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Lars Torben Wilson
2009/8/24 Paul M Foster : > On Mon, Aug 24, 2009 at 10:37:11AM -0700, Chris Carter wrote: > >> >> Is there any alternative method to do this !!! Sending email through PHP? >> > > Sure. You can use a class like PHPMailer rather than the built-in mail() > function. But it's not going to matter if the

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Paul M Foster
On Mon, Aug 24, 2009 at 10:37:11AM -0700, Chris Carter wrote: > > Is there any alternative method to do this !!! Sending email through PHP? > Sure. You can use a class like PHPMailer rather than the built-in mail() function. But it's not going to matter if the problem is at the mail server, etc

[PHP] php move_uploaded_file() filesize problem

2009-08-24 Thread Thomas Gabrielsen
Hi I have a problem with uploading files that are bigger than the Master Value allow me to, which is 32 MB. I've set the max_upload_filesize and max_post_size in a .htaccess file and the phpinfo() reports the new local value (128 MB) according to the .htaccess, but the script fails silently w

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
Stuart, u are right, the refcount in php 5 doesn't matter, where something left behind in my memory from earlier days, However i do have the effect that unsetting an object does NOT call __dectruct() ! but when the script ends it is called. this can be easily tested by putting a echo in destruct.

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
I dont agree, and as u see in my snipped code it works fine. in an abstract class u can define an implementation to define some basic things a overwriting function in an extending class has to take care of as well. this includes specialy magic functions. thats what they are made for. may be you

Re: [PHP] PHP pages won't open correctly on my server.

2009-08-24 Thread Ryan Cavicchioni
On Mon, Aug 24, 2009 at 01:30:00PM -0500, RRT wrote: > PHP pages won't open at all on my server. HTML pages open fine, but when > going to the PHP pages that are on my server, the browser tries to download > the page like a file instead of presenting it by the browser. What can I do > to make

[PHP] PHP pages won't open correctly on my server.

2009-08-24 Thread RRT
PHP pages won't open at all on my server. HTML pages open fine, but when going to the PHP pages that are on my server, the browser tries to download the page like a file instead of presenting it by the browser. What can I do to make the PHP processor to be handled properly? Do I need to recom

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread hack988 hack988
see http://cn.php.net/manual/en/language.oop5.abstract.php PHP 5 introduces abstract classes and methods. It is not allowed to create an instance of a class that has been defined as abstract. Any class that contains at least one abstract method must also be abstract. Methods defined as abstract sim

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Chris Carter
Is there any alternative method to do this !!! Sending email through PHP? Paul M Foster wrote: > > On Mon, Aug 24, 2009 at 09:12:19AM -0700, Chris Carter wrote: > >> >> Hi, >> >> The code below actually takes input from a web form and sends the fields >> captured in an email. It used to wor

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Ashley Sheridan
On Mon, 2009-08-24 at 12:26 -0400, Paul M Foster wrote: > On Mon, Aug 24, 2009 at 09:12:19AM -0700, Chris Carter wrote: > > > > > Hi, > > > > The code below actually takes input from a web form and sends the fields > > captured in an email. It used to work quite well since past few years. It > >

Re: [PHP] inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

2009-08-24 Thread Paul M Foster
On Mon, Aug 24, 2009 at 05:56:46PM +0200, Grega Leskov??ek wrote: > Hi, I am still a newbie in php. Is there a shorter way to include a php > value in a form? > > is it possible to do smth like this like in > JSP? > Can I omit the last whitespace before the closing ?> ? Yes, you can include a P

RE: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Warren Vail
You are absolutely right, more information is needed. Many ISP's are changing port number assignments on their SMTP outgoing email to prevent abuse. A simple change like that could cause the email to not go out, and it has nothing to do with PHP. Warren Vail Vail Systems Technology -Origina

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Paul M Foster
On Mon, Aug 24, 2009 at 09:12:19AM -0700, Chris Carter wrote: > > Hi, > > The code below actually takes input from a web form and sends the fields > captured in an email. It used to work quite well since past few years. It > has stopped now. I used Google's mail servers (google.com/a/website.com

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Lars Torben Wilson
2009/8/24 Chris Carter : > > Hi, > > The code below actually takes input from a web form and sends the fields > captured in an email. It used to work quite well since past few years. It > has stopped now. I used Google's mail servers (google.com/a/website.com) > >  $fName = $_REQUEST['fName'] ; >

Re: [PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Ashley Sheridan
On Mon, 2009-08-24 at 09:12 -0700, Chris Carter wrote: > Hi, > > The code below actually takes input from a web form and sends the fields > captured in an email. It used to work quite well since past few years. It > has stopped now. I used Google's mail servers (google.com/a/website.com) > >$

[PHP] What if this code is right ? It worked perfectly for years!!

2009-08-24 Thread Chris Carter
Hi, The code below actually takes input from a web form and sends the fields captured in an email. It used to work quite well since past few years. It has stopped now. I used Google's mail servers (google.com/a/website.com) http://www.thankyou.com/thankYouContact.php"; ); ?> This is the simples

Re: [PHP] inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

2009-08-24 Thread Ashley Sheridan
On Mon, 2009-08-24 at 17:56 +0200, Grega Leskovšek wrote: > Hi, I am still a newbie in php. Is there a shorter way to include a php > value in a form? > > is it possible to do smth like this like in > JSP? > Can I omit the last whitespace before the closing ?> ? > > *** > I tried to download the

[PHP] inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

2009-08-24 Thread Grega Leskovšek
Hi, I am still a newbie in php. Is there a shorter way to include a php value in a form? is it possible to do smth like this like in JSP? Can I omit the last whitespace before the closing ?> ? *** I tried to download the file from another server the fancy way in PHP, but it just display blank sc

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Stuart
2009/8/24 Ralph Deffke : > this is also not the full truth try this and it works > what are the circumstances that is causing this problem then, yes I do have > distributed references over my script and there are clearly references still > set, however after running the snipped script I can not see

[PHP] Multiple EXEC() hang Apache

2009-08-24 Thread Andrioli Darvin
Hi all I'm upgrading PHP version from PHP 4 to 5.3.0 and Apache to 2.2.13, but I'm facing a weird problem on the following statement: $StringaParametri=exec('java -cp ..\\java rsa6230 ' . $Token); It works on PHP 4 and PHP 5 CGI, but it hang Apache using MOD_PHP5. The problem occurs when 2 or mo

RE: [PHP] SESSIONS lost sometimes

2009-08-24 Thread Angelo Zanetti
-Original Message- From: Nitebirdz [mailto:nitebi...@sacredchaos.com] Sent: 20 August 2009 02:58 PM To: php-general@lists.php.net Subject: Re: [PHP] SESSIONS lost sometimes On Thu, Aug 20, 2009 at 02:34:54PM +0200, Angelo Zanetti wrote: > Hi Leon, > > No harm intended :) Just thought

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
this is also not the full truth try this and it works what are the circumstances that is causing this problem then, yes I do have distributed references over my script and there are clearly references still set, however after running the snipped script I can not see what I do special in my script c

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Luke
2009/8/24 Ralph Deffke > typing error sorry > > forget my last post > > is there a was to destroy an object if there is hold a reference somewhere? > > "Stuart" wrote in message > news:a5f019de0908240606x5fdca70bkb31dd32b072e5...@mail.gmail.com... > > 2009/8/24 kranthi : > > > unset($obj) always

Re: [PHP] preg_replace anything that isn't WORD

2009-08-24 Thread tedd
On Sat, Aug 22, 2009 at 12:32 PM, “•ÈýÏݓ•ÂÔ wrote: Lets assume I have the string "cats i saw a cat and a dog" i want to strip everything except "cat" and "dog" so the result will be "catcatdog", using preg_replace. I've tried something like /[^(dog|cat)]+/ but no success > What should

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
typing error sorry forget my last post is there a was to destroy an object if there is hold a reference somewhere? "Stuart" wrote in message news:a5f019de0908240606x5fdca70bkb31dd32b072e5...@mail.gmail.com... > 2009/8/24 kranthi : > > unset($obj) always calls the __destruct() function of the cl

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ashley Sheridan
On Mon, 2009-08-24 at 15:13 +0200, Ralph Deffke wrote: > that is correct and that is the problem, and even that is not all !!! > > try this > > > abstract class a { > public function __construct(){ > echo "constructing"; > } > public function __detruct(){ > echo "destructing..

Re: [PHP] Is there limitation for switch case: argument's value?

2009-08-24 Thread tedd
At 9:44 PM -0700 8/22/09, Lars Torben Wilson wrote: Hi Keith, Glad it works! I'm not sure how inverting the case statement helps you minimize the code in each case. As both I and Adam showed, you can do the same thing more efficiently (and IMHO much more readably) like this: switch ($sum) {

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
that is correct and that is the problem, and even that is not all !!! try this "; } public function __detruct(){ echo "destructing"; } } class b extends a{ } $c = new b(); unset( $c ); ?> the constructor is inherited, the destructor not !! PHP 5.2.9-1 and PHP 5.3.0 behave the sam

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Lupus Michaelis
kranthi wrote: unset($obj) always calls the __destruct() function of the class. Never calls the dtor. The dtor will be called only when the reference count reaches 0. class c { function __destruct() { echo 'dying !' ; } } $v1 = new c ; $v2 = $v1 ; unset($v1) ; // don't call the dtor unset

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Stuart
2009/8/24 kranthi : > unset($obj) always calls the __destruct() function of the class. > > in your case clearly you are missing something else. Probably > unset($anobject) is not being called at all ? That's not entirely correct. PHP uses reference counting, so if unsetting a variable did not caus

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread kranthi
unset($obj) always calls the __destruct() function of the class. in your case clearly you are missing something else. Probably unset($anobject) is not being called at all ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] wierd behavior on parsing css with no php included

2009-08-24 Thread Ashley Sheridan
On Mon, 2009-08-24 at 10:58 +0200, Ralph Deffke wrote: > perfect, thats what I was looking for, great thanks > > ralph > > "Jim Lucas" wrote in message > news:4a923946.3020...@cmsws.com... > > Ralph Deffke wrote: > > > Hi folks, i did post this also on the Wamp page but maybe someone out > there

Re: [PHP] wierd behavior on parsing css with no php included

2009-08-24 Thread Ralph Deffke
perfect, thats what I was looking for, great thanks ralph "Jim Lucas" wrote in message news:4a923946.3020...@cmsws.com... > Ralph Deffke wrote: > > Hi folks, i did post this also on the Wamp page but maybe someone out there > > had to solve that problem as well. > > > > systems involved > > > >

[PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Ralph Deffke
but it should? shouldn't it how can I destroy a class instance invocing __detruct() of the class ?!?!? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php