php-general Digest 28 May 2008 06:16:12 -0000 Issue 5483

2008-05-28 Thread php-general-digest-help
php-general Digest 28 May 2008 06:16:12 - Issue 5483 Topics (messages 274749 through 274757): Re: Header Redirect 274749 by: Robert Cummings 274750 by: Stut 274752 by: Stut looking a regular expresion 274751 by: Manuel Pérez López Re: scanned in manipulate

php-general Digest 28 May 2008 18:27:21 -0000 Issue 5484

2008-05-28 Thread php-general-digest-help
php-general Digest 28 May 2008 18:27:21 - Issue 5484 Topics (messages 274758 through 274779): Re: Restricting access to a file 274758 by: Adam Richardson 274765 by: Bastien Koert Re: PEAR_Exception PEAR_Error 274759 by: Chris 274761 by: Richard Heyes

[PHP] Restricting access to a file

2008-05-28 Thread John Comerford
Hi Folks, This may not be strictly a PHP question but there may be something in PHP to do what I want. I am in the process of putting together a pretty basic website using MySql and PHP on a third party host. One of the function is to allow known stockist download a catalogue (.pdf). I am

Re: [PHP] Restricting access to a file

2008-05-28 Thread Adam Richardson
I usually set up what amounts to a quick controller page. The page accepts a GET variable that identifies the download, and it also delegates to a helper object that determines the access level. If the delegate determines that the person should be able to download/ view the content, the

Re: [PHP] PEAR_Exception PEAR_Error

2008-05-28 Thread Chris
Al wrote: I'm using the pear class Mail_RFC822::parseAddressList() which apparently only throws an error_object for PEAR_Error. The manual says that PEAR_Error is deprecated, so I'd like to use PEAR_Exception; but; am having trouble getting it to recognize the error. Probably better to ask

Re: [PHP] looking a regular expresion

2008-05-28 Thread Robin Vickery
2008/5/27 Manuel Pérez López [EMAIL PROTECTED]: Hello: I need to include a pair of negations with two complete word into a regular expresion for preg_replace. How to do this? I want to replace I want to be a SUN and a SIR with FRIKI FRIKI FRIKI FRIKI FRIKI SUN FRIKI FRIKI SIR ie. the words

[PHP] strcmp($var1, $var2) versus if ($var1 $var2)

2008-05-28 Thread C.R.Vegelin
Hi All, I must be overlooking something here ... $var1 = 01011090; $var2 = 010190; // 2 strings if ($var1 $var2) ECHO var1 var2; else ECHO var1 = var2; echo br /; $r = strcmp ( $var1 , $var2 ); if ($r 0) ECHO var1 var2, br /; 2nd line says: $var1 = $var2 4th line says: $var1 $var2 TIA,

Re: [PHP] strcmp($var1, $var2) versus if ($var1 $var2)

2008-05-28 Thread David Otton
2008/5/28 C.R.Vegelin [EMAIL PROTECTED]: $var1 = 01011090; $var2 = 010190; // 2 strings if ($var1 $var2) ECHO var1 var2; else ECHO var1 = var2; echo br /; $r = strcmp ( $var1 , $var2 ); if ($r 0) ECHO var1 var2, br /; 2nd line says: $var1 = $var2 4th line says: $var1 $var2 Implicit

Re: [PHP] PEAR_Exception PEAR_Error

2008-05-28 Thread Richard Heyes
I'm using the pear class Mail_RFC822::parseAddressList() which apparently only throws an error_object for PEAR_Error. You might want to consider the filter_var() function if you can - it will be much faster. The manual says that PEAR_Error is deprecated, so I'd like to use PEAR_Exception;

Re: [PHP] strcmp($var1, $var2) versus if ($var1 $var2)

2008-05-28 Thread C.R.Vegelin
- Original Message - From: David Otton [EMAIL PROTECTED] To: C.R.Vegelin [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] php-general@lists.php.net Sent: Wednesday, May 28, 2008 12:11 PM Subject: Re: [PHP] strcmp($var1, $var2) versus if ($var1 $var2) 2008/5/28 C.R.Vegelin [EMAIL PROTECTED]:

[PHP] Re: A Little Something.

2008-05-28 Thread Philip Thompson
On May 24, 2008, at 5:06 PM, Michelle Konzack wrote: Thanks, Greetings and nice Day Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/

Re: [PHP] Restricting access to a file

2008-05-28 Thread Bastien Koert
On Wed, May 28, 2008 at 2:23 AM, Adam Richardson [EMAIL PROTECTED] wrote: I usually set up what amounts to a quick controller page. The page accepts a GET variable that identifies the download, and it also delegates to a helper object that determines the access level. If the delegate

Re: [PHP] Re: A Little Something.

2008-05-28 Thread Thiago Melo de Paula
What a endless boring off topic thread... I'm wondering if some day this one will finish and we will talk about serious and relevant stuffs. Some of you will tell me to simply don't read the thread... but what is making me seek is the fact of this message always appear on top my email list! Ok,

Re: [PHP] Header Redirect

2008-05-28 Thread Robert Cummings
On Tue, 2008-05-27 at 20:50 +0100, Stut wrote: On 27 May 2008, at 19:18, Robert Cummings wrote: On Tue, 2008-05-27 at 18:04 +0100, Stut wrote: On 27 May 2008, at 17:54, Robert Cummings wrote: On Tue, 2008-05-27 at 17:10 +0100, Stut wrote: On 27 May 2008, at 17:06, Yui Hiroaki wrote: I

[PHP] OT Smarty problem

2008-05-28 Thread George Pitcher
Hi, Apologies for posting this here but coudn't find a decent Smarty list. I've been using Smarty for 4 years without much problem. I'm adding some extra functionality to a page used by 2 members of staff. My snippets of relevant code are: $smarty-assign('clearance',

[PHP] use of static methods after namespaces arrive

2008-05-28 Thread Iv Ray
In which situation would somebody use a static method, instead of a function in a namespace, after the namespaces arrive with 5.3? Iv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] OT Smarty problem

2008-05-28 Thread Gabriel Sosa
try doing this.. {if $clearance eq 0} instead use == i saw that some version of smarty has a bug related to this issue BTW .. you could use the options helper [1] saludos gabriel [1] http://www.smarty.net/manual/en/language.function.html.options.php On Wed, May 28, 2008 at 11:46 AM,

Re: [PHP] use of static methods after namespaces arrive

2008-05-28 Thread Adam Richardson
If the functionality doesn't conceptually promote the inclusion of the variables it works on (i.e., no class variables), doesn't conceptually fit a scheme where instances can exist, and likely won't benefit from refactoring into component methods, then I could see using a namespaced function. Most

Re: [PHP] OT Smarty problem

2008-05-28 Thread Iv Ray
Hi George, I tried your code and it works. If you have some way of remote assistance I can have a look on-site, if you like. But it could be that you just need a good sleep, and then look again ;) Iv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] OT Smarty problem

2008-05-28 Thread Iv Ray
Gabriel Sosa wrote: try doing this.. {if $clearance eq 0} instead use == i saw that some version of smarty has a bug related to this issue BTW .. you could use the options helper [1] saludos gabriel Right... I forgot to ask which Smarty version you have. I tried it with the last.

Re: [PHP] use of static methods after namespaces arrive

2008-05-28 Thread Iv Ray
Adam Richardson wrote: If the functionality doesn't conceptually promote the inclusion of the variables it works on (i.e., no class variables), doesn't conceptually fit a scheme where instances can exist, and likely won't benefit from refactoring into component methods, then I could see using

RE: [PHP] looking a regular expresion

2008-05-28 Thread Boyd, Todd M.
-Original Message- From: Manuel Pérez López [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2008 2:06 PM To: php-general@lists.php.net Subject: [PHP] looking a regular expresion Hello: I need to include a pair of negations with two complete word into a regular expresion for

RE: [PHP] OT Smarty problem

2008-05-28 Thread George Pitcher
Iv, Thanks, but its Firefox to blame. Apparently it holds previously stored values in form fields. These are released when the user holds shift while reloading. Cheers George | -Original Message- | From: Iv Ray [mailto:[EMAIL PROTECTED] | Sent: 28 May 2008 4:55 pm | To: George Pitcher

Re: [PHP] PEAR_Exception PEAR_Error

2008-05-28 Thread Al
filter_var() is an excellent suggestion and works great. Richard Heyes wrote: I'm using the pear class Mail_RFC822::parseAddressList() which apparently only throws an error_object for PEAR_Error. You might want to consider the filter_var() function if you can - it will be much faster. The

[PHP] Calendar Date Help

2008-05-28 Thread Mark Weaver
Hi all, I've put this off as long as possible, however I think I've reached an impasse. I've got an application that I've been writing. One of the modules for this app is an event calendar. I've got the calendar to the place where it displays the current month as well as previous and future

Re: [PHP] Calendar Date Help

2008-05-28 Thread Robert Cummings
On Wed, 2008-05-28 at 14:27 -0400, Mark Weaver wrote: Hi all, I've put this off as long as possible, however I think I've reached an impasse. I've got an application that I've been writing. One of the modules for this app is an event calendar. I've got the calendar to the place where

RE: [PHP] looking a regular expresion

2008-05-28 Thread Boyd, Todd M.
-Original Message- From: Manuel Pérez López [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2008 2:06 PM To: php-general@lists.php.net Subject: [PHP] looking a regular expresion Hello: I need to include a pair of negations with two complete word into a regular

Re: [PHP] Calendar Date Help

2008-05-28 Thread Mark Weaver
Robert Cummings wrote: function getStamp($dateStr,$dayVal=1){ return date('U',mktime(0,0,0, $dateStr,$dayVal,date('Y'))); } ^ ^

Re: [PHP] In case this helps... (Calendar Date Help)

2008-05-28 Thread Mark Weaver
Mark Weaver wrote: Hi all, I've put this off as long as possible, however I think I've reached an impasse. I've got an application that I've been writing. One of the modules for this app is an event calendar. I've got the calendar to the place where it displays the current month as well as

Re: [PHP] In case this helps... (Calendar Date Help)

2008-05-28 Thread Robert Cummings
Out of curiosity.. have you thought about reworking your premise? Using prev, current, and next is extremely sloppy IMHO. Additionally, it prevents bookmarking a specific calendar date. Why don't you have a date parameter that indicates the year and month? If no such field exists then you fallback

Re: [PHP] In case this helps... (Calendar Date Help)

2008-05-28 Thread Robert Cummings
On Wed, 2008-05-28 at 16:47 -0400, Robert Cummings wrote: Out of curiosity.. have you thought about reworking your premise? Using prev, current, and next is extremely sloppy IMHO. Additionally, it prevents bookmarking a specific calendar date. Why don't you have a date parameter that

Re: [PHP] In case this helps... (Calendar Date Help)

2008-05-28 Thread Mark Weaver
Robert Cummings wrote: Out of curiosity.. have you thought about reworking your premise? Using prev, current, and next is extremely sloppy IMHO. Additionally, it prevents bookmarking a specific calendar date. Why don't you have a date parameter that indicates the year and month? If no such field

Re: [PHP] In case this helps... (Calendar Date Help)

2008-05-28 Thread Mark Weaver
Robert Cummings wrote: On Wed, 2008-05-28 at 16:47 -0400, Robert Cummings wrote: Out of curiosity.. have you thought about reworking your premise? Using prev, current, and next is extremely sloppy IMHO. Additionally, it prevents bookmarking a specific calendar date. Why don't you have a date

[PHP] Reloading changes JS files?

2008-05-28 Thread Skip Evans
Hey all, I have an HTML template file I read into a PHP script and then after supplying dynamic data I send the template to the browser with echo $html; The HTML template contains many JS files in the head.../head section referenced like this: script src=ajax/players.js

[PHP] Query refuses to recurse all rows

2008-05-28 Thread celtic
Hi, In the following code, only the first row from query1 displays along with the display stuff from query3. The problem: query1 refuses to recurse to the next and following rows. It appears that the sub-queries in the main query cause the $row++; not to work. Is there some conditional

Re: [PHP] Reloading changes JS files?

2008-05-28 Thread Skip Evans
Hey all, I don't know if it's practical to change the name of the file when they are updated, but another thing I found along similar lines reading up on this was something like this was: ajax/players.js?version=21 Would that also do it? Not sure what the server is sending for EXPIRES,

Re: [PHP] Query refuses to recurse all rows

2008-05-28 Thread Chris
$numrows1 = pg_numrows($result1); $row = 0; do { $myrow = pg_fetch_array($result1, $row); snip $numrows2 = pg_numrows($result2);

Re: [PHP] Reloading changes JS files?

2008-05-28 Thread Wolf
Skip Evans wrote: Hey all, I don't know if it's practical to change the name of the file when they are updated, but another thing I found along similar lines reading up on this was something like this was: ajax/players.js?version=21 Would that also do it? Not sure what the server is

Re: [PHP] Query refuses to recurse all rows

2008-05-28 Thread Wolf
Chris wrote: $numrows1 = pg_numrows($result1); $row = 0; do { $myrow = pg_fetch_array($result1, $row); snip $numrows2 = pg_numrows($result2);

Re: [PHP] Query refuses to recurse all rows {RESOLVED]

2008-05-28 Thread celtic
Thanks Wolf and Chris, That did the trick -- now I just have to clean up the order a bit. Amazing how another's view can see the problem so clearly -- I was way too close, what with otehr coding - should've seen it! Regards, Andre (celtic) On Wednesday 28 May 2008, Wolf wrote: Chris wrote:

Re: [PHP] Reloading changes JS files?

2008-05-28 Thread Jim Lucas
Skip Evans wrote: Hey all, I have an HTML template file I read into a PHP script and then after supplying dynamic data I send the template to the browser with echo $html; The HTML template contains many JS files in the head.../head section referenced like this: script src=ajax/players.js

Re: [PHP] Query refuses to recurse all rows

2008-05-28 Thread Jim Lucas
[EMAIL PROTECTED] wrote: Hi, In the following code, only the first row from query1 displays along with the display stuff from query3. The problem: query1 refuses to recurse to the next and following rows. It appears that the sub-queries in the main query cause the $row++; not to work.

Re: [PHP] Query refuses to recurse all rows

2008-05-28 Thread celtic
Hi Jim, Actually, after I got the code working, I eliminated the 'exit' and skipped the empty query instead to the next block. Ahh! That cryptic header relocate: If the db conn or code is buggy fails, it redirects to a nice page telling the user that the db 'Is down for maintenance' or