Re: [PHP] How to make sure a redirect works

2004-03-10 Thread trlists
On 10 Mar 2004 Henry Grech-Cini wrote: > My question is are there problems with: > > header("Location: ".$url[$index]); > ?> As long as no other headers have been sent that should work fine. Location: is the standard method for redirection -- I'm not aware of any circumstances in which it wo

Re: [PHP] Return value efficiency question

2004-03-10 Thread trlists
On 10 Mar 2004 Robert Cummings wrote: > Overhead is minimal since PHP doesn't actually copy the contents of the > container until an attempt to modify it is made. At which time the > contents are only actually copied if the internal reference count is > greater than 0. Generally this means it won'

Re: [PHP] strip down Warnings

2004-03-10 Thread trlists
On 10 Mar 2004 dmesg wrote: > How can i tell fsockopen() to skip to echo this warnings? Here's a repeat of something I just posted the other day on this ... Here's an approach I have used to avoid any error messages at all -- presumably you could also set a flag in the error handler to indicate

Re: [PHP] Control Structure Syntax Question

2004-03-09 Thread trlists
On 9 Mar 2004 Richard Davey wrote: > $x ? xxx : xxx > > But it makes your code less readable IMHO and offers no tangible > benefit whatsoever. Ah, to each his/her own I guess ... I actually find: $value = ($condition ? $val1 : $val2); easier to read than: if ($condition)

[PHP] Re: using mail() for multiple email address...

2004-03-08 Thread trlists
On 8 Mar 2004 Adam Reiswig wrote: > Normally, the two emails would end up in the same pop account but don't > seem to be when I use the above script. If I send to one or the other > they receive appropriately, but if I send to both at the same time, I > only receive one email, not both. If anyon

Re: [PHP] new session in new window

2004-03-08 Thread trlists
On 8 Mar 2004 Tim Traver wrote: > I sent a new session ID with the link to the new window like this : > > > > but all it does is change the current session id to the new one, so if I go > back to the main window, it carries the new session into it. I think this is trickier than it sounds. Ca

[PHP] Re: fsockopen() errors.

2004-03-08 Thread trlists
On 8 Mar 2004 Phil Ewington - 43 Plc wrote: > Can anyone tell me the best way to avoid errors using fsockopen(). I have > tried wrapping the function call in a conditional statement, and have also > tried calling the function and then testing the return. Here's an approach I have used to avoid an

RE: [PHP] Using unset with $_SESSION

2004-01-28 Thread trlists
> > Shouldn't unset($_SESSION) work? > > No. The following Caution appears in the manual (at > http://www.php.net/manual/en/ref.session.php#session.examples): > > Caution Do NOT unset the whole $_SESSION with unset($_SESSION) as > this will disable the registering of session variables through t

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread trlists
On 27 Jan 2004 Stuart wrote: > In that case, try this... > > foreach (array_keys($_SESSION) as $key) > unset($_SESSION[$key]); Yes, I had tried that but forgot to mention it. It does work. However, I'm still mystified as to why unset($_SESSION) not only doesn't remove old data from the s

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread trlists
On 27 Jan 2004 Stuart wrote: > > I am trying to find a reliable method to clean out all session > > variables and start clean. > > http://php.net/session_destroy That destroys the file but (at least the docs say) does not clean out the global variables, and does not seem to work in my example.

[PHP] Using unset with $_SESSION

2004-01-27 Thread trlists
I am trying to find a reliable method to clean out all session variables and start clean. Running PHP 4.3.1 on Win2K developing a web app to run on Linux. Session cookies are enabled, register globals is off. I access all session variables with $_SESSION. What I have found is that if I use u

Re: [PHP] Creating Session Variables

2003-04-03 Thread trlists
On 3 Apr 2003 CPT John W. Holmes wrote: > No, $varname isn't created. You don't need it. You have a variable called > $_SESSION['varname'], just use that where ever you need it (even within > functions). If register_globals is on, you should be using the > session_register() method, anyhow, not th

[PHP] Deleting Objects

2003-04-02 Thread trlists
How does one delete an object? For example: $object = new Class(...); . $object = new Class(...); I want to throw away the old object and create a new, freshly initialized one using the same variable. Is the above adequate or will this orphan the first object? If

Re: [PHP] Removing Risky Characters

2003-03-23 Thread trlists
On 22 Mar 2003 David Otton wrote: > The thing that is most likely to trip you up is people who cut'n'paste > from Word. High-ASCII characters can slip in like that, also some > characters that are common in European languages (accents and umlauts). > All of these need to be translated into HTML en

Re: [PHP] Password Authentication

2003-03-23 Thread trlists
On 23 Mar 2003 Justin French wrote: > That's in the user notes... ignor it... md5() does not have to be salted... > infact, you WANT the md5() to be static... because you will compare the > md5()'d password in the database with the md5()'d password that they submit > on a form. Exactly. On this

Re: [PHP] Password Authentication

2003-03-22 Thread trlists
On 23 Mar 2003 Justin French wrote: > I just md5() the passwords, and reset them if needed... rather than > retrieving. The advantage for me on this is that it's portable... md5() is > part of the base PHP install, whereas the mcrypt stuff isn't (or wasn't). Something like that was my inclinatio

[PHP] Password Authentication

2003-03-22 Thread trlists
I am trying to build password authentication into a database front end for a MySQL DB. I find the php docs on this point quite confusing so I have a lot of questions. I can use a one-way hash to do this if that's the best way, as I don't need to retrieve the password. However if I could do so

[PHP] Functions internal to a class implementation

2003-03-08 Thread trlists
I have a class for elements of an HTML form and a bunch of subclasses for text box, radio, etc. I need some utility functions which will be called by some of the subclass implementations. These are utilities used within the class only, they are not methods. Is there a "best" way to implement

<    1   2