Re: [PHP] ASCII Captcha

2008-09-14 Thread Kevin Waterson
This one time, at band camp, tedd [EMAIL PROTECTED] wrote:

 I fixed the errors you spoke about except I could never get the 
 Graphic CAPTCHA to fail.
 
 Also, you're supposed to click the accessibility icon to get the 
 page to speak the number.

What if the user is deaf and blind? they are denied access?

Kevin

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



Re: [PHP] php image and javascript include

2008-09-14 Thread Børge Holen
On Saturday 13 September 2008 23:35:47 Ashley Sheridan wrote:
 On Sat, 2008-09-13 at 23:24 +0200, Børge Holen wrote:
  On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
   I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
   text editor, not a GUI, I just guess I prefer Kate. I know for certain
   that one thing that really bugs me about Dreamweaver is the fact that
   it has a tendency to really nerf up the spacing, and it replaces tabs
   with spaces more often than not. It's all about the tabs to space
   things out, adding spaces just makes the files bigger!
 
  Oh, thats just how you set up DW, options on indentations is througoutly
  documented inside the preferences pane and quite a few options to go,
  only thing that is wrong with it is the way it can't handle large
  projects, say like more than 100 files. nevermind the filesize...
 
   Ash
   www.ashleysheridan.co.uk
 
  --
  ---
  Børge Holen
  http://www.arivene.net

 I've worked on projects like that before, but never considered DW, I
 used Notepad++ instead, as I was forced to use Windows at work at the
 time. I never really had any reason to try to open all the files at once
 though... ;)

Thats not what I was talking abount either,The tree view of project files 
cannot handle many files before the waiting gets annoying



 Ash
 www.ashleysheridan.co.uk



-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] 2 Questions.

2008-09-14 Thread Ashley Sheridan
On Sun, 2008-09-14 at 03:42 +0200, Jochem Maas wrote:

 Yo Dan,
 
 your back! guess the honeymoon is well and truly over then ;-)
 
 Daniel Brown schreef:
  On Sat, Sep 13, 2008 at 8:14 PM, tedd [EMAIL PROTECTED] wrote:
  While you might think an order number should be something else, keep in 
  mind
  that an order is simply an order. It is a point in time where a customer 
  has
  agreed to purchase something and you have accepted and have cleared that
  purchase for that payment through some sort of purchasing scheme.
  
  One of the best schemes for developing a unique order number that
  is not only unique to the system, but is also readily human-readable
  would be to use an auto_increment value appended to a date string.
  For example:
  
  ?php
  
  $today = date(Ymd);
  
  $increment = $numberFromDB; // This routine would depend on your
  database (MySQL, PostgreSQL, etc.)
  
  $orderNumber = $today.-.$increment;
  
  ?
  
  From the above, you'd get an order number similar to 20080913-1048.
  
  This means that it's not only unique, regardless of how many
  orders come through in the same second, but ordering by time and date
  is easier, and on paper, you can easily tell when an order was placed.
 
 a handy trick, I would suggest this belong in the display layer of the
 app not in the DB. I was originally taught DB stuff from someone who was hot
 in FoxPro in the 80's ... back then it was normal to encode all sorts of info
 into unique identifiers (much like the way you describe) for the simple 
 reasons
 of lack of disk space, cpu power and screen space ... these days
 best practice is generally accepted to be that a unique identifier is purely
 that and no more ... adding 'cruft' to a UID pollutes it and I would hazard to
 call it data-bastardization[tm] ... the date can (and should) be stored as
 a seperate field, output from the DB can always be displayed as you described.
 
 
 

I think I see what your problem is. Basically, you've set the tables up
in the wrong way. Every order system I've used has one table for the
orders, one for the customers, and one for the items attached to an
order. This makes management a lot easier, and you get to use those
auto_increment values you so need. From what you've been saying I'm
guessing this is a custom built system, so hopefully it shouldn't be too
hard to change now if it's not finished. If it's something you have
purchased to use... well, I'd look for something else...


Ash
www.ashleysheridan.co.uk


Re: [PHP] php image and javascript include

2008-09-14 Thread Ashley Sheridan
On Sun, 2008-09-14 at 10:23 +0200, Børge Holen wrote:
 On Saturday 13 September 2008 23:35:47 Ashley Sheridan wrote:
  On Sat, 2008-09-13 at 23:24 +0200, Børge Holen wrote:
   On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
text editor, not a GUI, I just guess I prefer Kate. I know for certain
that one thing that really bugs me about Dreamweaver is the fact that
it has a tendency to really nerf up the spacing, and it replaces tabs
with spaces more often than not. It's all about the tabs to space
things out, adding spaces just makes the files bigger!
  
   Oh, thats just how you set up DW, options on indentations is througoutly
   documented inside the preferences pane and quite a few options to go,
   only thing that is wrong with it is the way it can't handle large
   projects, say like more than 100 files. nevermind the filesize...
  
Ash
www.ashleysheridan.co.uk
  
   --
   ---
   Børge Holen
   http://www.arivene.net
 
  I've worked on projects like that before, but never considered DW, I
  used Notepad++ instead, as I was forced to use Windows at work at the
  time. I never really had any reason to try to open all the files at once
  though... ;)
 
 Thats not what I was talking abount either,The tree view of project files 
 cannot handle many files before the waiting gets annoying
 
 
 
  Ash
  www.ashleysheridan.co.uk
 
 
 
 -- 
 ---
 Børge Holen
 http://www.arivene.net
 
Tree view of a project, now there's an idea. Of course, real programmers
keep it all in their heads... Nah, I guess I've just not worked on
anything complex enough that I've needed the tree view yet. Mind you,
this new project I've been assigned to could well be going that way.
It's a mess of a system written in C# and it keeps crashing regularly to
boot. Somewhere along the line I think a sadist got involved in the
project, because it's really painful to work with sometimes...


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] 2 Questions.

2008-09-14 Thread Jochem Maas

Tom Shaw schreef:

-Original Message-
From: Tom Shaw [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 13, 2008 9:52 PM

To: 'Jochem Maas'
Subject: RE: [PHP] 2 Questions.

iamjochem wrote:


My second question is I've designed a very simple Postgres database

wrapper.

The methods are exactly what you would assume to see in any db wrapper a
pg_query, pg_fetch_array. My question is in the db wrapper, is there an

easy

way to always include the table name as an index in all my pg_fetch_array
returned results? The reason I ask is when designing my tables I'm

delegated

to prefixing my column names i.e. users_name instead of just name or
forum_posts instead of just posts to make sure there's no collision.  


have your simple wrapper do something like:

$sql = SELECT foo AS {$tablename}_foo FROM {$tablename} WHERE 1;

with regard to generating the query. if your wrapper doesn't generate the
SQL then you'll have to parse the given SQL and rewrite it ... good luck
with that.


I'm not sure if my wrapper is a good place for the sql but I bet it's worth
investigating further. I like the web site iamjokem. Im not sure if that's a
jokem too but I couldn't figure it out... 


it's jochem not jokem, so technically there's no joke. but you could say the 
'site'
is my answer to the social grid. or maybe a reaction to all the twitter like 
nonsense,
or maybe just the fact that everyone seems to think the answer is out there,
when really the only answer is 'in here'

take the red pill/door. it's the only choice ;-)

..

generating SQL is pretty easy, give a function a list of fields as an array and 
a
table name (you can then build the function out to include order by and where 
clause
generation. here is a very simple concept function (I wouldn't bother using it
as is):

function genSQL($fields, $table, $where, $order)
{
$fnames = array();
foreach ($fields as $f)
$fnames[] = $tablename.'_'.$f;

return 'SELECT '.join(', ', $fnames). FROM $tablename $where $order;
}



I should have mentioned that I use a *normalized* database wharehousing
pattern where each row represents a distinct item being purchased. There
could be fifty rows corresponding to a single order transaction like what
you would see in something like an itunes music purchase. So using the

auto

increment id would not work to differentiate between orders. Another user
mentioned microtime.


whoa, race car hey? let's have a race.

normalized smormalized. every order related system I've looked at, built or
worked with made a clear distinction between an **order** and an
**orderline**,
all you seem to have is an order line ... who do they belong to? are you
replicating the customer details and shipping address in each row? (if so
I hardly call that normalized)

use generators or sequences or 'auto increment ids' or whatever your DB
calls
it, dump the timestamp/microtime nonsense, and rework you DB schema to
incorporate order **and** orderline entities ... and use a required foreign
key
in each orderline to reference the relevant order.

with regard to iTunes store, steve jobs can go shove it ... but I'll wadger
my soul that the guys that built it know the difference between an order
and an order line and that they use both concepts.


so you understand your DB model was wrong/incomplete? and that timestamps
of any granularity should not be used as UIDs?

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



Re: [PHP] ASCII Captcha

2008-09-14 Thread tedd

At 5:37 PM +1000 9/14/08, Kevin Waterson wrote:

This one time, at band camp, tedd [EMAIL PROTECTED] wrote:
  Also, you're supposed to click the accessibility icon to get the

 page to speak the number.


What if the user is deaf and blind? they are denied access?

Kevin


Kevin:

For deaf-blind users there are refresh-able braille displays to read 
the computer screen.  These braille displays are driven by JAWS and 
other screen readers (each requiring braille displays drivers).


The braille displaying devices do text-to-braille translations; the 
speech synthesizers do text-to-speech translations; while the screen 
readers' job is to convert what they 'see' or read on the screen into 
text or meaningful output to the HID for the human user.


While this may sound simple, there are other problems, namely 
refresh-able braille displays cost a minimum of $1500 US and, 
unfortunately, braille is not universal among all of the adult blind
population (which would also include deaf-blind users and adult onset 
deaf-blind users).


As for my example (as shown below), the Speak Key submit button 
works for the blind testers who have tested this for me. While they 
have no problem with the way I've done it, none are deaf.


http://www.sperling.com/examples/captcha

It would be nice if I could get a good female voice, preferably 
Asian, who would submit her speech for free distribution. All she 
need do is to speak the numbers one though ten and repeat with 
pauses between words.


Why Asian? As it turns out a female Asian voice works extremely well 
for English speech recognition. I am sure that other languages have 
their preferences.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



RE: [PHP] 2 Questions.

2008-09-14 Thread Tom Shaw
That's cool thanks. I agree with you too it's mankind's folly. But regarding
the db question, I got the idea from CakePHP which solves the problem of
having to prefix your columns ie user_name etc etc. I think you can use
another built in php database function num_fields() and hook into the meta
data and then you would have to manually build the information into array.
I'm not sure but I'm going to hack around with it a little and see what
happens.

Thanks Thomas

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 14, 2008 4:50 AM
To: Tom Shaw
Cc: 'PHP General'
Subject: Re: [PHP] 2 Questions.

Tom Shaw schreef:
 -Original Message-
 From: Tom Shaw [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, September 13, 2008 9:52 PM
 To: 'Jochem Maas'
 Subject: RE: [PHP] 2 Questions.
 
 iamjochem wrote:
 
 My second question is I've designed a very simple Postgres database
 wrapper.
 The methods are exactly what you would assume to see in any db wrapper a
 pg_query, pg_fetch_array. My question is in the db wrapper, is there an
 easy
 way to always include the table name as an index in all my
pg_fetch_array
 returned results? The reason I ask is when designing my tables I'm
 delegated
 to prefixing my column names i.e. users_name instead of just name or
 forum_posts instead of just posts to make sure there's no collision.  

 have your simple wrapper do something like:

 $sql = SELECT foo AS {$tablename}_foo FROM {$tablename} WHERE 1;

 with regard to generating the query. if your wrapper doesn't generate the
 SQL then you'll have to parse the given SQL and rewrite it ... good luck
 with that.
 
 I'm not sure if my wrapper is a good place for the sql but I bet it's
worth
 investigating further. I like the web site iamjokem. Im not sure if that's
a
 jokem too but I couldn't figure it out... 

it's jochem not jokem, so technically there's no joke. but you could say the
'site'
is my answer to the social grid. or maybe a reaction to all the twitter like
nonsense,
or maybe just the fact that everyone seems to think the answer is out there,
when really the only answer is 'in here'

take the red pill/door. it's the only choice ;-)

..

generating SQL is pretty easy, give a function a list of fields as an array
and a
table name (you can then build the function out to include order by and
where clause
generation. here is a very simple concept function (I wouldn't bother using
it
as is):

function genSQL($fields, $table, $where, $order)
{
$fnames = array();
foreach ($fields as $f)
$fnames[] = $tablename.'_'.$f;

return 'SELECT '.join(', ', $fnames). FROM $tablename $where
$order;
}


 I should have mentioned that I use a *normalized* database wharehousing
 pattern where each row represents a distinct item being purchased. There
 could be fifty rows corresponding to a single order transaction like what
 you would see in something like an itunes music purchase. So using the
 auto
 increment id would not work to differentiate between orders. Another user
 mentioned microtime.
 
 whoa, race car hey? let's have a race.
 
 normalized smormalized. every order related system I've looked at, built
or
 worked with made a clear distinction between an **order** and an
 **orderline**,
 all you seem to have is an order line ... who do they belong to? are you
 replicating the customer details and shipping address in each row? (if so
 I hardly call that normalized)
 
 use generators or sequences or 'auto increment ids' or whatever your DB
 calls
 it, dump the timestamp/microtime nonsense, and rework you DB schema to
 incorporate order **and** orderline entities ... and use a required
foreign
 key
 in each orderline to reference the relevant order.
 
 with regard to iTunes store, steve jobs can go shove it ... but I'll
wadger
 my soul that the guys that built it know the difference between an order
 and an order line and that they use both concepts.
 
so you understand your DB model was wrong/incomplete? and that timestamps
of any granularity should not be used as UIDs?

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


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



Re: [PHP] localization folder for web site

2008-09-14 Thread Alain R.



Jochem Maas wrote:

Alain R. schreef:

Hi,

mostly (90%) websites are designed to include localization (made in 
php) folder like following:

www.mywebsite.com/en/
www.mywebsite.com/de/
www.mywebsite.com/fr/

why do they not use only 1 folder and use dynamically PHP to change 
localization of website ?


who says the 'folders' (directories) en, de, fr et al actually exist?


has this something to do with search engine rating ?


amongst other things, it's also a way of passing along the
requested translation with requiring cookies


thanks a lot,
Al.




sorry but i miss the point here...
if we have http://ww.mywebsite.com/en/index.php, you mean that in fact 
it can be http://ww.mywebsite.com/index.php?lang=en.
but in this case why and how is it possible to see 
http://ww.mywebsite.com/en/index.php in the adress bar of my browser ?

i mean if i do not have access to apache :-)

thx.

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



Re: [PHP] localization folder for web site

2008-09-14 Thread Stut

On 14 Sep 2008, at 17:47, Alain R. wrote:

Jochem Maas wrote:

Alain R. schreef:

Hi,

mostly (90%) websites are designed to include localization (made  
in php) folder like following:

www.mywebsite.com/en/
www.mywebsite.com/de/
www.mywebsite.com/fr/

why do they not use only 1 folder and use dynamically PHP to  
change localization of website ?

who says the 'folders' (directories) en, de, fr et al actually exist?

has this something to do with search engine rating ?

amongst other things, it's also a way of passing along the
requested translation with requiring cookies

thanks a lot,
Al.


sorry but i miss the point here...
if we have http://ww.mywebsite.com/en/index.php, you mean that in  
fact it can be http://ww.mywebsite.com/index.php?lang=en.
but in this case why and how is it possible to see http://ww.mywebsite.com/en/index.php 
 in the adress bar of my browser ?

i mean if i do not have access to apache :-)


You need to find out if your host has mod_rewrite installed and allows  
it to be overridden in .htaccess. If it can then that's how you can do  
it. If not then I suggest you find another host because the one you're  
with clearly doesn't match your requirements.


Bottom line is that this really isn't hard. Please Google mod_rewrite  
to understand what it does and how it works. There is no browser  
involvement whatsoever.


-Stut

--
http://stut.net/

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



http://www.huffingtonpost.com/2008/09/12/obama-camp-lets-rip-on-mc_n_125955.html

2008-09-14 Thread Fritz_da_Cat

I am not surprised by this really. Since McCain has voted for  Bush's
policies over 90% of the time, and vows to continue them the only real
answer is he really is divorced from reality.

http://www.huffingtonpost.com/2008/09/12/obama-camp-lets-rip-on-mc_n_125955.html

(excerpt)

The Obama campaign is jumping all over a line from John McCain, in
which the Arizona Republican suggested that time in Washington had
made it easier from him to be out of touch with everyday concerns.

I think John McCain is right about John McCain, said Rep. Rahm
Emanuel, a fellow Chicagoan known for his brass-knuckled politics. He
has been there so long that is why he has voted 90 percent of the time
with George Bush and that why his staff is bogged down by lobbyists
that represent special interests.

McCain's alleged gaffe came Thursday night at Columbia University
during a service forum featuring both candidates.

It's easy for me to go to Washington, said the Senator, and
frankly, be somewhat divorced from tith a PC...

 M$ structure the market in such a way that retailers et al don't have any
 choice in the matter, it's not so much 'nice incentives' as 'take the hint
 it's good for you either that or we'll burn you'

 nonetheless people still buy the PCs. but that's not the point, the point
 is that the concept of choice has been completely warped to the extent that
 people generally believe that being offered 400 different cartons of milk
 equates to freedom ... it's a marketing trick of the highest order ...
 niether freedom nor choice come into it.

 applying such convoluted concepts to linux is actually counter-productive,
 the only real beneficiaries to the linux distro holy-wars are the boys at
 M$. would be interesting to know how much money M$ pump into various
 distros to keep them finghting amongst themselves, I'm guessing that the
 figure is above zero.

M$ fuelling Novell (which owns Suse) and Miguel De Icaza (which leads Gnome 
and Mono). Forget novell and suse. Later or sooner they will going down. 
Nobody like who bed with M$. And Miguel which was the real problem.

Having tons of distros is not real problem and having two major desktop 
enviroment splits your very limited programmer resources to two.

This is real problem. Current lead distro was Ubuntu, and Ubuntu split his 
resources in two (or tree) to support different desktop enviroments.

  It sounds a bit like when Microsoft announced how many people were
  downloading the IE7 browser, when in actual fact it had been forcing it
  on users with the automatic system updates, and was still counting those
  as user requested downloads!

 it's statistically proven that you can prove anything with statistics.


And every bit era change there was chance to change customer habbits. 
Microsoft owns the 16 and 32 bit because there whrere no real alternative.

But now era changes from 32 to 64 bit and Microsoft fails first attempt to 
deliver 64 bit os.

Vista was failure. If jobs makes os.x available for pc's  or Linux find the 
real solutution for multimedia codecs and DRM solutions. Somebody may change 
M$ desktop hegomony.

Other wise, we still arguing M$ browsers compatibilty at 2020 or whatever.

Regards

Sancar Delifisek Saran,

12 years of hard core GNU/Linux Zealot from Turkey.

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