Re: [PHP] Age from birthdate?

2003-10-23 Thread Nicholas Robinson
Oh, you're such a pedant. On Thursday 23 Oct 2003 9:08 pm, Ryan A wrote: > Now HERES a good PHP related thread thats been going on for around 2 > days...:-D > > >Yes, but think about all the presents, hangovers, etc. they miss. > > On Thursday 23 Oct 2003 2:12 am, Mike Migurski wrote: > > >> >I do

Re: [PHP] Age from birthdate?

2003-10-23 Thread Nicholas Robinson
Yes, but think about all the presents, hangovers, etc. they miss. On Thursday 23 Oct 2003 2:12 am, Mike Migurski wrote: > >> >I do wonder what the rule for those born on Feb 29'th. Do they > >> >celebrate they're birthday before or after it on non leap years? > >> > >>Neither. They celebrat

Re: [PHP] Using cookies

2003-10-21 Thread Nicholas Robinson
If we're into analogies, how about a cookie containing username/password being much the same as leaving the keys to the house under your doormat? If someone knows that this is a common practice, they can find them and gain access to your house. As I understand it (and I am not a lawyer) the la

Re: [PHP] Is anybody else getting these??

2003-10-20 Thread Nicholas Robinson
I'm feeling left out, I'm not getting any of these. Haven't done since I blocked Hanmir. On Monday 20 Oct 2003 4:11 pm, John Nichel wrote: > Does [EMAIL PROTECTED] need to be removed from the list, or is it > just me? > > Original Message > Subject: Returned mail: see transcript

Re: [PHP] SQL Query OT question for the experts :)

2003-10-17 Thread Nicholas Robinson
The following works in MySQL, but obviously (and unlike your client!) you'll want to do this on a copy of the table first... update londonhotelsallphotos set Number = ( if (@hi != HotelID, @line := 1, @line := @line + 1)), HotelID = (@hi := HotelID) Note that if you run this query more than onc

Re: [PHP] mysql query

2003-10-03 Thread Nicholas Robinson
DESC is a reserved word (used to indicate a DESCending ORDER bY). N On Friday 03 Oct 2003 11:17 am, Cameron Metzke wrote: > ok im stumped lol i have used this code in the past to insert data into > mysql (im relitively new though) > --code > mysql_query("INSERT INTO Images (Image, des

Re: [PHP] TIME

2003-09-02 Thread Nicholas Robinson
Not directly as far as I know. Try using chronyd or similar (google will point you in the right direction). This works well with one of my machines that has a wayward clock and chronyd is happy to work with networks not permanently connected to the internet. On Tuesday 02 Sep 2003 1:11 am, Dale

Re: [PHP] MySQL Left Join Question

2003-09-02 Thread Nicholas Robinson
I'm not clear whether you are saying you get the records where there is a match and no non-matching records, or simply no records at all! What happens if you take out the WHERE clause, do you get all the records from p being displayed with NULLs for c.projectid where no match exists? Nick On

Re: [PHP] Gripe^2 [was Gripe]

2003-08-30 Thread Nicholas Robinson
You could equally ask why we get plagued with silly strap lines like "I used to think I was indecisive, but now I'm not so sure." HTH On Saturday 30 Aug 2003 3:54 am, Curt Zirzow wrote: > Why do people insist on using their work address so we are plagued > with privacy notices and autorespond's

Re: [PHP] Clean Up the sand box time

2003-08-23 Thread Nicholas Robinson
On Friday 22 Aug 2003 10:26 pm, John Taylor-Johnston wrote: > This is my favourite question. Can I clean up my 'if then' statements a > tad? Must be a cleaner way? > Still learning, still having fun :) > Thanks, > John > > $news = mysql_query($sql) or die(print > "document.write(\"".mysql_error().

Re: [PHP] File upload + permissions + .htaccess in php

2003-08-22 Thread Nicholas Robinson
I've had this problem twice recently. Once it was because I'd foolishly moved a script that used relative pathnames. The result was that I was trying to access a file outside the DocumentRoot and it didn't matter what the permissions on the file were, it wasn't trying to open that one at all!

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-17 Thread Nicholas Robinson
And the reason I quoted 'usual' is that my suggestion is more portable. On Thursday 14 Aug 2003 11:54 am, Ford, Mike [LSS] wrote: > On 13 August 2003 20:05, Nicholas Robinson wrote: > > On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: > > > Hi! > > >

Re: [PHP] Background process

2003-08-14 Thread Nicholas Robinson
Are you sending a after the re-direct to ensure your browser loads the page as soon as possible rather than delaying? If not, this could appear that it isn't re-directing until the script starts. On Wednesday 13 Aug 2003 8:21 pm, Jackson Miller wrote: > I have a script that starts a background

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Nicholas Robinson
The 'usual' trick is to set the date to the first day of the month after the one you want and then subtract one day. HTH Nick On Wednesday 13 Aug 2003 8:00 pm, Scott Fletcher wrote: > Hi! > > Here's a trick script. We know that some months have the last day > which is 30 while other is 31.

Re: [PHP] logging of mail() function?

2003-08-14 Thread Nicholas Robinson
I use a bcc to a specific email account. Not pretty but it works. Here's a snippet: /* To send HTML mail, you can set the Content-type header. */ $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-15\r\n"; /* additional hea

Re: [PHP] Problem occurs when included file includes anther file.

2003-08-11 Thread Nicholas Robinson
ooops, sorry, ignore my last post, I must get larger text on my screen! Missed the .: element of your path! Can you confirm that this file is a replacement for demo.php? "Problem occurs when the code is like this " If so, then it won't find it because you haven't include ./inc in your include

Re: [PHP] Stop neurotic posting

2003-08-11 Thread Nicholas Robinson
I don't have time for speculative research and I'm not going to apologise for it. By answering a few queries of a technical nature, helpfully and constructively without recourse to rude TLA's and FL:A's (and not having to defend my modus operandi), I feel I earn the odd tasty morsel lobbed in

Re: [PHP] Stop neurotic posting

2003-08-10 Thread Nicholas Robinson
Andu's right. I've left several lists in the past, not because of people listing questions where they should have read the manual first, but because I couldn't stand the sad b**ds who get their kicks by belittling people with less knowledge but more manners than themselves. I've actually le

Re: [PHP] Problem occurs when included file includes anther file.

2003-08-09 Thread Nicholas Robinson
You can set the path(s) in php.ini Edit the file and search on 'include' HTH Nick On Friday 08 Aug 2003 6:38 am, CaiYongzhou wrote: > The directory structure is as follows: > / > > |-- demo.php > |-- inc/ > | > |-- inc1.php > |-- inc2.php > > === file demo.php == > require 'inc/inc1.ph

Re: [PHP] easier than switch

2003-08-09 Thread Nicholas Robinson
As, in this case, only one of the variables is non-null, then you could use the string concatenation operator and this would return what you want. i.e. type = $_POST['news'] . $_POST['dreams'] . $_POST['storys']... I think I've used the same variable name in different forms on the same page, as

Re: [PHP] Insidious!

2003-08-07 Thread Nicholas Robinson
Could this have anything to do with our being registered as spammers? On Wednesday 06 Aug 2003 9:59 am, [EMAIL PROTECTED] wrote: > Do you recall during the height of the War in March? > I posted a simple joke - got one (positive) reply before getting kicked off > the list by Mr Lerdorf himself. >

Re: [PHP] Redirect to HTTPS

2003-08-01 Thread Nicholas Robinson
It might also be worth making sure that your web server is configured to force https on this page if this is what you want. Otherwise a user could type the URL in without the HTTPS and still get the page. On Friday 01 Aug 2003 9:20 am, [EMAIL PROTECTED] wrote: > I have a stupid question. > > I

Re: [PHP] Mysql query and PHP loops

2003-08-01 Thread Nicholas Robinson
04 am, Nicholas Robinson wrote: > I think this does what you want. You can probably extend it to do the final > check for val3 vs. val2 > > select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as > t2 where t1.val2 <= t2.val2 group by t1.val1; > > HTH > &

Re: [PHP] Mysql query and PHP loops

2003-07-31 Thread Nicholas Robinson
I think this does what you want. You can probably extend it to do the final check for val3 vs. val2 select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as t2 where t1.val2 <= t2.val2 group by t1.val1; HTH On Thursday 31 Jul 2003 3:22 pm, Petre Agenbag wrote: > Hi List >

Re: [PHP] Location header - slow redirect

2003-07-30 Thread Nicholas Robinson
try putting this after the header: echo ""; It forces the redirect to take place immediately (in most cases!). HTH On Wednesday 30 Jul 2003 11:53 am, admin wrote: > I'm using the following short script to redirect users to another page > on my site (php 4.3.2, Apache 2.0.47). > > $goLang='en';

Re: [PHP] Search in PhP

2003-07-30 Thread Nicholas Robinson
Try running a exec() running a grep command on your DocumentRoot. something like 'grep -ril fred * would just produce the filenames containing fred or -ri would display the context. You could then produce links to the files from the resulting output. HTH On Wednesday 30 Jul 2003 10:51 am, khu

Re: [PHP] MySQL query/PHP logic?

2003-07-29 Thread Nicholas Robinson
Don't know whether it's just because it's late at night here in the UK or whether I'm being a bit dim, but wouldn't it be much, much easier to store all the data in your non-main tables in a single table and distinguish the type of data (i.e. fof, pub, gov, etc) by a field. This would simpli

Re: [PHP] Apache logs to keep $_POST values

2003-07-29 Thread Nicholas Robinson
Probably better to shell a command to write to the system log - I don't think PHP can do it directly. This would nott be subject to the contention problems you cite in writing to either an apache log or a dedicated log. HTH Nick On Tuesday 29 Jul 2003 8:36 pm, Jay Blanchard wrote: > [snip] > I

Re: [PHP] Parsing MySQL query return

2003-07-28 Thread Nicholas Robinson
It occurred to me after my first reply that you might be able to do something in mysql. This works (given my earlier assumptions): select left( paras, if ( locate( '\n', paras ) = 0, length( paras ), locate( '\n', paras ))) ... It will work with \n\n as well. N On Monday 28 Jul 2003 7:57 pm,

Re: [PHP] Parsing MySQL query return

2003-07-28 Thread Nicholas Robinson
If you assume either \n or \n\n as the para delimiters then you could use strpos (see function.strpos.html) to work out where to split the text. If the text field contents are huge, you might consider limiting the query results by using left( field, size ) in the query. KR N On Monday 28 Jul

Re: [PHP] List Problems

2003-07-28 Thread Nicholas Robinson
I've been getting them too. The really annoying bit is that the most likely reason for it is that the lucky devil hanmir is probably on holiday! On Monday 28 Jul 2003 6:26 pm, Curt Zirzow wrote: > Any body else getting a message back with subject like: > [ERR] Re: [PHP] subject of message. > >

Re: [PHP] $_GET['sort'] & argument separator

2003-07-28 Thread Nicholas Robinson
What happens if you use a non-breaking html space instead? I.e EvalĀ # HTH Nick On Monday 28 Jul 2003 9:06 am, Ow Mun Heng wrote: > Hi, > > I have this problem, which could easily be solved through a name > change but I would like to learn more. > > There's a table set up from a MySQL query

Re: [PHP] Sessions GET vs. Cookies

2003-07-27 Thread Nicholas Robinson
Many thanks, that's fixed it! On Sunday 27 Jul 2003 10:42 pm, Chris Shiflett wrote: > --- Nicholas Robinson <[EMAIL PROTECTED]> wrote: > > I've noticed that links in my pages are getting the sessionid > > added as a GET parameter. > > The session.use_trans_sid

[PHP] Sessions GET vs. Cookies

2003-07-27 Thread Nicholas Robinson
Hi First time on the list and this may be a silly question. I'm developing a site that uses sessions. I have enabled cookies and checked that a valid cookie with the appropriate session id is being set. However, I've noticed that links in my pages are getting the sessionid added as a GET parame