Re: [PHP] addslahes and magic quote woes

2002-07-03 Thread Martin Clifford
Try stripslashes() before addslashes(), to ensure that it doesn't already contain slashes. HTH Martin >>> Jean-Christian Imbeault <[EMAIL PROTECTED]> 07/03/02 09:40AM >>> I am trying to make my PHP safe against malicious data user inputs. Reading up on this most people suggest using addslashe

Re: [PHP] How do I split an alphabetical list (array) into A-Mand N-Z?

2002-07-03 Thread Martin Clifford
Try using a regular expression to go through each of the array elements, sending to one array if the first letter is [a-mA-M], to another if the first letter is [n-zN-Z]. If you're not searching by first letter in the array elements, and they are comma-delimited name sets, do it that way. HTH

Re: [PHP] Regular Expression Problem

2002-07-02 Thread Martin Clifford
. $var, $$var or &$var to $var. Any ideas on how to do that? >>> [EMAIL PROTECTED] 07/02/02 01:50PM >>> On Wednesday 03 July 2002 01:40, Martin Clifford wrote: > Hey all! > > I'm trying to get this darn eregi_replace() to work, but it doesn't produce > any

[PHP] Regular Expression Problem

2002-07-02 Thread Martin Clifford
Hey all! I'm trying to get this darn eregi_replace() to work, but it doesn't produce any results at all. I want it to find all occurances of PHP variables. Here is the regexp $output = eregi_replace("^[\$]{1,2}[a-zA-Z][0-9]+$", "\\1", $var); As you might guess this is for a syntax highlighti

Re: [PHP] Emptying a Single Array Value

2002-06-12 Thread Martin Clifford
st a short test script that misbehaves for you. $arr = array('foo','bar'); unset($arr[0]); print_r($arr); // only $arr[1] = 'bar' exists now See also: http://www.php.net/unset http://www.php.net/array_splice Regards, Philip Olson On Wed, 12 Jun

[PHP] Emptying a Single Array Value

2002-06-12 Thread Martin Clifford
Howdy, If someone out there could tell me how to get rid of a single key/index pair within an array, it would be great. I've tried both unset() and empty(), but both destroy the entire array. Please CC me directly, as I'm on the digest. Thanks in advance! Martin -- PHP General Mailing Lis

Re: [PHP] php and javascript question

2002-06-05 Thread Martin Clifford
As far as I'm aware you can't create a javascript variable and use it within PHP on the same page. You can add that variable's value to a hidden form element to be passed to the next page, but I don't think so with the same page. martin >>> "kemu" <[EMAIL PROTECTED]> 06/05/02 02:30PM >>> I ha

Re: [PHP] Sessions question (-enable-trans-sid)

2002-06-05 Thread Martin Clifford
I'm sure this is not a definitive answer, but I would assume that since you would be passing the information through both the URI and Cookies, it will work regardless of cookies enabled or disabled. On the other hand, if you are passing the session id through the URI in the first place, you do

Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford
Well, I had the right idea... John is just more advance than me. :o) >>> "1LT John W. Holmes" <[EMAIL PROTECTED]> 06/05/02 11:09AM >>> Since those look like MySQL timestamps, I would suggest you do it in your query. SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table Adapt to

Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford
Use substr() to extract the appropriate information, then format it and compare it. 20020603 is obviously June 3, 2002 and 20020605 is obviously June 5, 2002 which means there was 1 day (plus x hours) between the two. Hope to help! Martin >>> "Tyler Longren" <[EMAIL PROTECTED]> 06/05/02 11:01

RE: [PHP] redirection

2002-06-05 Thread Martin Clifford
You can pretty much use ANY JavaScript event handler to accomplish the redirection. I'm new to PHP, so the header is the only place I know of to redirect. onclick onmouseup onmousedown onmouseover onmousemove onkeydown onkeypress onkeyup onchange etc. -- PHP General Mailing List (http://www.

[PHP] Statistic Variables

2002-04-11 Thread Martin Clifford
Hello again everyone... Well, I did create that "visitor log" file for my page, and it's working great, so thanks to all of you that helped me out yesterday! I've been looking and looking and looking through the PHP manual (which for a newbie is very hard to navigate), and I've only come up w

Re: [PHP] Visitors Log Help

2002-04-10 Thread Martin Clifford
hey are any) Andrew - Original Message - From: "Martin Clifford" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, April 10, 2002 5:04 PM Subject: Re: [PHP] Visitors Log Help As I'm sort of new to this, can you expand on "f

Re: [PHP] Visitors Log Help

2002-04-10 Thread Martin Clifford
d... BUT U might want to put some file locking in there to make sure 2 people don't visit at the exact same time and corrupt your Vistor_Log.txt BTW If are using apache a better option might be to look into the custom log files it can make, I think it can do what you are trying to do in PHP

[PHP] Visitors Log Help

2002-04-10 Thread Martin Clifford
Hi all! I am trying to build a Visitor_Log.txt file for my page, which will write specific information about users that visit the page (time of day they visited, browser they are using, operating system, etc) to a txt file on my server. My question is... how do I write these values to the file

[PHP] Outputting Array Values

2002-04-09 Thread Martin Clifford
Hello everyone! I'm fairly new to PHP, but I do know JavaScript, which is both a blessing and a hinderance, as there are many syntax similarities, but a subtle amount of difference which means I usually screw something trivial up in my PHP code. Can someone explain to me why the following isn

[PHP] DB Question

2002-04-02 Thread Martin Clifford
Hello all, I've been waiting in the shadows, reading, trying to get a handle on what type of questions go here. I'm hoping this one does, and that some of you guru's might be able to offer some insight. I've just started out with PHP, and want to get to know relational databases. I've seen

<    1   2