Re: [PHP] validating textarea using php

2008-05-14 Thread Richard Heyes
Dotan Cohen wrote: 2008/5/14 Richard Heyes [EMAIL PROTECTED]: Any host that upgrades the PHP version (a major upgrade considering it would be 5 - 6) without notifying Customers isn't a very good hosting company, and you really should change to a better one (Rackspace are good). Even 1and1

Re: [PHP] validating textarea using php

2008-05-13 Thread Richard Heyes
the spacebar and does not type anything i should be able to display an alert message. You can use the trim() function to determine whether a variable is just whitespace. $comments = trim($_POST['comments']); if ($comments == '') { // Show error message } -- Richard Heyes

Re: [PHP] validating textarea using php

2008-05-13 Thread Richard Heyes
Jim Lucas wrote: Richard Heyes wrote: Also you can use short tags (popular...) to make the HTML more readable. Eg: textarea name=comments cols=26 rows=3 id=comments ?=htmlspecialchars($comments)? /textarea It also makes the code less portable. If that's even a concern. A lot

Re: [PHP] quick question

2008-05-09 Thread Richard Heyes
Ho to read date from HTML form - How to read $_POST['date']=dd/mm/ string variable as a date? If you want a unix timestamp then try investigating strtotime(). -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org

Re: [PHP] quick question

2008-05-09 Thread Richard Heyes
Well, when I try date('d/m/y', strtotime($_POST('date')) - it seems mixing day and month, I tried setlocale(LC_ALL, 'en_GB'); but it didn't strtotime() returns a unix timestamp (ie number of seconds since 1970ish. Nothing to do with the date object. -- Richard Heyes

Re: [PHP] usort inside a class

2008-05-09 Thread Richard Heyes
() [function.usort]: Invalid comparison function i tried to do usort($this-arr, 'cmpi') but it does not work either. If it's anything like other functions, try this: usort($this-arr, array($this, 'cmpi')); -- Richard Heyes ++ | Access SSH with a Windows mapped

Re: [PHP] How to determine if file is writable and deletable

2008-05-07 Thread Richard Heyes
Perhaps touch might help. Touch my ass. ROFLMAO (I've been waiting for years to use that one) -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP

Re: [PHP] How to determine if file is writable and deletable

2008-05-07 Thread Richard Heyes
It won't work? No idea, it was just a rather poor play on words. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http

Re: [PHP] Handling Incoming Email Attachments

2008-05-06 Thread Richard Heyes
to validate the attachments and do not rely on the MIME-type only. People can spoof that kind of files. There's also the PEAR mimeDecode class as well. A PHP solution so it won't require you to reconfigure/compile anything. -- Richard Heyes ++ | Access SSH

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
you could use something like a SET type, and search for something in it using FIND_IN_SET(). -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
Tony Marston wrote: Richard Heyes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The database must be properly normalised otherwise it will be difficult to get at the data you need in an efficient manner. Not true. If your needs are simple for example, normalisation can increase

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
be a requirement. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
suppose (which you could say, is more than one...). -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
to, so what's the advantage in throwing it away and generating work for yourself in reproducing it? -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP

Re: [PHP] Where to start!

2008-05-05 Thread Richard Heyes
| +-++ How's that for ASCII art? :-) -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
you make a solution that fulfils the requirements of the customer, without being cheap and cheerful and is designed well to accomodate future modifications, and make it resolutely clear that any future modification may take longer since schema changes may be required. -- Richard Heyes

Re: [PHP] Re: Where to start!

2008-05-05 Thread Richard Heyes
Then surely designed well would include a normalised database? Not necessarily. You could for example have a database that accommodates future needs without being completely normalised. -- Richard Heyes ++ | Access SSH with a Windows mapped drive

Re: [PHP] web based chat app

2008-05-04 Thread Richard Heyes
://www.phpguru.org/chat/chat.php -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] web based chat app

2008-05-04 Thread Richard Heyes
AJAX to drag down the latest page instead of refreshing the whole page. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http

Re: [PHP] retrieve email address

2008-05-04 Thread Richard Heyes
. There's also a shortcut function for just matching an Interweb email address. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List

Re: [PHP] set_error_handler help

2008-05-02 Thread Richard Heyes
ErrorHandlingObject(); set_error_handler(array($obj, 'myMethod')); -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net

Re: [PHP] check if any element of an array is not empty

2008-05-01 Thread Richard Heyes
i dont really see how that gets him the answer without at least checking the number of elements in the array after filtering it w/ array_filter; which if he wanted to reuse in several places would make sense to write a simple function for anyway.. Yes, on both counts. -- Richard Heyes

Re: [PHP] Categories like wordpress

2008-05-01 Thread Richard Heyes
() will be very useful. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] Categories like wordpress

2008-05-01 Thread Richard Heyes
...? The latter two solutions I suggested are certainly easier to work with and (with todays hardware), speed isn't always a factor. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive

Re: [PHP] check if any element of an array is not empty

2008-04-30 Thread Richard Heyes
but I was thinking if there is the function does that. array_filter(). Note this: If no callback is supplied, all entries of input equal to FALSE (see converting to boolean) will be removed. http://uk3.php.net/manual/en/function.array-filter.php -- Richard Heyes

Re: [PHP] php framework vs just php?

2008-04-22 Thread Richard Heyes
i just wondering whether i am the only one thinking this way. anyone out there still doing php without using framework? Absolutely. Personally I use a lot of disparate libraries, a lot of them from PEAR. Doing this I've never found the need or the inclination to use a framework. -- Richard

Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Richard Heyes
Web 2.0 *and* profitable? Surprising. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe

Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Richard Heyes
The commute would be a killer, Richard. LOL. I think you're right. A 60 mile commute caused me to quit a job, so several thousand miles sounds excessive... :-) -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org

Re: [PHP] Check RAW data

2008-04-20 Thread Richard Heyes
I don't believe malicious code can be executed with echo and header. The header of the PNG file, not a HTTP header. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive

Re: [PHP] Check RAW data

2008-04-20 Thread Richard Heyes
now though because it was some time ago. But that doesn't mean to say more won't be found. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General

Re: [PHP] Database abstraction?

2008-04-17 Thread Richard Heyes
minutes :) For the record, it was exactly five minutes. What was? -- Richard Heyes +-+ |Access SASH through a Windows mapped drive| |http://www.phpguru.org/sftpdrive | +-+ -- PHP General Mailing List

Re: [PHP] Database abstraction?

2008-04-17 Thread Richard Heyes
SASH That should have been SSH of course - seems my spell checker isn't very technical... -- Richard Heyes +-+ |Access SSH through a Windows mapped drive| |http://www.phpguru.org/sftpdrive | +-+ -- PHP

Re: [PHP] Database abstraction?

2008-04-17 Thread Richard Heyes
And since no word in the English language begins with FT You're forgetting Ftork... -- Richard Heyes +-+ |Access SSH through a Windows mapped drive| |http://www.phpguru.org/sftpdrive | +-+ -- PHP General

Re: [PHP] Most viewed?

2008-04-17 Thread Richard Heyes
hundred other people so that all of them combined only get counted one time. Because of this if it's not too important (eg it's just ratings of articles) personally I would choose the cookie method. If it's uber important you could have the user login before they can rate stuff. -- Richard Heyes

Re: [PHP] PHP Serialization Performance

2008-04-16 Thread Richard Heyes
), the quickest to implement would be a combination of serialize(), unserialize(), file_put_contents() and file_get_contents(). Using these functions you could very quickly create a persistent cache for data. It might be quicker though to use a cache that's already out there. -- Richard Heyes Employ

Re: [PHP] Database abstraction?

2008-04-16 Thread Richard Heyes
on the edge of my knowledge so I'm not totally sure how to ask it right yet :) You could do it adequately with a DESCRIBE, but there might be something that's better. I would suggest looking through the code of my TableEditor: http://www.phpguru.org/static/TableEditor.html -- Richard Heyes Employ me

Re: [PHP] Database abstraction?

2008-04-16 Thread Richard Heyes
crapola). Credit also due to Stephan Esser. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Database abstraction?

2008-04-16 Thread Richard Heyes
reattached it for him... :-) -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] standard format for Web portal administration side

2008-04-14 Thread Richard Heyes
. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Richard Heyes
of other functions like ceil, floor etc. So the string 18-10 should give me 8, ceil(1/2)*10 should be 10 (if my maths is correct) and the string 18-10;\r\nunlink('/var/www/*'); should not execute. If you can provide your users with distinct inputs (if it's a form) go that route. -- Richard Heyes

Re: [PHP] objects stored in sessions

2008-04-07 Thread Richard Heyes
to unserialize data ? The question(s) should be Why would you want PHP4 to read a PHP5 session? and Why would you expect it to work?. If you want to transfer data between versions you may want to investigate XMLRPC. Or perhaps the somewhat more verbose SOAP. -- Richard Heyes Employ me: http

Re: [PHP] objects stored in sessions

2008-04-06 Thread Richard Heyes
, otherwise you will encounter problems. Or alternatively use __autoload() to allow the class code to be loaded when you start the session. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to jump to line number in large file

2008-04-05 Thread Richard Heyes
of counting the calls to fgets(). -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Dynamic dropdown lists (select)

2008-04-04 Thread Richard Heyes
for Javascript. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] everything as classes

2008-04-03 Thread Richard Heyes
. With common code on the parent movie listings class and with specific code on the appropriate child class. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] autoload with namespace

2008-04-02 Thread Richard Heyes
Playing around with dev PHP 5.3 and namespaces PHP 5.3 will have namespaces? -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] autoload with namespace

2008-04-02 Thread Richard Heyes
err-um sorry for the noise; actually the namespaces work w/ functions as well. So not OO specific? Is there anything I can read that describes them? -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

[PHP] Planet PHP broken?

2008-03-30 Thread Richard Heyes
Hey, As the subject says really. Last thing it has seems to be PEAR on a Shared Host dated the start of the 27th. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Simple RegEx to pull out content between 2 markers

2008-03-29 Thread Richard Heyes
]. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array_filter function

2008-03-28 Thread Richard Heyes
as $k = $v) { if (!empty($v['type']) AND $v['type'] != 'da') { unset($newDataArray[$k]); } } ? Optionally, you could use array_values() to re-index $newDataArray if you need to. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List

Re: [PHP] Re: Quick email address check

2008-03-27 Thread Richard Heyes
. Is there a better way than simply sending a test email to see if it bounces? The Mail/RFC822 class in PEAR has a quick(er) static method for checking the format of an Interweb email address. Mail_RFC822::isValidInetAddress() IIRC -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General

Re: [PHP] restricting access to folders on server

2008-03-24 Thread Richard Heyes
directories. If you put that in .htaccess file, it will apply to that directory and any subdirectories. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Double click problem

2008-03-19 Thread Richard Heyes
and when complete redirects to the thank you page. ie. Form -- Please wait... page -- Thank you page -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] selling gpl software?

2008-03-19 Thread Richard Heyes
the gpl software. he want me to remove all the link and powered by link (anything visible to the end user) Which you can do (IIRC). -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] selling gpl software?

2008-03-19 Thread Richard Heyes
that grant you permission to use and redistribute the software. If you add to it, it stops being the GPL. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Checking how many letters are in a string.

2008-03-19 Thread Richard Heyes
at count_chars and considered writing a wrapper function for each of the 27 letters of the Hebrew alphabet, but I am quite sure that there is a cleverer method. Any ideas? You may want to investigate mb_strlen(): http://uk.php.net/mb_strlen -- Richard Heyes Employ me: http://www.phpguru.org/cv

Re: [PHP] Re: help on using 'request_uri' to make a front-end site

2008-03-18 Thread Richard Heyes
will give you the path to the script or $_SERVER['REQUEST_URI'] (you will probably have to remove the query string with this), along with either dirname(). -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] Re: help on using 'request_uri' to make a front-end site

2008-03-18 Thread Richard Heyes
with a / are taken to be relative to the current documents path. You (probably) want this: a href=/~donn/blah/index.php/use1 The forward slash at the start causes your browser to ignore whatever your current path is, albeit remain on the current domain. -- Richard Heyes Employ me: http

Re: [PHP] Objects as array key names??

2008-03-16 Thread Richard Heyes
/en/language.oop5.magic.php -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Last Friday of every month

2008-03-14 Thread Richard Heyes
. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is this the best way?

2008-03-14 Thread Richard Heyes
(text): $authenticated = true; // Note the lack of quote marks -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Intercepting errors

2008-03-13 Thread Richard Heyes
/function.set-error-handler.php -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Intercepting errors

2008-03-13 Thread Richard Heyes
: this is a mailing list. If you want off you can go to http://www.php.net. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] setcookie

2008-03-12 Thread Richard Heyes
, including whitespace. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What's wrong the __autoload()?

2008-03-12 Thread Richard Heyes
developer who doesn't know of its existence and is new to a job is less likely to admit ignorance and ask how a class is being defined when __autoload() is being used. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re: [PHP] best practices in error handling in PHP

2008-03-12 Thread Richard Heyes
. Aren't they all? :-/ -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What's wrong the __autoload()?

2008-03-12 Thread Richard Heyes
viable business reason. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What's wrong the __autoload()?

2008-03-12 Thread Richard Heyes
. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] What's wrong the __autoload()?

2008-03-12 Thread Richard Heyes
Greg Donald wrote: On 3/12/08, Richard Heyes [EMAIL PROTECTED] wrote: That's not quite the situation. Finding good developers isn't easy, so lots of companies will go for acceptable ones, who are less likely to know of __autoloads existence. Hence, using __autoload is unwise. A lesser

Re: [PHP] /?feed=rss2

2008-03-11 Thread Richard Heyes
up your hosts file (typically /etch/hosts on *nix, c:\windows\system32\drivers\etc\hosts on Windows) and add a line that reads: 127.0.0.1 www.foo.com That way your PC (only your PC) will think that www.foo.com is local, and not go over the Interweb for it. -- Richard Heyes Employ me: http

Re: [PHP] /?feed=rss2

2008-03-11 Thread Richard Heyes
/etch/hosts Typo. That should be: /etch/hosts -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] save image in database vs folder

2008-03-11 Thread Richard Heyes
hard drive and store the file name in the database. If for whatever reason you can't or don't want to do that, then at least store it in a separate table that only gets touched when the image is requested. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http

Re: [PHP] /?feed=rss2

2008-03-11 Thread Richard Heyes
...which is kinda funny b/c right here he says to Employ me. Not with double typos like that, Mr.!! =D Oopsy. Sight is a funny thing... http://www.phpguru.org/article.php/102 -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net

Re: [PHP] /?feed=rss2

2008-03-11 Thread Richard Heyes
A stroke less than two weeks before your twenty-ninth birthday. Five months. Close though... :-) -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] send form by email with image spam controler

2008-03-09 Thread Richard Heyes
. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Pear Installation Problem - Ubuntu

2008-03-06 Thread Richard Heyes
may be better off with a single file while you get it up and running. Something like Console_Table. So, you would create this dir: /usr/local/share/pear/Console and in that place the file Table.php Then in your app you can do this: require_once('Console/Table.php'); -- Richard Heyes

Re: [PHP] Preserving URL after redirect?

2008-03-05 Thread Richard Heyes
So, my question is how would I do that, and I strongly suspect if it's possible at all an .htaccess file with the proper entries would be the way to do it, not using PHP code to redirect as I am now. Is this the case? You would need to use mod_rewrite. -- Richard Heyes Employ me: http

Re: [PHP] string effect

2008-03-01 Thread Richard Heyes
($str) = $length) { return $str; } $str = substr($str, 0, $length); // No body intentionally for ($i=$length - 1; !ctype_space($str{$i}) $i 0; --$i); return rtrim(substr($str, 0, $i)) . $append; } -- Richard Heyes Employ me: http

Re: [PHP] RewriteRule help

2008-03-01 Thread Richard Heyes
the Files Apache directive to make it be parsed as a PHP script (http://www.phpguru.org/article.php/212) 3. Then in the user file you can use the $_SERVER['REQUEST_URI'] to ascertain the correct content to show. -- Richard Heyes (wondering if he's getting a bit of a reputation...) Employ me: http

Re: [PHP] simple command help

2008-02-29 Thread Richard Heyes
else... :-) -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Text Color

2008-02-29 Thread Richard Heyes
' ... -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Making sure an include file works

2008-02-29 Thread Richard Heyes
for some basic checking, and hope that the included files have no syntax errors. Hoping something works leads you down the path of severely broken code. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re: [PHP] reverse string without strrev();

2008-02-28 Thread Richard Heyes
Sorry, Rob, that function doesn't return anything. ;-) It's not meant to: ?php // ... $str = '123'; str_reverse_in_place($str); echo $str; ? -- Richard Heyes Employ me (!): http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe

Re: [PHP] What design patterns do you usually use?

2008-02-27 Thread Richard Heyes
What design patterns do you usually use? Whatever solves the problem. Factory is quite a common one. MVC is another. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How do you send stylized email?

2008-02-26 Thread Richard Heyes
, have a look at my website for the HTMLMimeMail class which greatly simplifies this. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP 24 hour processes?

2008-02-25 Thread Richard Heyes
create file eg cron.txt Or if your version of crontab supports it (not all do) then you can use: crontab -e And to get the manual page, you can do this: man 5 crontab -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net

Re: [PHP] URL modification

2008-02-25 Thread Richard Heyes
I think this is a highly underused built-in feature. Agreed. I started to use it on my blog instead of a query string and pages reported by Google went up. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe

Re: [PHP] URL modification

2008-02-23 Thread Richard Heyes
mod_rewrite in anything you've made? No. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date Function

2008-02-23 Thread Richard Heyes
$start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Use H instead of h. And try the manual. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript

Re: [PHP] URL modification

2008-02-23 Thread Richard Heyes
this: /rental.php/property/23425 -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] URL modification

2008-02-22 Thread Richard Heyes
The trailing slash is not necessary if login is a directory. For example: http://www.websupportsolutions.co.uk/demo -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] URL modification

2008-02-22 Thread Richard Heyes
/adam and in that place a default document redirecting. Still no need for mod_rewrite. Unless of course you want the url to remain in the addressbar, but personally I don't think that is as important as what the user has to type in initially. -- Richard Heyes http://www.phpguru.org Free PHP

Re: [PHP] www. not working

2008-02-21 Thread Richard Heyes
porn on one of them?!! Now that would be telling. :-) -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new features automatic and free -- PHP General Mailing List (http://www.php.net/) To unsubscribe

Re: [PHP] www. not working

2008-02-21 Thread Richard Heyes
Spider webs have existed for many a year... Not long before the eggs hatched. Debatable. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new features automatic and free -- PHP General Mailing

Re: [PHP] www. not working

2008-02-20 Thread Richard Heyes
A form of the web existing long before that depending on your definition of the web. To me it's a way for people to share information. That would cover the BBS world which pre-dates LANs by some distance. Spider webs have existed for many a year... -- Richard Heyes http

Re: [PHP] Re: mysql input

2008-02-19 Thread Richard Heyes
that in the manual... -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new features automatic and free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] regex usage

2008-02-17 Thread Richard Heyes
could change the regex to use start/end anchors. Also, the trailing comma in the length specifier bit means 4 or more Eg: if (preg_match(/^\d{4,}$/, $_POST['id'])){ echo $_POST['id']; } -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you

Re: [PHP] check if website has www. in front of domain

2008-02-16 Thread Richard Heyes
']; } return preg_match('/^www\./i', $url); } -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new features automatic and free ** New Helpdesk demo now available ** -- PHP General

Re: [PHP] mysql question #2

2008-02-14 Thread Richard Heyes
At any rate, just seeing this tells me that you've got a real mess on your hands... Or you could say, You're going to have some fun cleaning that. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new

Re: [PHP] Template system in PHP

2008-02-13 Thread Richard Heyes
to), then they quite honestly aren't worth employing. (the alternative syntax for PHP conditionals and loops, along with short tags) And there should of course be some sort of test site on the same box as your live site allowing you to thoroughly test your new stuff before it goes live. -- Richard Heyes http

<    1   2   3   4   5   6   7   8   9   >