Re: [PHP] anyone have HTML snippet example of HTTP method = put?

2008-08-02 Thread Richard Heyes
 form method=PUT action=work.php
  File: input type=file /
  input type=submit value=Submit /
 /form

 Looking in my webserver logs, it changes that to a GET.

You could use Fiddler to verify what type of requests your browser is making:

http://www.fiddlertool.com

If it is indeed the browser, chances are it doesn't support PUT.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Get Remote-Image

2008-07-31 Thread Richard Heyes
 Gutentag,

I'm staring at the screen thinking Huh...?.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP email

2008-07-31 Thread Richard Heyes
Hi,

Can someone tell me what the address is to change my @php.net redirect? Thanks.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Back to Basics - Why Use Single Quotes?

2008-07-31 Thread Richard Heyes
Single quotes do still recognise \' and \\ though, for getting a
single quote and backslash. IIRC (which isn't likely) they're the only
two.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Creating new site

2008-07-31 Thread Richard Heyes
 Cake is licensed under the MIT license  which is about as permissible as you
 can get.

Any Open Source code is permissable as long you don't tell anyone... :-)

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 I agree but not everyone think in the sameway. I have seen several big
 websites that got hit because they haven't used super globals in the code
 and their hosting provided would just change the PHP.ini setting and nothing
 would work.

Well if it's a big website then why use a hoster that changes the
php.ini without much, if any, thought?

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 The technical abilities and awareness is often inversely proportional to
 the size of the hoster.

Lol.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 Sorry to disagree,

That's nothing to apologise for.

 But I think that with PHP4 a lot of people start thinking that they could be
 programmers (maybe they can, developers it's another story). When php5 came
 they didn't know how do deal with the deprecated methods and worst, some
 hosters didn't know how to virtualize a f1ck1n' server with Apache+PHP5. A
 lot of mistakes were made when php5 came out but how can a language grow up
 when they DEPRECATE the syntax? we're not talking about removing the last

That's not the problem of the PHP developers. Learning is not a case
of spend a few years doing it and you're set - it's a life long thing.

 Maybe I'm in a GET LOST PHP phase but I think that someone is killing it,
 and the ones who are stuck in 4 are not helping.

There are alternatives - have you heard of Brainfuck?

 When U write code, U must not be worried 'bout the next upgrade of your
 server!

Of course you should. Writing code with every eventuality in mind is
simply ludicrous. And you really should expect things to change when
major versions are changed - that's why release notes exist.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-30 Thread Richard Heyes
 Umm, I beg to differ.  A developer should not need to worry about a
 possible/future upgrade of the runtime platform.  I certainly don't
 worry about the next release of gcc or glibc when I write C.

Minor point releases certainly, but not major ones. They're major
upgrades for a reason - things change.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Creating new site

2008-07-30 Thread Richard Heyes
2008/7/30 Raido [EMAIL PROTECTED]:
 Hi,

 There are many sites explaining how to build new site etc but I'd like to
 hear what You suggest. (about how to plan whole thing and how to write
 separate parts which can be put together later)

This may be of some help:

http://www.phpguru.org/static/ApplicationStructure.html

On the other hand, it may not.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Why PHP4?

2008-07-28 Thread Richard Heyes
I'm interested - why are people still using PHP4? It's been over 4
years (I think) - plenty of time to upgrade to five.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Web2.0 style tags - where to start?

2008-07-28 Thread Richard Heyes
 I'm working on a project where we're building a collection of videos in
 Flash and the idea has been mooted that it would improve usability if we
 were to allow users to tag videos they've seen a la last.fm, flickr
 youtube etc.

If you're thinking of trying re-invent a UI - my advice would be
don't. Your visitors are more likely to know and understand their own
PCs UI as opposed to one that you invent. Any UI you come up with is
not going to be as easily used no matter how good it is.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-28 Thread Richard Heyes
 Why is COBOL still in use? :)

What is COBOL? :-)

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-28 Thread Richard Heyes
 Finally - why migrate? What's the rush?  Lots of people are still
 running back-level software

That I can understand. I'm still running Apache 1.3.33 (I think) along
with PHP 5.0.4.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why PHP4?

2008-07-28 Thread Richard Heyes
 actually, a lot of stuff is finally saying php5 only now ...

Just in time for PHP6... :-)

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular Expression help need

2008-07-27 Thread Richard Heyes
 Before: phi strongRichard/strong,  good morninglt;/p
 After:   phi strongRichard/stronggt;, amp; good morninglt;/p

By the sounds of it negative look ahead assertions may be of some
help. Or look behind assertions.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular Expression help need

2008-07-25 Thread Richard Heyes
 How can I make a string with  (NOT amp;, gt;, lt; or quot;), ,  xml
 compatible?
 What is the expression to use?

Not entirely sure what you're after (try posting some before and after
snippets), but by the sounds of it you don't need a regular expression
- strtr() will work for you. Or str_replace().

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Code beautifier

2008-07-24 Thread Richard Heyes
Anyone know of an unintrusive code beautifier written specifically with in mind?

Thanks.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Code beautifier

2008-07-24 Thread Richard Heyes
 Anyone know of an unintrusive code beautifier written specifically with in
 mind?


 With 'what' in mind?

Sorry, PHP.

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Code beautifier

2008-07-24 Thread Richard Heyes
 (and anal retentive) when you code :)

I am; the problem is noone lives up to my standards... :-)

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Code beautifier

2008-07-24 Thread Richard Heyes
Hi,

Rich, I thought you WERE the code beautifier.  ;-P

Thanks... There's just so much to do though... :-)

-- 
Richard Heyes
http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Search thoughts

2008-07-19 Thread Richard Heyes

Hey,

I was hoping to get some ideas on improving a sites search. Currently I 
have two - not a lot but I've been thinking about this for a few minutes.


Currently the site in question uses a very basic LIKE in MySQL, eg 
%blah%, but naturally this finds terms such as hjkblahbjkk - which is 
not desired. Or such matches should be ranked lower than something that 
matches the exact word blah. My thoughts are using a points system, eg 
assigning 5 points for an exact word match, 1 for a partial match. And 
then ordering the search results by the total points assigned.


Either that or using external search code and not worrying so much.

Cheers.

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Search thoughts

2008-07-19 Thread Richard Heyes

Mark Kelly wrote:

Hi.

On Saturday 19 July 2008, Richard Heyes wrote:

Currently the site in question uses a very basic LIKE in MySQL, eg
%blah%, but naturally this finds terms such as hjkblahbjkk - which is
not desired. Or such matches should be ranked lower than something that
matches the exact word blah.


I did this with 2 queries, and no need for messing with points etc (unless 
you particularly want to). 

Start with LIKE 'word' query and pull the results into a results array. 
Then do the same query but with LIKE '%word%' and loop through append 
the results to the results array. Use something like if 
(!in_array($thisResult,$resultSet)) while appending to avoid duplicates.


Well no. LIKE is slow and so is in_array(). Admittedly it's not a busy 
site, but still.



How much traffic do you have and what's your hardware? Are your queries 
cached and subsequently repeated? Do you pre cache common queries?


Cheers.

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Search thoughts

2008-07-19 Thread Richard Heyes
I'm sure that would work, but just how many LIKE items do you want to 
show the user? For me, I would rather not show them anything if there is 
nothing on my site that matches their exact search criteria.


Certainly an idea, but something like We also found... might be 
helpful in regard to typos.


The point being, from my perspective, users don't spend a lot of time 
reading results. They want answers quick and short. I would think that 
if you provided them with a long list of Did you mean this? results -- 
that might frustrate the user.


A good point. For example I rarely go further than the first page on 
Google (I never need to really, but whatever...).


 if someone could come up with a

better way, I am sure you could.


Thanks for the vote of confidence, but I've kept away from search as it 
doesn't overly interest me. In fact that's quite an over statement. It 
really bores the pants off me.


But, the point is, would it make a 
difference?


Well spending some time on it will improve it as it's just the basic 
LIKE at the moment, but point taken - I really don't want to spend a lot 
of time on it.


--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Search thoughts

2008-07-19 Thread Richard Heyes

Ever play with fulltext search?


Yes, though it's not suitable in this instance.

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] An HTML5 radar chart

2008-07-19 Thread Richard Heyes

http://www.phpguru.org/downloads/HTML5_radar/

Look at me, I'm so cool. This perhaps shows the magnitude of the data a 
little better than a pie chart. Not quite a normal radar, but this is 
finished... :-)


--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Search thoughts

2008-07-19 Thread Richard Heyes

 the entire King James Bible in a dB -- interesting read

That's debateable... :-)

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Search thoughts

2008-07-19 Thread Richard Heyes

Hi,


I've been playing around with the zend search lucene and it is really
powerful too.


Worth looking into?

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] An HTML5 radar chart

2008-07-19 Thread Richard Heyes

Why are you doing that with JavaScript?


Because it's neat, and I'm bored. A more real reason could be shifting 
the load from your server (ie building and displaying graphs with 
JPGraph) on to the client machine, where there's far more resources 
available. Say your server has to show a graph for 100,000 site 
visitors. Compare your 1 server generating all 100,000 graphs, which you 
may not be able to cache, with 100,000 client computers generating them 
individually. End result - far less load on your server, hence it can 
cope with far more views and/or respond quicker.


--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] An HTML5 radar chart

2008-07-19 Thread Richard Heyes
And it does -- it's a totally different type of chart than any I've seen 
before.


Started off with the intention of creating a real radar chart, but this 
was far easier and still represents the data in a very similar way.



Good work -- now make it work for all other browsers. :-)


Role on IE8. :-)

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Search thoughts

2008-07-19 Thread Richard Heyes

http://framework.zend.com/manual/en/zend.search.lucene.html


Nice one, thanks.

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Advice on a radar chart

2008-07-15 Thread Richard Heyes

Hey,

Can anyone suggest an efficient method for plotting the marks on a radar 
chart? I have the background done 
(http://www.phpguru.org/downloads/HTML5_radar/ - FF required), but that 
not exactly difficult.


Cheers.

--
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] Advice on a radar chart

2008-07-15 Thread Richard Heyes

If you are willing to use googles chart api ..

http://code.google.com/apis/chart/#radar


Nope. It's not something I need to implement, mmore a personal (albeit 
with this lists help) project.


--
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] Advice on a radar chart

2008-07-15 Thread Richard Heyes

What do you want to implement as a radar chart?


Nothing in particular. Just a generic radar chart for representing data.

--
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] PHP code will not work

2008-07-10 Thread Richard Heyes

$_ENV

$_SERVER

$_ENV and $_SERVER are. Though their contents are doubtless different.

--
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] Relocating and POSTing

2008-07-10 Thread Richard Heyes

Alex Chamberlain wrote:

I need to send a header('Location:') and send some data along with it -
how would I do this??


Two methods:

1. Use the query string. Eg

header('Location: http://www.xxx.com?name=valuename2=value2');

2. Use sessions

--
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 font/size do you use for programming?

2008-07-09 Thread Richard Heyes

 triple-headed display

That's just greedy.

--
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 font/size do you use for programming?

2008-07-09 Thread Richard Heyes

I use a triple display as well.

My desktop is 3840 x 1024 -- and I use every inch of it.


And here I am with one paltry monitor. :-(

--
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] Asynchronous PHP Execution

2008-07-06 Thread Richard Heyes

Waynn Lue wrote:

and exec/shell (but that
doesn't seem to be asynchronous), but neither seems optimal.


It can be if you redirect the output streams and put an ampersand after it:

?php
   exec('sleep 5  /dev/null 2/dev/null ');
   echo 'Script ended';
?

This tiny sample should end immediately, and the sleep command should run
on regardless.

Thanks so much for the suggestion, that's what I ended up doing and it

worked, after some fiddling.  Just as a side note, does it execute from the
current directory of the file?


I think so.


Previously, I tried calling exec('php
scripts/foo.php'), but it seemed like there was some weird interaction
between different required files.  E.g., this was the layout:

orig.php
scripts/foo.php
incl.php


orig.php had the exec line, and foo.php had require_once(../incl.php).  But
it seemed like the exec call caused foo.php to execute from the scripts
directory while the require_once caused incl.php to also execute from the
scripts directory.

How does php determine what the working directory is?



I believe it's the directory of the original script. So if you had:

require_once('scripts/foo.php');

...in orig.php, that would be correct.

--
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] Scrambling a word

2008-07-05 Thread Richard Heyes

Is there a way to output the results with a space between each
character?

$shuffled = str_shuffle($str);


From memory:

$shuffled = implode(' ', explode('', $shuffled));

--
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] Scrambling a word

2008-07-05 Thread Richard Heyes
Using an empty delimeter with explode leads to a php warning. At least 
in the php versions i worked with. Still there is a similar function:


?php
var_dump(chunk_split('test', 1, ' '));


Odd. Don't know where that idea came from then.

--
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] Asynchronous PHP Execution

2008-07-05 Thread Richard Heyes

 and exec/shell (but that

doesn't seem to be asynchronous), but neither seems optimal.


It can be if you redirect the output streams and put an ampersand after it:

?php
exec('sleep 5  /dev/null 2/dev/null ');
echo 'Script ended';
?

This tiny sample should end immediately, and the sleep command should 
run on regardless.


--
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] Asynchronous PHP Execution

2008-07-05 Thread Richard Heyes

Also:

exec('sleep 5  /dev/null ');

Maybe?


Two ampersands you mean? Why - what does it do? You're also not 
redirecting STDERR.


--
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] PHPExcel

2008-07-03 Thread Richard Heyes

Happy 4th of July!


How did you know it was my sisters birthday today? Been an exciting
week, first Canada's birthday was on Monday, now my sister's birthday
today. What a thrill ride.


Isn't it the 3rd?

--
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] PHPExcel

2008-07-03 Thread Richard Heyes

But this isn't a day of celebration for you guys, Richard, to be sure.


Depends how you look at it. My passing out parade (Navy not booze) was 
on the 4th July.



Do you all just ignore the day, or do you hold some kind of
anti-celebration?


Well for me personally it's just another day. Can't speak for the rest 
of the populace.


--
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] PHPExcel

2008-07-03 Thread Richard Heyes

*doh* I took for granted someone else had the date right... I rarely
know what day it is :)


It's not often I know what day it is... :-)

--
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] PHPExcel

2008-07-03 Thread Richard Heyes

Richard Heyes wrote:

*doh* I took for granted someone else had the date right... I rarely
know what day it is :)


It's not often I know what day it is... :-)


Oops, sorry, I read your message wrong.

--
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 array problem

2008-07-01 Thread Richard Heyes

Brian Dunning wrote:

I'm trying to add a number to a value in an array. Pretend I have this:

$new_value = array('orange', 2);
$arr = array(
array('blue', 4),
array('orange', 5),
array('green', 6));

I want to add the new value to the existing matching array element, so I 
end up with this:


$arr = array(
array('blue', 4),
array('orange', 7),
array('green', 6));

Seems like it should be really simple but all the ways I can figure out 
to do it are too kludgey.


It's rather easy:

for ($i=0; $icount($arr); $i++) {
if ($arr[$i][0] == $new_array[0]) {
$arr[$i][1] += $new_array[1];
break; // Optional - means the first orange found will be
   // updated only
}
}

--
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 array problem

2008-07-01 Thread Richard Heyes

Small correction:


Which is...?

--
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 array problem

2008-07-01 Thread Richard Heyes

You missed it a second time?  :-)


My sight is awful - if you don't point it out, chances are I won't see it.

--
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] Encription

2008-06-30 Thread Richard Heyes

 my host hasn't installed the Pear::Crypt_GPG package?

(actually, it hasn't installed Pear at all).


You can just go to the pear (http://pear.php.net) website and cut/paste 
the code (using the same directory structure). There's no requirement to 
use the PEAR installer (in fact I don't and never have).


--
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



[PHP] Another instance of shameless self promotion

2008-06-28 Thread Richard Heyes

This time its a line chart:

http://www.phpguru.org/line/test.html

BTW Is anyone else dumbfounded at the inability of the CANVAS tag to 
render text natively? A gross oversight IMO.


--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with login

2008-06-27 Thread Richard Heyes

if (isset($_COOKIE[auth])  !isset($_GET[page]))
{
include($GLOBALS['admin_index']);
die();
}


Your script is awfully insecure. $_COOKIE is user supplied, so in if I 
hand craft a request, I could just send an auth cookie which is set to 
1. Relying on people not knowing is not good, especially as you've just 
posted you authentictaion method to the world.


At the very least switch to storing the fact that the user is authed to 
the session.


Eg:

if (!empty($_SESSION[auth])  empty($_GET[page])) {
include($GLOBALS['admin_index']);
die();
}

--
Richard Heyes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP4 vs PHP5 Memcache compatibility issue

2008-06-26 Thread Richard Heyes

Bob Fisher wrote:

I am running a hybrid environment.

Box A: PHP 4.3.9

Box B: PHP 5.1.6

Box C: Memcached 1.2.2

When I set a key in memcache(Box C) from Box A, I am unable to read
it from Box B and vice versa.

I did not see any such issues mentioned in the PHP documentation.

Has anyone seen something similar? Does anyone know how to get over this?


There's some nice RPC code (well I think it's nice anyhoo) on my website:

http://www.phpguru.org/downloads/RPC_for_PHP5/

It's for PHP5 but you might be able to adapt (if you even need to) to 
work with PHP4.


--
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] Another canvas example

2008-06-23 Thread Richard Heyes

Pretty sweet! My only problem with it is that I had to use the keyboard
to get to the Attach button, since I couldn't click on it with it
being behind the pie chart in the page's Z-order.


Yes, no way around (I think). Even with the buttons z-index set to 99 it 
still shows up behind the beachball.


TAB and the spacebar are your friends I guess... :-)

--
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] Another canvas example

2008-06-22 Thread Richard Heyes

Hi,


You gonna post the source code? ;)


Already have, like all Javascript, it's clientside. The direct URL is:

http://www.phpguru.org/pie/pie.js

There's also the ExCanvas library, but that's public anyway.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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



[PHP] Another canvas example

2008-06-21 Thread Richard Heyes

Hi,

Latest in my new series of look at me, aren't I cool canvas examples 
is here:


http://www.phpguru.org/pie/pie.html

Works in IE7 too. And Opera. Ooh.

--
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] Another canvas example

2008-06-21 Thread Richard Heyes

 it's a beach ball cursor.

Lol. A didn't see it like that, but now you've mentioned it, it's kinda 
stuck and that's all I can see now. :-)


--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Please stop me from tearing my hair out.

2008-06-19 Thread Richard Heyes

Byron wrote:

Right. I'm getting this error from the following code : *Parse error*:
syntax error, unexpected '}' in *C:\wamp\www\achillesweb2\install.php* on
line *39
*and I can figure there's probably a bunch of others. If anyone wouldn't
mind giving this a read over that'd be really helpful. Feel free to chip in
with any glaring obvious suggestions and points of interest you'd like to
raise, I probably need the help. Thanks in advance.*


Line thirty eight is missing the end of line semi-colon.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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



[Fwd: Re: [PHP] Please stop me from tearing my hair out.]

2008-06-19 Thread Richard Heyes

Fowarded message.

--
Richard Heyes
---BeginMessage---
now it says this? *Parse error*: syntax error, unexpected '=', expecting ','
or ';' in *C:\wamp\www\achillesweb2\functions.php* on line *14
?.?
*
On Thu, Jun 19, 2008 at 10:45 PM, Byron [EMAIL PROTECTED] wrote:

 okay, so i got static and global mixed up? Thanks.


 On Thu, Jun 19, 2008 at 10:44 PM, Richard Heyes [EMAIL PROTECTED]
 wrote:

 Byron wrote:

 right.

 Now I'm getting the following errors after doing a semi-colon triple
 check.

 *Warning*: mysql_select_db(): supplied argument is not a valid MySQL-Link
 resource in *C:\wamp\www\achillesweb2\functions.php* on line *48*


 $con Is not accessible (because you're in a function when you create it).
 ie. When you create it (ie when you connect to MySQL) you could stick it in
 the global scope. ie In your connection function, make this the first
 statement:

 global $con;

 Then you can do the same in other functions, or alternatively you can
 access it like so:

 $GLOBALS['con']



 --
 Richard Heyes

Employ me:
 http://www.phpguru.org/cv

 ++
 | Access SSH with a Windows mapped drive |
 |http://www.phpguru.org/sftpdrive|
 ++




 --
 I'm going out to find myself, if you see me here, keep me here untill I can
 catch up

 If I haven't said so already,

 Thanks
 Byron




-- 
I'm going out to find myself, if you see me here, keep me here untill I can
catch up

If I haven't said so already,

Thanks
Byron
---End Message---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] climb up the path

2008-06-18 Thread Richard Heyes


i need a way to get the path to the parent folder of the folder i am in. 
one dirty way i found is this -


require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR .
 ..  . DIRECTORY_SEPARATOR .
 config.php);

i can also explode() and reassemble all folders except the last, but 
this looks also dirty...


is there a direct way?


There's nothing dirty about dirname(), and for your issue, just call it 
twice:


dirname(dirname(__FILE__));

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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



[PHP] A somewhaat better example of CANVAS

2008-06-17 Thread Richard Heyes
Again, FF only. This is a somewhat better example of what can be done 
with CANVAS. Not quite on par with what some have shown, but hey I only 
started yesterday... :-)


http://www.phpguru.org/graph/graph.html

The bars maybe a few pixels off, but really, who cares?

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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: Search like php.net's URL thingy

2008-06-17 Thread Richard Heyes

It's *WRONG*.


So are vegetables. Long live the waffle!

BTW, anyone seen this:

http://code.google.com/apis/chart/ ...?

More to the point, is anyone using it commercially?

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Canvas examples

2008-06-16 Thread Richard Heyes

I thought it was pretty cool too - I didn't know about canvas, but
your example says a lot, I think. 


But when you compare it to something like this:

http://ejohn.org/apps/processing.js/examples/custom/molten.html

it looks pretty basic (which it is). Mine is perhaps an intro, whereas 
this illustrates what can be done with some (a lot?) of work.


--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] UK PHP Host/Developer Required

2008-06-16 Thread Richard Heyes

Out of hours technical support often gets billed at a punitive rate.
Which is a bugger if their out of hours is your working day.




It seems you haven't tried Rackspace (UK) yet.


What do you mean? Personally I've had good experiences with Rackspace.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Canvas examples

2008-06-16 Thread Richard Heyes
I guess the other browser doesn't do much with canvas ? 


Nope. Eg:

canvas id=foo
This gets shown on none supporting browsers, but not on supportive
browsers.
/canvas

MSIE just shows the text and doesn't do anything with the canvas.

One thing about using a canvas is bandwidth. If it's a big concern I 
would hazard a guess that a bar chart (for example) would cost less in 
terms of code required to build the image compared to JPGraph, and also 
less in terms of output (particularly if you were to use output 
compression).


--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Strategy to protect images

2008-06-15 Thread Richard Heyes

But, a sophisticated user will find a way around that.


A less sophisticated one will use the PrintScr key... :-)

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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



[PHP] Canvas examples

2008-06-15 Thread Richard Heyes
Does anyone have any more examples of the new canvas element they've 
written?


FF only: http://www.phpguru.org/canvas.html

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Canvas examples

2008-06-15 Thread Richard Heyes

That's very cool, Richard.


Well, thanks, but I wouldn't call it very cool. Now a graphing library 
that output the results using a canvas, thus negating the need for 
JPGraph would definitely be nice.


Or you could just use JPGraph and get to the pub earlier... :-)

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Canvas examples

2008-06-15 Thread Richard Heyes

This is a pretty interesting use of Canvas as well.  Thanks for sharing!

http://ejohn.org/blog/processingjs/


This is very nice.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Strategy to protect images

2008-06-15 Thread Richard Heyes

Must be a windozes thing.  :-)


I guess so. PrintScr takes a snapshot of the current screen, ie a 
screenshot and places it on the clipboard. Then you simply paste into 
something like Paint and save it.


--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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: HTML 5

2008-06-13 Thread Richard Heyes

i suppose i put too much faith in the right hand nav on the w3cschools site
=/


http://www.w3.org/ is the site to use for up to date standards.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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: HTML 5

2008-06-13 Thread Richard Heyes

Well that is a bit ironic as just the other day you said you didn't
care about standards[1] as far as redirects were concerned.  :P

[1] http://www.mail-archive.com/php-general@lists.php.net/msg228512.html


Note the smileys... :-)

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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



[PHP] HTML 5

2008-06-12 Thread Richard Heyes

This may be of interest (HTML 5 diffences to HTML 4 overview):

http://www.w3.org/TR/2008/WD-html5-diff-20080610/

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] UK PHP Host/Developer Required OT

2008-06-12 Thread Richard Heyes

We are looking for someone to develop  host a PHP site in the UK.


For sake of discussion -- why would one want to be specific about 
hosting in the UK? Why not just hosting, regardless of where the host is 
located?


Speed (eg. response time). Technical support hours etc.


After all, hopefully the site will be accessible globally, right?


The site may be only pertinent to a specific locallity. For example I 
used to work for an online film rental firm, who only supplied to the UK.


Are there UK laws that require businesses to be totally self-contain 
within the UK?


Not at all.

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] regular expression to find body text in mobile

2008-06-11 Thread Richard Heyes

Doese any know how to find text in mobile using Regular Expression?
I am using php.


Mobile what?

--
Richard Heyes

Employ me:
http://www.phpguru.org/cv

++
| 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] Class Type Casting

2008-06-10 Thread Richard Heyes

//that's working fine
$test= new string_extended(this is my anonymous string);
echo $test;


/that's not working, but should'nt it be the case ?
$test = (string_extended) This is my anonymous string;
echo $test;

I'll find this very usefull :x, it's just a syntax ehancement nope ?


Can't give you a definite answer but presumably it's not calling the 
constructor when you type cast it. Add a line to your constructor that 
will show if this is the case. Eg:


function __construct($str){
$this-contents=$str;
echo In string_extended constructor...br /\n;
}
--
  Richard Heyes

   In Cambridge or near Liverpool
Street station in London? Employ me

http://www.phpguru.org/cv

++
| 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] Regex in PHP

2008-06-05 Thread Richard Heyes

 sorry to bother you richard.

You didn't, I just wanted to make sure I wasn't losing it (more).

--
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] Regex in PHP

2008-06-04 Thread Richard Heyes

Hi,


and the case insensitive versions are a hair faster still ;)


Are they? I always thought that case-sensitive functions were faster 
because they have to test fewer comparisons. Eg To test if i == I in a 
case-insensitive fashion requires two comparisons (i == I and i == i) 
whereas a case-sensitive comparison requires only one (i == i).


Cheers.

--
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] strlower problem

2008-06-02 Thread Richard Heyes

Ed Curtis wrote:
I'm converting upper case characters in a string to lower case and am 
coming up with an empty string.


As I've done a million times before with other non-numerical strings.

$thisStr = CL22;

$strLow = strtolower($thisStr);

echo $thisStr;

Why does $strLow come up empty?


Because you're echoing out the original (uppercase) string. Try:

echo $strLow;

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Storing £ (pound sterling) sign and displaying in HTML email

2008-06-02 Thread Richard Heyes

Graham Cossey wrote:

Could someone please point me in the right direction here please?

I have a form textarea field (submitted using POST) that accepts free
text that will include the likes of '£' (pound sterling symbol) that
is written to a MySql database and later retrieved to output into an
HTML email.

I have been experimenting with htmlentities, htmlspecialchars and
addslashes but still have the problem whereby I get ACirc;
preceeding the pound;

Could someone kindly suggest what I'm doing wrong and what function(s)
I should be looking into?


You could just store the amount numerically (and optionally the currency 
if need be) and just put the pound; in your HTML file.


--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] ecommerce data sharing?

2008-06-01 Thread Richard Heyes
Does anyone know of a project for sharing ecommerce related data? Such 
as abstracted order histories so that tables of related items can be 
built for recommending items?


Sounds like a huge privacy can of worms and worm related matter.

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Reloading changes JS files?

2008-05-29 Thread Richard Heyes

img src='/image/bulk.jpg?112344324' /

anything after the question mark will get ignored by the browser. Except 
that the browser will think that it is a new URL that it has never seen 
before and it will call to the server for a fresh copy of the file.


Another options is instead of a question mark use a forward slash. This 
may be Apache specific though. Eg.


img src='/image/bulk.jpg/112344324' /

ISTR question marks are not search engine friendly, so for pages this 
may be a preferred option.


--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Escaping JavaScript strings

2008-05-29 Thread Richard Heyes

 ...

This is a PHP function that escapes strings so you can output them as a 
JS string. IIRC it assumes you're using single quotes to enclose your 
strings.


/**
* Function to appropriately escape a string so it can be output
* into javascript code.
*
* @param  string $string Input string to escape
* @return string Escaped string
*/
function escapeString($string)
{
$js_escape = array(\r = '\r',
   \n = '\n',
   \t = '\t',
   '  = \\',
   '\\' = '');

return strtr($string, $js_escape);
}

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Reloading changes JS files?

2008-05-29 Thread Richard Heyes

When you do an explicit refresh or reload in your browser, it should
ignore whatever it's got cached and refetch your javascript files
regardless. 


With Interweb Explorer you need to hold down CTRL and CLICK on refresh 
(as opposed to pressing CTRL+R say) to get a fresh copy. I guess it 
depends on the headers you send on the page. Doing this will send a:


Cache-Control: no-cache

request header.

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Embed images in emails

2008-05-29 Thread Richard Heyes

You'll need to create a HTML email, and then embed the image with the
img tag, using the entire path to the image as the source attribute


Not necessarily, images may simply be sent as an attachment with
type image/jpeg etc.

/Per Jessen, Zürich



I haven't done it in a while but I believe you need a multipart mime 
email with:


Content-Type: image/jpeg
Content-Disposition: inline

unless you want it to be a separate attachment.


This may help:

http://www.phpguru.org/static/htmlMimeMail5.html

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] 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; but; am having trouble getting it to recognize the error.


Can anyone help me with this?


You could use your own version of RFC822.php and use the wonderful 
search and replace. Don't worry about updates, Mail_RFC822 is quite 
stable, and has been for some years.


--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Help preg_replace with Non-English character

2008-05-22 Thread Richard Heyes

Just a question, I want to replace some Chinese characters with
preg_replace().

But it does not work.

The string is

$str = 'test你好http://www.phparch.cn/ 完成';

The ideal output is :
testa href=http://www.phparch.cn;你好/a 完成

Any suggestion will be greatly appreciated.


Have a look to see if the mb_* functions will help.

http://uk3.php.net/manual/en/book.mbstring.php


--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Help Call Javascript Methods Inside PHP

2008-05-20 Thread Richard Heyes

Shelley wrote:

Hi all,

How can I call a javascript method inside PHP?
That is:
Suppose there is a js file: http://someurl/somejs.js
There are some js methods in that js file,
I want to include that js into PHP and call its methods.

Is it possible?


No.


What you can do though is use PHP to send some HTML to the browser which 
calls Javascript methods.


--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] reretrieve header from email

2008-05-20 Thread Richard Heyes

Yui Hiroaki wrote:

Does anyone knows how to retrieve Header from email?


Depends how you have your email. For example you could use 
Mail_mimeDecode, optionally in combination with Net_POP3. If it's an 
IMAP account you're checking, you could use the IMAP extension instead, 
which would also mean you probably won't need Mail_mimeDecode.


--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Enterprise

2008-05-20 Thread Richard Heyes

Ray Hauge wrote:
I just read an interesting article about enterprise software.  One of 
the most common arguments against PHP tends to be It's not enterprise 
ready.  This article talks more about ruby, but it could be about any 
non-enterprise language as well.


http://lists.canonical.org/pipermail/kragen-tol/2005-April/000772.html

I recently got a new job at a hospital, and the enterprise software 
they have is no where near as high quality as it could/should be.  This 
is my first job at a somewhat large organization (500+ employees) so I 
was kind of shocked at the state of their software.  Typically 
healthcare systems are further behind in the technology adoption, but 
having to deal with workarounds all day long sure gets old.


Seems like PHP is already in the enterprise:

http://www.phpguru.org/article/14

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] php mysql live feed

2008-05-20 Thread Richard Heyes

[EMAIL PROTECTED] wrote:

Okay before i pull more hair out...

I am trying to use php to pull mysql data and refresh the mysql data
every say 5 seconds for like a live display of the database without
the screen reloading.

I want the data to refresh but not the screen. Ajax seems to hate me
because everything i have seen/read/tried is wrapped around ASP.NET
or requires a user interaction to invoke the query.

If you have example scripts or a good tutorial that actually works
where you can open a php script and the data changes on the page as
the database does and the screen does not refresh, and you don’t have
to onclick, onfocus, or onblur kind of thing. I would be in your debt


You can use setTimeout() to delay a call to a Jabbascript function. 
Remember that the second argument is milliseconds, and not seconds. Eg.


setTimeout('alert(Hello)', 1000);

--
  Richard Heyes

 In Cambridge? Employ me
http://www.phpguru.org/cv

++
| 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] Improving development process / help with developer setup

2008-05-19 Thread Richard Heyes

Thanks for all answers.   Please let me add that I do use CVS (migrating to
 SVN) and the reason to use samba is that doing this allows the developer
machine (windows) to access the shares hosted in a linux server so when
he/she tests it will be run in the 'same' environment that the staging and
production servers and because in order to assure browser compatibility they
have to test from firefox/IE.


If you only have a small number of developers, you could do away with 
Samba completely and use SftpDrive, which allows you to map a drive to 
an SFTP account (essentially the same as an SSH account).


http://www.phpguru.org/sftpdrive

--
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] Improving development process / help with developer setup

2008-05-19 Thread Richard Heyes
Or depending on your budget, Switch the developers to Macintosh 
computers, install windows via parallels, and then you can test in 
Mac/Unix/Windows all from 1 computer :)


And watch everyone quit... :-)

--
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] Semi-OT: PHP Login with client security

2008-05-19 Thread Richard Heyes

You should _always_ use an absolute URL in a redirect.  I know it quite
often works with a relative too.


Why?

--
  Richard Heyes

Employ me
http://www.phpguru.org/cv

++
| 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] Semi-OT: PHP Login with client security

2008-05-19 Thread Richard Heyes

Because it is RFC.


Since when has that mattered? :-)

--
  Richard Heyes

Employ me
http://www.phpguru.org/cv

++
| 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] Semi-OT: PHP Login with client security

2008-05-19 Thread Richard Heyes

Robert Cummings wrote:

On Mon, 2008-05-19 at 21:03 +0100, Richard Heyes wrote:

Because it is RFC.

Since when has that mattered? :-)


Always... unless you're one of the ignorant masses ;)


Whatever works... :-)

--
  Richard Heyes

Employ me
http://www.phpguru.org/cv

++
| 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] String searching

2008-05-17 Thread Richard Heyes

Chris W wrote:

I need to find the position of the first character in the string
(searching from the end) that is not one of the characters in a set.  In
this case the set is [0-9a-zA-z-_]

I guess to be even more specific, I want to split a string into to parts
the first part can contain anything and the second part must be only in
the set described above.

What is the easiest way to do this?



There's something here, imaginatively called blah(), which does what you 
require:


http://www.phpguru.org/preg/example.phps

--
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] Threads PHP

2008-05-16 Thread Richard Heyes

Check out: http://pecl.php.net/package/threads

That might help you out.



 Summary: experimental implementation of threads

The word experimental makes me shudder. If you can (ie you're using 
*nix), you could also investigate the pcntl extension - http://php.net/pcntl


--
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] validating textarea using php

2008-05-14 Thread Richard Heyes

A lot of people think that


Can't fault them.

 until their host upgrades php.

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 don't do that and they're pants (IMO).


Plus you need to consider how long they would take to use PHP6 
exclusively - my guess it would be at least a year; probably longer.


 Have you

seen how many things are being removed for php6?


Nope. Why? It's not even out yet in beta and therefore not worth my time 
considering. ISTR having read something about a 5.3 release, which I 
read would have namespaces. That needs consideration before any PHP6 
release.


--
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



<    1   2   3   4   5   6   7   8   9   >