[PHP] Re: Sample

2007-06-11 Thread edk
I have corrected your document.


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

Re: [PHP] Re: Not getting expected result from file()

2007-06-11 Thread Frank Arensmeier
If you are not able to get anything into your DB (and your connection  
is ok), then two things might be wrong: your input or the query  
string itself.


Echo out the query string and try to use the query  
"manually" (directly with a MySQL client). If the query string is ok,  
you might check your MySQL connection settings (var_dump, echo etc).  
If the query string is not ok, you have to look at the input values  
for the query ($regName, $regAddress etc).


//frank


11 jun 2007 kl. 07.27 skrev kvigor:

Trimmed elements in the array.  I still can't get it to store in  
central

table.  No MySQL errors either. :-(
 (Also, all form values are escaped.) Strings compared in if  
condition are

now identical.


newcode
===
theFileArray = file('C:\htdocs\folder1\file.txt');

function trim_value(&$value)
{
$value = trim($value);
}

array_walk($theFileArray, 'trim_value');


if(isset($_POST['strName'], $_POST['strCity'], $_POST['strState']))
{
 $space = " ";
 $stringOne = $_POST['strName']. $space. $_POST['strCity']. $space .
$_POST['strState'];
}

 if(in_array($stringOne, $theFileArray)) // string were identical  
after I

trimmed an did var_dump on $stringOne and $theFileArray[2]
 {
  $queryCentral = "INSERT INTO central (conName, conAddress, conCity,
conState, conZip, conPhone, schName, schAddress, schCity, schState,  
schZip,
strName, strCity, strState) VALUES('$regName', '$regAddress',  
'$regCity',
'$regState', '$regZip', '$regPhone', '$sclName', '$sclAddress',  
'$sclCity',

'$sclState', '$sclZip', '$stoName', '$stoCity', '$stoState')";

  mysql_query($queryCentral, $connection) or die("Query failed: ".
mysql_error($connection));
 }


else
{
$queryUnknown = "INSERT INTO unknown (conName, conAddress, conCity,
conState, conZip, conPhone, schName, schAddress, schCity, schState,  
schZip,
strName, strCity, strState) VALUES('$regName', '$regAddress',  
'$regCity',
'$regState', '$regZip', '$regPhone', '$sclName', '$sclAddress',  
'$sclCity',

'$sclState', '$sclZip', '$stoName', '$stoCity', '$stoState')";
mysql_query($queryUnknown, $connection) or die("Query failed: ".
mysql_error($connection));
}
== 
==

"David Robley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

kvigor wrote:


Hello,

I'm using the file function create an array.  I'm using a value  
from a

form to see if it matches in elements in the array.

My problem is I expect  the condition to be true but info but my  
DB isn't

populated as I in the right DB...
=Code
Begins==
$theFileArray = file('C:\htdocs\folder1\file.txt');



Your problem starts here - file returns the file in an array. Each  
element
of the array corresponds to a line in the file, with the newline  
still
attached. When you compare to a string without the newline at the  
end, the

comparison fails.

If you have php > 5.0.0 you can use the FILE_IGNORE_NEW_LINES flag  
in the
file() arguments, otherwise use trim() to remove trailing  
whitespace from

the array elements.



Cheers
--
David Robley

"I hate playing craps," Tom said dicily.
Today is Boomtime, the 16th day of Confusion in the YOLD 3173.


--
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] Re: Sample

2007-06-11 Thread Frank Arensmeier

Thats nice! Could "correct" mine also? ;-)

//frank

11 jun 2007 kl. 11.01 skrev [EMAIL PROTECTED]:


I have corrected your document.


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



[PHP] Formatting output

2007-06-11 Thread listas
Hello,

I would like to format the output of a PHP page into a single line and use
gzip compression too.

I know that i can use something like this to get in a single line ( will
workout on this function later to remove spaces ).



And gzip compression is used with



Is there a way to "mix" those codes?

Thanks.

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



Re: [PHP] Formatting output

2007-06-11 Thread Stut

[EMAIL PROTECTED] wrote:

I would like to format the output of a PHP page into a single line and use
gzip compression too.

I know that i can use something like this to get in a single line ( will
workout on this function later to remove spaces ).



And gzip compression is used with



Is there a way to "mix" those codes?


Output buffers can be stacked. So simply start the gzip bugger with 
ob_start, then call it again with your handler. The handlers will be 
called in reverse order when the buffers get flushed.


BTW, you don't need to ob_end_flush at the end of a script - this gets 
done automagically when the script ends.


-Stut

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



Re: [PHP] [RFC] HTTP timezone

2007-06-11 Thread Lester Caine

Stefanos Harhalakis wrote:

On Sunday 10 June 2007, Richard Lynch wrote:

On Sat, June 9, 2007 8:06 am, Stefanos Harhalakis wrote:

Timezone: +0200

that will specify their timezone offset. This way scripts will be able
to
provide appropriate date/time strings/representations and/or content.

It's pretty useless and unreliable since user's clocks/timezone
settings are incorrect far too often...


I'm only considering the timezone information. I believe that this is not the 
proper way to think before making a start. The fact that many user's timezone 
is incorrect doesn't mean that this is not needed. Lets just hope that one 
day Windows will do the right thing and keep the time in UTC while displaying 
it using the appropriate timezone.


Timezone information is only of use for the CURRENT day - even if it is wrong. 
It is ESSENTIAL that any changes also include the daylight saving information. 
Since this is not included, all current sites handling event related 
information in real time need to manually log a users PROPER time and daylight 
saving information so that they know if 8AM today is the same as 8AM tomorrow.


If this is not going to actually fix the problem - don't bother wasting time 
on it :)


--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/10/07, tedd <[EMAIL PROTECTED]> wrote:
> >Tedd:
> >
> >Please don't spread the code of your Audio CAPTCHA, we had a big
> >discussion about it, and we concluded that it was quite easy to crack.
> >I remember i've cracked some other CAPTCHAs, but if you still think
> >your Audio CAPTCHA isn't hard to crack, then just let me know and i'll
> >start cracking it :)
> >
> >Dave:
>
> Dave:
>
> The point is not how easy my Audio CAPTCHA is to crack, but rather
> one of accessibility.
>
> If one insist on using a graphic CAPTCHA, which in most cases can be
> cracked, then at least add an Audio CAPTCHA to allow access for the
> visually disabled.
>
> Or, is the point here to allow bots and block the visually disabled
> -- I think not.

Surely not, but what you're doing with adding a weak audio CAPTCHA is
adding more options for a hacker. Since the form can be submitted by
either completing one of both CAPTCHA programs, the hacker can choose
whichever way he likes. So if you have a very very strong Graphic
CAPTCHA, but a very weak Audio CAPTHCA, than it isn't too hard to
crack, as the hacker would only crack the Audio CAPTCHA...

>
> Look at the CAPTCHA's use here:
>
> http://sam.zoy.org/pwntcha/
>
> and their efficiently at blocking bots, which next to nil.
>
> So, if people are going to believe in the false notion that CAPTCHA's
> block bots, then why not provide a way for the visually disabled to
> obtain access as well? Why just block the visually disabled?

The question is not if the CAPTCHAs are crackable, because they are!
But, like we said in the other thread, it's by finding the right way
between the time needed to crack, and the time needed to type
over/listen to CAPTCHA. Adding Audio CAPTCHA decreases time to
crack...
>
>
> >I think you remember the thread tedd ;)
>
> I remember the threads, but nothing that was said there is counter to
> what I said here.
>
> Cheers,
>
> tedd

It's atleast an interesting thread about CAPTCHA.

Tijnema

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




   Quote of the day, hands down:

   "The brightest ideas have to pass through the dimmest minds"
~ Tedd (speaking of programmer-vs-management obstacles)


--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] [RFC] HTTP timezone

2007-06-11 Thread Stefanos Harhalakis
On Monday 11 June 2007 16:05, Lester Caine wrote:
> Timezone information is only of use for the CURRENT day - even if it is
> wrong. It is ESSENTIAL that any changes also include the daylight saving
> information. Since this is not included, all current sites handling event
> related information in real time need to manually log a users PROPER time
> and daylight saving information so that they know if 8AM today is the same
> as 8AM tomorrow.

  Since HTTP is a query and response protocol, timezone information will be 
sent on each query. Lets say that it is XX of month Y 1:59 and that the 
timeoffset is changed at '2:00' by +1. A request  sent at 1:59 will have an 
offset, lets say +0200. A request sent at 3:00 (that's one minute after 1:59) 
will have an offset of +0300. 

  Full timezone information requires a POSIX 1003.1 timezone string that is 
quite complex to parse and support, since the server side script must be able 
to identify all of the available timezones. The first draft proposed this 
representation but was changed after the suggestions of ietf-http-wg mailing 
list people to only include the offset for simplicity.

  Timezone information is not meant to be stored as session information nor 
being used for anything else than one-time time/date representation. It is 
just a way for the client to say: If you're going to show me something that 
is time related then you should know that you should represent it using this 
offset from GMT. Something like the Accepted-Language header.

  Lets say you're viewing an MRTG generated graph. This graph uses the time as 
the X-axis value. Lets say that the server is in Greece where the offset is 
+0200 (+0300 during DST) and that the time is 14:10. The graph will end its X 
axis at the current time (14:10). Someone from the UK visits the graph page 
and he should see the same graph ending in 12:10 (UK is +). An incorrect 
timezone string will only result in 'bad' time representation which will be 
the case anyway (without TZ).

  There is no need to include the DST information since when on DST the client 
will be sending the propper offset. For example, EET+2EEST is +0200 during 
winter and +0300 during DST.

  Hope this clears things a bit... 

  By the way, what makes you think that most people have an invalid timezone 
configured? Windows XP have NTP support that is enabled by default. Without a 
proper timezone this should result in an always invalid time. Linux and BSD 
systems have more experienced users that set their timezone correctly most of 
the time.

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:
> On 6/10/07, tedd <[EMAIL PROTECTED]> wrote:
> > >Tedd:
> > >
> > >Please don't spread the code of your Audio CAPTCHA, we had a big
> > >discussion about it, and we concluded that it was quite easy to crack.
> > >I remember i've cracked some other CAPTCHAs, but if you still think
> > >your Audio CAPTCHA isn't hard to crack, then just let me know and i'll
> > >start cracking it :)
> > >
> > >Dave:
> >
> > Dave:
> >
> > The point is not how easy my Audio CAPTCHA is to crack, but rather
> > one of accessibility.
> >
> > If one insist on using a graphic CAPTCHA, which in most cases can be
> > cracked, then at least add an Audio CAPTCHA to allow access for the
> > visually disabled.
> >
> > Or, is the point here to allow bots and block the visually disabled
> > -- I think not.
>
> Surely not, but what you're doing with adding a weak audio CAPTCHA is
> adding more options for a hacker. Since the form can be submitted by
> either completing one of both CAPTCHA programs, the hacker can choose
> whichever way he likes. So if you have a very very strong Graphic
> CAPTCHA, but a very weak Audio CAPTHCA, than it isn't too hard to
> crack, as the hacker would only crack the Audio CAPTCHA...
>
> >
> > Look at the CAPTCHA's use here:
> >
> > http://sam.zoy.org/pwntcha/
> >
> > and their efficiently at blocking bots, which next to nil.
> >
> > So, if people are going to believe in the false notion that CAPTCHA's
> > block bots, then why not provide a way for the visually disabled to
> > obtain access as well? Why just block the visually disabled?
>
> The question is not if the CAPTCHAs are crackable, because they are!
> But, like we said in the other thread, it's by finding the right way
> between the time needed to crack, and the time needed to type
> over/listen to CAPTCHA. Adding Audio CAPTCHA decreases time to
> crack...
> >
> >
> > >I think you remember the thread tedd ;)
> >
> > I remember the threads, but nothing that was said there is counter to
> > what I said here.
> >
> > Cheers,
> >
> > tedd
>
> It's atleast an interesting thread about CAPTCHA.
>
> Tijnema
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Quote of the day, hands down:

   "The brightest ideas have to pass through the dimmest minds"
~ Tedd (speaking of programmer-vs-management obstacles)


LOL... :)

Saved it ;)

Tijnema



--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread tedd

Gnag:

I know we can beat this thing to death, as we have in previous 
threads and I don't anyone wants to travel previously traveled ground.


However, Rob said:

"A good captcha will try to exploit a computer's weaknesses."

So, let's expound on that -- what do you consider to be a computer's weakness?

Cheers,

tedd

PS: I know, better minds have reviewed this issue before, but this is now.
--
---
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] [RFC] HTTP timezone

2007-06-11 Thread Lester Caine

Stefanos Harhalakis wrote:

On Monday 11 June 2007 16:05, Lester Caine wrote:


  Hope this clears things a bit... 


As I actually USE a clients time offset, I know what the problem is. The DATA 
is ALL stored as UTC time data, so it does not matter who enters it. It will 
be stored without a time offset.
When building a calender of events, I need to know the clients daylight saving 
time - since it is not available in the browser we have to handle it manually 
anyway so the browser feed is always a waste of time since it simply does not 
give you any USEFUL information. If I am building a calender of events over a 
change in daylight saving I NEED to know !!!
Now it would be possible to ignore time zone and daylight saving when storing 
data, but THAT becomes an even worse mess when trying to manage meetings 
across Europe. They can all be at 9AM but not happening at the same time as 
you have to track the daylight saving at each location :)


  By the way, what makes you think that most people have an invalid timezone 
configured? Windows XP have NTP support that is enabled by default. Without a 
proper timezone this should result in an always invalid time. Linux and BSD 
systems have more experienced users that set their timezone correctly most of 
the time.


Correct, so people select the timezone that gives the right time, if the 
daylight saving switch is off. And then the calendar gives the wrong times 
when trying to display a weekend containing a daylight saving change. ( THAT 
one wasted a few hours before we twigged what was wrong - since the clock was 
right :) )


--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

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



Re: [PHP] [RFC] HTTP timezone

2007-06-11 Thread Tijnema

On 6/11/07, Stefanos Harhalakis <[EMAIL PROTECTED]> wrote:

On Monday 11 June 2007 16:05, Lester Caine wrote:



 By the way, what makes you think that most people have an invalid timezone
configured? Windows XP have NTP support that is enabled by default. Without a
proper timezone this should result in an always invalid time. Linux and BSD
systems have more experienced users that set their timezone correctly most of
the time.


Like if the NTP works :P, when I go to the settings I see that my time
was last synchronised on the date I installed XP, and when I try to
run it manually, both servers fail to update. While i have a 24/7
Internet connection :)
This is the same for all my XPSP2/XPMCE installations. And what does
make you think that most people have correct time? On my school there
are about 20 computers in one place, and I checked the time for all of
them, all different, all wrong!
For my computers at home, I do have the correct Time, but Incorrect
time zone... (except 1 :P)
So, the information send to the server in the header would be wrong
for all PCs here in my LAN and at school, better said, 100% of the
computers I use pass wrong information, and so how reliable would that
header be?

Tijnema

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> Gnag:
> 
> I know we can beat this thing to death, as we have in previous 
> threads and I don't anyone wants to travel previously traveled ground.
> 
> However, Rob said:
> 
> "A good captcha will try to exploit a computer's weaknesses."
> 
> So, let's expound on that -- what do you consider to be a computer's weakness?

Well for instance as humans we can fairly easily recognize similar
shapes. We can recognize an apple whether it is red, green, yellow, has
a stem, has a leaf, is half eaten. A computer might recognize a circle,
and might guess that the circle is an apple based on further analysis.
But we as humans could recognize it as an apple even if we stretched it
a bit so it was no longer circular, or as I said, if it was a crescent
because someone had taken a huge bite out of it. This is something
humans excel at... inferring information from similar previous
experiences.

Taking the image captcha to a different level, one could combine our
ability to understand language as well as imagery. For instance we could
have an icon repository of animals, vehicles, plants, etc (very obvious
ones anyways). Then to create a captcha we could randomly select X
icons, slightly morph them to spoof matching them within the captcha
image itself, then ask:

What animal do you see in the above picture?

I think someone already said microsoft or someone does something
similar. The principle is that we know what generally constitutes an
animal and a computer does not. Similarly, an audio complement would be
to have a background sound of maybe low level radio chatter overlaid
with the sounds of various everyday items... then one could ask:

What did you hear ringing?

Possible answers... a bell, the telephone, an alarm, etc.

The problem then becomes an issue of people who can't spell or are
terrible at recognizing everyday things.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 12:01 -0400, Robert Cummings wrote:
> On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> > Gnag:
> > 
> > I know we can beat this thing to death, as we have in previous 
> > threads and I don't anyone wants to travel previously traveled ground.
> > 
> > However, Rob said:
> > 
> > "A good captcha will try to exploit a computer's weaknesses."
> > 
> > So, let's expound on that -- what do you consider to be a computer's 
> > weakness?
> 
> Well for instance as humans we can fairly easily recognize similar
> shapes. We can recognize an apple whether it is red, green, yellow, has
> a stem, has a leaf, is half eaten. A computer might recognize a circle,
> and might guess that the circle is an apple based on further analysis.
> But we as humans could recognize it as an apple even if we stretched it
> a bit so it was no longer circular, or as I said, if it was a crescent
> because someone had taken a huge bite out of it. This is something
> humans excel at... inferring information from similar previous
> experiences.
> 
> Taking the image captcha to a different level, one could combine our
> ability to understand language as well as imagery. For instance we could
> have an icon repository of animals, vehicles, plants, etc (very obvious
> ones anyways). Then to create a captcha we could randomly select X
> icons, slightly morph them to spoof matching them within the captcha
> image itself, then ask:
> 
> What animal do you see in the above picture?
> 
> I think someone already said microsoft or someone does something
> similar. The principle is that we know what generally constitutes an
> animal and a computer does not. Similarly, an audio complement would be
> to have a background sound of maybe low level radio chatter overlaid
> with the sounds of various everyday items... then one could ask:
> 
> What did you hear ringing?
> 
> Possible answers... a bell, the telephone, an alarm, etc.
> 
> The problem then becomes an issue of people who can't spell or are
> terrible at recognizing everyday things.

I've just been inspired by my childhood... Sesame Street CAPTCHA...

"Which of these things doesn't belong"

:)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Jason Pruim


On Jun 11, 2007, at 12:01 PM, Robert Cummings wrote:




What did you hear ringing?

Possible answers... a bell, the telephone, an alarm, etc.

The problem then becomes an issue of people who can't spell or are
terrible at recognizing everyday things.



To combat that, wouldn't you be able to just but in a list of  
possible answers and have them click on one?


Or to make it harder put a picture up for each one with a check box  
next to it? Use like an old style phone, a bell that people put on  
their counters to ring for service, and then like an egg timer for  
the alarm? Or something like that...


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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 12:01 -0400, Robert Cummings wrote:
> On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> > Gnag:
> >
> > I know we can beat this thing to death, as we have in previous
> > threads and I don't anyone wants to travel previously traveled ground.
> >
> > However, Rob said:
> >
> > "A good captcha will try to exploit a computer's weaknesses."
> >
> > So, let's expound on that -- what do you consider to be a computer's 
weakness?
>
> Well for instance as humans we can fairly easily recognize similar
> shapes. We can recognize an apple whether it is red, green, yellow, has
> a stem, has a leaf, is half eaten. A computer might recognize a circle,
> and might guess that the circle is an apple based on further analysis.
> But we as humans could recognize it as an apple even if we stretched it
> a bit so it was no longer circular, or as I said, if it was a crescent
> because someone had taken a huge bite out of it. This is something
> humans excel at... inferring information from similar previous
> experiences.
>
> Taking the image captcha to a different level, one could combine our
> ability to understand language as well as imagery. For instance we could
> have an icon repository of animals, vehicles, plants, etc (very obvious
> ones anyways). Then to create a captcha we could randomly select X
> icons, slightly morph them to spoof matching them within the captcha
> image itself, then ask:
>
> What animal do you see in the above picture?
>
> I think someone already said microsoft or someone does something
> similar. The principle is that we know what generally constitutes an
> animal and a computer does not. Similarly, an audio complement would be
> to have a background sound of maybe low level radio chatter overlaid
> with the sounds of various everyday items... then one could ask:
>
> What did you hear ringing?
>
> Possible answers... a bell, the telephone, an alarm, etc.
>
> The problem then becomes an issue of people who can't spell or are
> terrible at recognizing everyday things.

I've just been inspired by my childhood... Sesame Street CAPTCHA...

"Which of these things doesn't belong"

:)

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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




   Robert, I really like that idea.  I'd suggest adding either radio
buttons or a drop-down list of, say, four items but then there's a
25% chance that automated software could still get in, so in reality,
it's only blocking 3/4 of the attempts at automation.  Because
otherwise, you'd have to have a cAsE-iNsEnSiTiVe regexp check (and
possibly a database of common mis-spellings) to check against.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Mon, 2007-06-11 at 12:01 -0400, Robert Cummings wrote:
> > On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> > > Gnag:
> > >
> > > I know we can beat this thing to death, as we have in previous
> > > threads and I don't anyone wants to travel previously traveled ground.
> > >
> > > However, Rob said:
> > >
> > > "A good captcha will try to exploit a computer's weaknesses."
> > >
> > > So, let's expound on that -- what do you consider to be a computer's 
weakness?
> >
> > Well for instance as humans we can fairly easily recognize similar
> > shapes. We can recognize an apple whether it is red, green, yellow, has
> > a stem, has a leaf, is half eaten. A computer might recognize a circle,
> > and might guess that the circle is an apple based on further analysis.
> > But we as humans could recognize it as an apple even if we stretched it
> > a bit so it was no longer circular, or as I said, if it was a crescent
> > because someone had taken a huge bite out of it. This is something
> > humans excel at... inferring information from similar previous
> > experiences.
> >
> > Taking the image captcha to a different level, one could combine our
> > ability to understand language as well as imagery. For instance we could
> > have an icon repository of animals, vehicles, plants, etc (very obvious
> > ones anyways). Then to create a captcha we could randomly select X
> > icons, slightly morph them to spoof matching them within the captcha
> > image itself, then ask:
> >
> > What animal do you see in the above picture?
> >
> > I think someone already said microsoft or someone does something
> > similar. The principle is that we know what generally constitutes an
> > animal and a computer does not. Similarly, an audio complement would be
> > to have a background sound of maybe low level radio chatter overlaid
> > with the sounds of various everyday items... then one could ask:
> >
> > What did you hear ringing?
> >
> > Possible answers... a bell, the telephone, an alarm, etc.
> >
> > The problem then becomes an issue of people who can't spell or are
> > terrible at recognizing everyday things.
>
> I've just been inspired by my childhood... Sesame Street CAPTCHA...
>
> "Which of these things doesn't belong"
>
> :)
>
> Cheers,
> Rob.
> --
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Robert, I really like that idea.  I'd suggest adding either radio
buttons or a drop-down list of, say, four items but then there's a
25% chance that automated software could still get in, so in reality,
it's only blocking 3/4 of the attempts at automation.  Because
otherwise, you'd have to have a cAsE-iNsEnSiTiVe regexp check (and
possibly a database of common mis-spellings) to check against.

--
Daniel P. Brown



If you make multiple choice items, a good app would probably just try
max 4 times :P, so you need to check if the user did actually fail the
first time...

Tijnema




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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> Gnag:
>
> I know we can beat this thing to death, as we have in previous
> threads and I don't anyone wants to travel previously traveled ground.
>
> However, Rob said:
>
> "A good captcha will try to exploit a computer's weaknesses."
>
> So, let's expound on that -- what do you consider to be a computer's weakness?

Well for instance as humans we can fairly easily recognize similar
shapes. We can recognize an apple whether it is red, green, yellow, has
a stem, has a leaf, is half eaten. A computer might recognize a circle,
and might guess that the circle is an apple based on further analysis.
But we as humans could recognize it as an apple even if we stretched it
a bit so it was no longer circular, or as I said, if it was a crescent
because someone had taken a huge bite out of it. This is something
humans excel at... inferring information from similar previous
experiences.

Taking the image captcha to a different level, one could combine our
ability to understand language as well as imagery. For instance we could
have an icon repository of animals, vehicles, plants, etc (very obvious
ones anyways). Then to create a captcha we could randomly select X
icons, slightly morph them to spoof matching them within the captcha
image itself, then ask:

   What animal do you see in the above picture?

I think someone already said microsoft or someone does something
similar. The principle is that we know what generally constitutes an
animal and a computer does not. Similarly, an audio complement would be
to have a background sound of maybe low level radio chatter overlaid
with the sounds of various everyday items... then one could ask:

   What did you hear ringing?

Possible answers... a bell, the telephone, an alarm, etc.

The problem then becomes an issue of people who can't spell or are
terrible at recognizing everyday things.

Cheers,
Rob.


Server builds up a database of pictures, client does the same with MD5
check, and problem solved...:)

Tijnema

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> > Gnag:
> >
> > I know we can beat this thing to death, as we have in previous
> > threads and I don't anyone wants to travel previously traveled ground.
> >
> > However, Rob said:
> >
> > "A good captcha will try to exploit a computer's weaknesses."
> >
> > So, let's expound on that -- what do you consider to be a computer's 
weakness?
>
> Well for instance as humans we can fairly easily recognize similar
> shapes. We can recognize an apple whether it is red, green, yellow, has
> a stem, has a leaf, is half eaten. A computer might recognize a circle,
> and might guess that the circle is an apple based on further analysis.
> But we as humans could recognize it as an apple even if we stretched it
> a bit so it was no longer circular, or as I said, if it was a crescent
> because someone had taken a huge bite out of it. This is something
> humans excel at... inferring information from similar previous
> experiences.
>
> Taking the image captcha to a different level, one could combine our
> ability to understand language as well as imagery. For instance we could
> have an icon repository of animals, vehicles, plants, etc (very obvious
> ones anyways). Then to create a captcha we could randomly select X
> icons, slightly morph them to spoof matching them within the captcha
> image itself, then ask:
>
>What animal do you see in the above picture?
>
> I think someone already said microsoft or someone does something
> similar. The principle is that we know what generally constitutes an
> animal and a computer does not. Similarly, an audio complement would be
> to have a background sound of maybe low level radio chatter overlaid
> with the sounds of various everyday items... then one could ask:
>
>What did you hear ringing?
>
> Possible answers... a bell, the telephone, an alarm, etc.
>
> The problem then becomes an issue of people who can't spell or are
> terrible at recognizing everyday things.
>
> Cheers,
> Rob.

Server builds up a database of pictures, client does the same with MD5
check, and problem solved...:)

Tijnema

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




   We're not talking about simply masking of the name of pictures
(apple.jpg, car.jpg, fat_slut.jpg, bench.jpg, etc.), but rather
morphing those images a bit.  They'd still be recognized if skewed,
noise is added, and so on, but not as readily to a computer as a human
being (unless, perhaps, it's something like Robonova -
http://www.robots-dreams.com/2007/05/robot_image_rec.html).

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Jim Lucas

Tijnema wrote:

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
> Gnag:
>
> I know we can beat this thing to death, as we have in previous
> threads and I don't anyone wants to travel previously traveled ground.
>
> However, Rob said:
>
> "A good captcha will try to exploit a computer's weaknesses."
>
> So, let's expound on that -- what do you consider to be a computer's 
weakness?


Well for instance as humans we can fairly easily recognize similar
shapes. We can recognize an apple whether it is red, green, yellow, has
a stem, has a leaf, is half eaten. A computer might recognize a circle,
and might guess that the circle is an apple based on further analysis.
But we as humans could recognize it as an apple even if we stretched it
a bit so it was no longer circular, or as I said, if it was a crescent
because someone had taken a huge bite out of it. This is something
humans excel at... inferring information from similar previous
experiences.

Taking the image captcha to a different level, one could combine our
ability to understand language as well as imagery. For instance we could
have an icon repository of animals, vehicles, plants, etc (very obvious
ones anyways). Then to create a captcha we could randomly select X
icons, slightly morph them to spoof matching them within the captcha
image itself, then ask:

   What animal do you see in the above picture?

I think someone already said microsoft or someone does something
similar. The principle is that we know what generally constitutes an
animal and a computer does not. Similarly, an audio complement would be
to have a background sound of maybe low level radio chatter overlaid
with the sounds of various everyday items... then one could ask:

   What did you hear ringing?

Possible answers... a bell, the telephone, an alarm, etc.

The problem then becomes an issue of people who can't spell or are
terrible at recognizing everyday things.

Cheers,
Rob.


Server builds up a database of pictures, client does the same with MD5
check, and problem solved...:)

Tijnema



not if you are morphing/changing the image each page load.

Personally, I would not save the images that I have already morphed.

Granted, this would put a little more work on my box, but I think it is a price I would be willing 
to pay if it would prevent someone from storing all possible image/md5 sums.


have fun storing all my randomly morphed images from here to infinity.

remember, change height, width, color depth, plus all possible morphing and you are talking about a 
lot of images.


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



[PHP] MySQL Connection in Session ?

2007-06-11 Thread PHP Mailing List
Can I maintain just one mysql connection resource to all my pages per 
user session. As far as I knows create connection is more expensive than 
executing queries ?


Any reference how to make efficient for connection resources ?

Thanks,

Dino

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:
>> > Gnag:
>> >
>> > I know we can beat this thing to death, as we have in previous
>> > threads and I don't anyone wants to travel previously traveled ground.
>> >
>> > However, Rob said:
>> >
>> > "A good captcha will try to exploit a computer's weaknesses."
>> >
>> > So, let's expound on that -- what do you consider to be a computer's
>> weakness?
>>
>> Well for instance as humans we can fairly easily recognize similar
>> shapes. We can recognize an apple whether it is red, green, yellow, has
>> a stem, has a leaf, is half eaten. A computer might recognize a circle,
>> and might guess that the circle is an apple based on further analysis.
>> But we as humans could recognize it as an apple even if we stretched it
>> a bit so it was no longer circular, or as I said, if it was a crescent
>> because someone had taken a huge bite out of it. This is something
>> humans excel at... inferring information from similar previous
>> experiences.
>>
>> Taking the image captcha to a different level, one could combine our
>> ability to understand language as well as imagery. For instance we could
>> have an icon repository of animals, vehicles, plants, etc (very obvious
>> ones anyways). Then to create a captcha we could randomly select X
>> icons, slightly morph them to spoof matching them within the captcha
>> image itself, then ask:
>>
>>What animal do you see in the above picture?
>>
>> I think someone already said microsoft or someone does something
>> similar. The principle is that we know what generally constitutes an
>> animal and a computer does not. Similarly, an audio complement would be
>> to have a background sound of maybe low level radio chatter overlaid
>> with the sounds of various everyday items... then one could ask:
>>
>>What did you hear ringing?
>>
>> Possible answers... a bell, the telephone, an alarm, etc.
>>
>> The problem then becomes an issue of people who can't spell or are
>> terrible at recognizing everyday things.
>>
>> Cheers,
>> Rob.
>
> Server builds up a database of pictures, client does the same with MD5
> check, and problem solved...:)
>
> Tijnema
>

not if you are morphing/changing the image each page load.





remember, change height, width, color depth, plus all possible morphing and you 
are talking about a
lot of images.

--
Jim Lucas


Convert image to fixed width + fixed height + default depth, then do
some work on it :P

Tijnema

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Crayon Shin Chan
On Tuesday 12 June 2007 00:22, Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:

[snip]

Tijnema, Daniel Brown, and any other guilty ones, please trim your posts!

-- 
Crayon

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

   Nah, that's what we have you for!  ;-P

   Just for that, I'm top-posting, too.

   Gotta' love Mondays


On 6/11/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:

On Tuesday 12 June 2007 00:22, Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2007-06-11 at 10:38 -0400, tedd wrote:

[snip]

Tijnema, Daniel Brown, and any other guilty ones, please trim your posts!

--
Crayon

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





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] [RFC] HTTP timezone

2007-06-11 Thread Stefanos Harhalakis
On Monday 11 June 2007 18:15, Lester Caine wrote:
> calender of events over a change in daylight saving I NEED to know !!!

  I believe that I finally understand your thoughts. You mean that you need to 
use the timezone information to know when in the future the time will change 
(or in the past). I believe that you're correct.

  I assume that providing the current offset and the timezone as two separate 
strings would be the most appropriate thing. The offset will provide 
simplicity for simple applications. The timezone will provide full 
information for applications that support it and the browser will not need to 
do much work since both of them are immediately available (Just a sprintf()).

  What about something like:

Timezone: offset; posix_timezone

for example:

Timezone: +0200; EET-2EEST

?

> Correct, so people select the timezone that gives the right time, if the
> daylight saving switch is off. And then the calendar gives the wrong times
> when trying to display a weekend containing a daylight saving change. (
> THAT one wasted a few hours before we twigged what was wrong - since the
> clock was right :) )

  Your comments are of great importance to this attempt. I'll be glad if we 
can come with a solution that will fit your experienced needs on this 
subject. This may help other people too.

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



Re: [PHP] [RFC] HTTP timezone

2007-06-11 Thread Lester Caine

Stefanos Harhalakis wrote:

On Monday 11 June 2007 18:15, Lester Caine wrote:

calender of events over a change in daylight saving I NEED to know !!!


  I believe that I finally understand your thoughts. You mean that you need to 
use the timezone information to know when in the future the time will change 
(or in the past). I believe that you're correct.


That is the one exactly - and I've had great trouble getting people to accept 
that there IS a problem. The main problem happens where events actually change 
day because of the daylight saving changes - as you say in the past or future.


  I assume that providing the current offset and the timezone as two separate 
strings would be the most appropriate thing. The offset will provide 
simplicity for simple applications. The timezone will provide full 
information for applications that support it and the browser will not need to 
do much work since both of them are immediately available (Just a sprintf()).


  What about something like:

Timezone: offset; posix_timezone

for example:

Timezone: +0200; EET-2EEST


Provided that the posix element actually defines a distinct daylight saving 
variation then it would work. The tz database does seem to have all current 
information?



Correct, so people select the timezone that gives the right time, if the
daylight saving switch is off. And then the calendar gives the wrong times
when trying to display a weekend containing a daylight saving change. (
THAT one wasted a few hours before we twigged what was wrong - since the
clock was right :) )


  Your comments are of great importance to this attempt. I'll be glad if we 
can come with a solution that will fit your experienced needs on this 
subject. This may help other people too.


Basically we had to drop using the browser time offset so that people were 
forced to set their correct offset - including daylight saving. The new 
date/time facilities provided in PHP5 actually allow accurate calendars to be 
built since daylight saving started, and hopefully this information will track 
all future changes, but none of it will work unless you have the users 
daylight saving information, just having a simple time offset would not allow 
you to create a correct calendar.


I had fun last October trying to debug a calendar package until I realised 
that daylight saving was being applied twice, so as long as people are AWARE 
that it is important in some countries 


--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 18:57 +0200, Tijnema wrote:
> On 6/11/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
> > Tijnema wrote:
> > > On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

> >
> > not if you are morphing/changing the image each page load.
> >
> 
> >
> > remember, change height, width, color depth, plus all possible morphing and 
> > you are talking about a
> > lot of images.
> >
>
> Convert image to fixed width + fixed height + default depth, then do
> some work on it :P

A lot of people have already commented on why you can't provide the
answers in a radio or select list so I want answer those again. As
Others have already mentioned it's not an easy task to fingerprint the
images either since there are multiple problems at play for someone
attempting to do so. First off, we are using multiple backgrounds with
the icons placed on the backgrounds. To fingerprint you need to know
what the icons are on the background. You can't just fingerprint the
entire CAPTCHA because you the backgorund can change and so too can the
order and position of the icon. Additionally, by distorting the icon to
some degree, varying blending with background, colour, softness,
pixelation, etc the entire image becomes unique. Also even if for some
ungodly reason two images were generated with the exact same fingerprint
(unlikely as hell), the question might be different. One question might
ask what animal do you see? The other might say how many fish do you
see? As such there are multiple solutions to a single CAPTCHA but only
one is the answer based on the challenge posed.

Cheers,
Rob
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] MySQL Connection in Session ?

2007-06-11 Thread Satyam
In most systems, database connections are pooled, meaning that when you give 
them up, they are not completely closed but the sql client software keeps 
them in a pool available for the next script asking for a similar 
connection, thus saving on the time to establish a connection.It is the 
connection between your script and the sql client that gets cut, the 
database does not know your script is gone, since the sql client doesn't 
tell it.


For the pooling to work, it is necesary that all the connections requested 
have the same parameters, including user name and password.  If you change 
username for each page, then the client software has to actually establish a 
connection for that user to retrieve the proper permisions.   Of course, 
that connection would also be sent to the pool once the page is processed, 
but then the pool would soon fill up with many connections, one per 
username, each seldom used and in a really busy server, the connection would 
be dropped out of the pool before it gets a chance to be reused.


Storing those many connection in session variables only moves the problem 
from having the sql client manage a large pool of little used connections to 
have PHP sessions do the same thing, far more inneficiently.


The best thing is to make sure all connections you use are opened with 
exactly the same parameters, use just one connection for all the script 
(unless, of course, you actually have to connect to different databases) and 
let it go as fast as you can to give the next in line a chance to reuse it 
from the pool.


Satyam

- Original Message - 
From: "PHP Mailing List" <[EMAIL PROTECTED]>

To: 
Sent: Monday, June 11, 2007 6:53 PM
Subject: [PHP] MySQL Connection in Session ?


Can I maintain just one mysql connection resource to all my pages per user 
session. As far as I knows create connection is more expensive than 
executing queries ?


Any reference how to make efficient for connection resources ?

Thanks,

Dino

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



--
No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 
269.8.13/843 - Release Date: 10/06/2007 13:39





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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 18:57 +0200, Tijnema wrote:
> On 6/11/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
> > Tijnema wrote:
> > > On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

> >
> > not if you are morphing/changing the image each page load.
> >
> 
> >
> > remember, change height, width, color depth, plus all possible morphing and 
you are talking about a
> > lot of images.
> >
>
> Convert image to fixed width + fixed height + default depth, then do
> some work on it :P

A lot of people have already commented on why you can't provide the
answers in a radio or select list so I want answer those again. As
Others have already mentioned it's not an easy task to fingerprint the
images either since there are multiple problems at play for someone
attempting to do so. First off, we are using multiple backgrounds with
the icons placed on the backgrounds. To fingerprint you need to know
what the icons are on the background. You can't just fingerprint the
entire CAPTCHA because you the backgorund can change and so too can the
order and position of the icon. Additionally, by distorting the icon to
some degree, varying blending with background, colour, softness,
pixelation, etc the entire image becomes unique. Also even if for some
ungodly reason two images were generated with the exact same fingerprint
(unlikely as hell), the question might be different. One question might
ask what animal do you see? The other might say how many fish do you
see? As such there are multiple solutions to a single CAPTCHA but only
one is the answer based on the challenge posed.

Cheers,
Rob


Well, if you think this is the uncrackable* solution, create it and
i'll see if I can crack it ;)

Tijnema

* I hope you don't mean the same uncrackable as AACS did:
"HD-DVD is uncrackable" ;)

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 13:29 -0400, Robert Cummings wrote:
> On Mon, 2007-06-11 at 18:57 +0200, Tijnema wrote:
> > On 6/11/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
> > > Tijnema wrote:
> > > > On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> 
> > >
> > > not if you are morphing/changing the image each page load.
> > >
> > 
> > >
> > > remember, change height, width, color depth, plus all possible morphing 
> > > and you are talking about a
> > > lot of images.
> > >
> >
> > Convert image to fixed width + fixed height + default depth, then do
> > some work on it :P
> 
> A lot of people have already commented on why you can't provide the
> answers in a radio or select list so I want answer those again. As
> Others have already mentioned it's not an easy task to fingerprint the
> images either since there are multiple problems at play for someone
> attempting to do so. First off, we are using multiple backgrounds with
> the icons placed on the backgrounds. To fingerprint you need to know
> what the icons are on the background. You can't just fingerprint the
> entire CAPTCHA because you the backgorund can change and so too can the
> order and position of the icon. Additionally, by distorting the icon to
> some degree, varying blending with background, colour, softness,
> pixelation, etc the entire image becomes unique. Also even if for some
> ungodly reason two images were generated with the exact same fingerprint
> (unlikely as hell), the question might be different. One question might
> ask what animal do you see? The other might say how many fish do you
> see? As such there are multiple solutions to a single CAPTCHA but only
> one is the answer based on the challenge posed.

BTW, just crunching my brain a bit, to get past spelling issues, you
could place a 5-digit (or something similar) number under each icon that
would be highly visible and clear (unlike currently captcha text) and
that would be what the user would input instead of the name. Similarly
for audio captcha, you would just read a 5 digit number after each
option... audio captcha would probably require listeners to listen at
least twice, once to get an overview of the information, the second to
locate the pertinent number to input.

One problem might be that the placement of such a number might make it
possible for hackers to home in on the pertinent information easier.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 19:38 +0200, Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> 
> Well, if you think this is the uncrackable* solution, create it and
> i'll see if I can crack it ;)
> 
> Tijnema
> 
> * I hope you don't mean the same uncrackable as AACS did:
> "HD-DVD is uncrackable" ;)

*lol* I've never used the word uncrackable... such a statement would
surely be proved short-sighted given sufficient time... right up there
with such ridiculous statements as "nobody will ever need more than 640k
memory" ;)

I only have one problem creating the CAPTCHA -- time. I don't have any
free time right now, I'm working on something else I need to finish. But
in time will quite likely travel down this path.

It would be an interesting challenge to see if I could beat your
cracking skillz with my hacking skillz ;) ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 19:38 +0200, Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> Well, if you think this is the uncrackable* solution, create it and
> i'll see if I can crack it ;)
>
> Tijnema
>
> * I hope you don't mean the same uncrackable as AACS did:
> "HD-DVD is uncrackable" ;)

*lol* I've never used the word uncrackable... such a statement would
surely be proved short-sighted given sufficient time... right up there
with such ridiculous statements as "nobody will ever need more than 640k
memory" ;)


Good :P


I only have one problem creating the CAPTCHA -- time. I don't have any
free time right now, I'm working on something else I need to finish. But
in time will quite likely travel down this path.


Yeah, time is allways a problem, it's a big problem for me too :(


It would be an interesting challenge to see if I could beat your
cracking skillz with my hacking skillz ;) ;)

Cheers,
Rob.


It would definitly be an interesting challenge, but you don't have
time, or is that an excuse..? :P

What about you tedd?

Tijnema

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

Tijnema <[EMAIL PROTECTED]> spake the following lore:
Convert image to fixed width + fixed height + default depth, then do
some work on it :P

Tijnema



   Yeah, what work?  Best of luck with getting a system to reliably
translate one Jell-o blob of an image into another accurately and
reliably.  It's ASCII art time!

   Say I have an image of a cigarette:
___
(_(@

   Then, I morph the image so that it's SNAFU'd:
 ___
/ \\_/ @/
  //   \_/
( __/

   Keeping in mind that it's ASCII art, you can still see the
similarities.  A computer, with an actual graphical image, probably
wouldn't recognize it.  It may instead see it as a snake, which could
initially look like this:

  //==\\  =o~
<==//  \\==//

   Then matched with a selection of images that the user could pick
from, the snake is morphed to:



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 19:51 +0200, Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2007-06-11 at 19:38 +0200, Tijnema wrote:
> > > On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > >
> > > Well, if you think this is the uncrackable* solution, create it and
> > > i'll see if I can crack it ;)
> > >
> > > Tijnema
> > >
> > > * I hope you don't mean the same uncrackable as AACS did:
> > > "HD-DVD is uncrackable" ;)
> >
> > *lol* I've never used the word uncrackable... such a statement would
> > surely be proved short-sighted given sufficient time... right up there
> > with such ridiculous statements as "nobody will ever need more than 640k
> > memory" ;)
> 
> Good :P
> >
> > I only have one problem creating the CAPTCHA -- time. I don't have any
> > free time right now, I'm working on something else I need to finish. But
> > in time will quite likely travel down this path.
> 
> Yeah, time is allways a problem, it's a big problem for me too :(
> >
> > It would be an interesting challenge to see if I could beat your
> > cracking skillz with my hacking skillz ;) ;)
> >
> > Cheers,
> > Rob.
> 
> It would definitly be an interesting challenge, but you don't have
> time, or is that an excuse..? :P

*lol* If I had the time I wouldn't be using freecap in the meantime. I
may have a bit of time in July :) remind me then if I forget.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Persistent MySQL Connection

2007-06-11 Thread PHP Mailing List
Can I maintain just one mysql connection resource to all my pages per 
user session. As far as I knows create connection is more expensive than

executing queries ?

Any reference how to make efficient for connection resources ?

Thanks,

Dino

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 13:52 -0400, Daniel Brown wrote:
> > Tijnema <[EMAIL PROTECTED]> spake the following lore:
> > Convert image to fixed width + fixed height + default depth, then do
> > some work on it :P
>
> To be a bit easier, I whipped up a quick example on the web.  It's
> just static images, not a working system, but you'll see what we're
> getting at here:
> http://pilotpig.net/captcha-example.php

H, two snakes and a cigarette in the first example ;)

And I'm guessing Dubya doesn't belong in the second example :D

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 13:52 -0400, Daniel Brown wrote:
> > Tijnema <[EMAIL PROTECTED]> spake the following lore:
> > Convert image to fixed width + fixed height + default depth, then do
> > some work on it :P
>
> To be a bit easier, I whipped up a quick example on the web.  It's
> just static images, not a working system, but you'll see what we're
> getting at here:
> http://pilotpig.net/captcha-example.php

H, two snakes and a cigarette in the first example ;)

And I'm guessing Dubya doesn't belong in the second example :D

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'




   The worst part is, it's not even just Americans who get it at
first glance

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



[PHP] "tail" solution for PHP5 wanted

2007-06-11 Thread Michelle Konzack
*
* Do not Cc: me, because I am on THIS list, if I write here.*
* Keine Cc: an mich, bin auf DIESER Liste wenn ich hier schreibe.   *
* Ne me mettez pas en Cc:, je suis sur CETTE liste, si j'ecris ici. *
*

Hello, 

I am working again on my PHP Admin interace an need a "tail"
solution in PHP5 to show "fetchmail" and "procmail" in realtime.

Does anyone have done this already and if yes, how?

My ADSL router can do this but it use a crapy JavaScript which can
show only logs UNDER 100 lines since it refresh the whole page
once a second but I need at least the last 500 lines of logfiles.

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 13:59 -0400, Daniel Brown wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2007-06-11 at 13:52 -0400, Daniel Brown wrote:
> > > > Tijnema <[EMAIL PROTECTED]> spake the following lore:
> > > > Convert image to fixed width + fixed height + default depth, then do
> > > > some work on it :P
> > >
> > > To be a bit easier, I whipped up a quick example on the web.  It's
> > > just static images, not a working system, but you'll see what we're
> > > getting at here:
> > > http://pilotpig.net/captcha-example.php
> >
> > H, two snakes and a cigarette in the first example ;)
> >
> > And I'm guessing Dubya doesn't belong in the second example :D

> The worst part is, it's not even just Americans who get it at
> first glance

You know... that brings up another thought... semantically weeding out
people you don't want on your site. If you posted 3 snakes, a worm, and
Dubya and asked which one isn't like the other... certain people would
pick Dubya, while certain others would pick the worm. Heck, you could
make both answers correct for passing the captcha, then quietly store
profiling information about the user *heheh*.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

   The (things I thought were subtle) jokes aside, hopefully the
examples can be used as some kind of point-of-reference for those who
may follow along in the future.  When they Google for a solution like
the one we're discussing and the words of this motley crew come up as
one of the first results, there should be something showing what the
hell we mean!

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

> Tijnema <[EMAIL PROTECTED]> spake the following lore:
> Convert image to fixed width + fixed height + default depth, then do
> some work on it :P
>
> Tijnema
>

   Yeah, what work?  Best of luck with getting a system to reliably
translate one Jell-o blob of an image into another accurately and
reliably.  It's ASCII art time!

   Say I have an image of a cigarette:
 ___
(_(@

   Then, I morph the image so that it's SNAFU'd:
 ___
/ \\_/ @/
  //   \_/
( __/

   Keeping in mind that it's ASCII art, you can still see the
similarities.  A computer, with an actual graphical image, probably
wouldn't recognize it.  It may instead see it as a snake, which could
initially look like this:

  //==\\  =o~
<==//  \\==//

   Then matched with a selection of images that the user could pick
from, the snake is morphed to:



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

>To be a bit easier, I whipped up a quick example on the web.  It's
> just static images, not a working system, but you'll see what we're
> getting at here:
>http://pilotpig.net/captcha-example.php
>

You could even use a color check here to see which color matches the best ;)

Tijnema



   Ah, but that validates my exact point --- the system will see the
overlay over the legitimate cigarette image as being image-synonymous
with the snake as an option by color pattern, while the parent image
matches best with the first child option image in shape.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] MySQL Connection in Session ?

2007-06-11 Thread Stut

PHP Mailing List wrote:
Can I maintain just one mysql connection resource to all my pages per 
user session. As far as I knows create connection is more expensive than 
executing queries ?


No, you can't store resources (of which mysql connections are one 
example) in sessions.



Any reference how to make efficient for connection resources ?


Making a connection to a MySQL database is a fairly expensive thing to 
do, but using persistant connections can make it a whole lot less 
problematic, but you may run into issues if you ever have multiple PHP 
boxes connecting to the same DB server depending on how your 
architecture works.


-Stut

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > >To be a bit easier, I whipped up a quick example on the web.  It's
> > > just static images, not a working system, but you'll see what we're
> > > getting at here:
> > >http://pilotpig.net/captcha-example.php
> > >
> >
> > You could even use a color check here to see which color matches the best ;)
> >
> 
> Ah, but that validates my exact point --- the system will see the
> overlay over the legitimate cigarette image as being image-synonymous
> with the snake as an option by color pattern, while the parent image
> matches best with the first child option image in shape.

Not as easy as Tijnema thinks... all the icons are in a single image so
first he needs to find the icon boundaries to extract them to perform
colour analysis. And that can be more or less hard depending on how the
icons are merged. For instance using PNG images with alpha transparency
so that an overlay and merge looks right would make edge detection of
the icon difficult ths making colour analysis difficult. Also, the
colour analysis only works in the case where you're presented with an
image and asked to pick the same image form the set. It doesn't work in
the semantic example where you are asked "which of the following doesn't
belong?" :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Updating dropdown list

2007-06-11 Thread Ashley M. Kirchner


   I have a page containing two drop down lists.  I need to figure out 
a way to populate/update the second drop down list based on a selection 
of the first one (the data for both drop down lists is in a MySQL 
database).  Is this something I need to do in JavaScript?  Or can I 
somehow trick PHP to do this?


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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > >To be a bit easier, I whipped up a quick example on the web.  It's
> > > just static images, not a working system, but you'll see what we're
> > > getting at here:
> > >http://pilotpig.net/captcha-example.php
> > >
> >
> > You could even use a color check here to see which color matches the best ;)
> >
>
> Ah, but that validates my exact point --- the system will see the
> overlay over the legitimate cigarette image as being image-synonymous
> with the snake as an option by color pattern, while the parent image
> matches best with the first child option image in shape.

Not as easy as Tijnema thinks... all the icons are in a single image so
first he needs to find the icon boundaries to extract them to perform
colour analysis. And that can be more or less hard depending on how the
icons are merged. For instance using PNG images with alpha transparency
so that an overlay and merge looks right would make edge detection of
the icon difficult ths making colour analysis difficult.


Sure, but what if I convert the image first to JPEG or GIF? GIF would
be the easiest option I think, because if I convert both then I could
easily count the color of each pixel and you can call the job done. :)


Also, the
colour analysis only works in the case where you're presented with an
image and asked to pick the same image form the set. It doesn't work in
the semantic example where you are asked "which of the following doesn't
belong?" :)


Of course, it was just an easy example, as there could be images
presented with exactly the same color. Different CAPTCHA program needs
different kind of hack...

Tijnema

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Daniel Brown

On 6/11/07, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote:


I have a page containing two drop down lists.  I need to figure out
a way to populate/update the second drop down list based on a selection
of the first one (the data for both drop down lists is in a MySQL
database).  Is this something I need to do in JavaScript?  Or can I
somehow trick PHP to do this?

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




   Without refreshing the page would require JavaScript, but if it
doesn't matter if the page is refreshed, you could use PHP.


--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] "tail" solution for PHP5 wanted

2007-06-11 Thread Tijnema

On 6/11/07, Michelle Konzack <[EMAIL PROTECTED]> wrote:

*
* Do not Cc: me, because I am on THIS list, if I write here.*
* Keine Cc: an mich, bin auf DIESER Liste wenn ich hier schreibe.   *
* Ne me mettez pas en Cc:, je suis sur CETTE liste, si j'ecris ici. *
*

Hello,

I am working again on my PHP Admin interace an need a "tail"
solution in PHP5 to show "fetchmail" and "procmail" in realtime.

Does anyone have done this already and if yes, how?

My ADSL router can do this but it use a crapy JavaScript which can
show only logs UNDER 100 lines since it refresh the whole page
once a second but I need at least the last 500 lines of logfiles.

Greetings
   Michelle Konzack


Can't you simply use the unix function for that and pass that through
your PHP script to the browser?
Btw, if you do this, your PHP script would keep running forever, keep
in mind that the time limit setting doesn't affect system and file
calls...

Tijnema

Tijnema

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Jim Lucas

Ashley M. Kirchner wrote:


   I have a page containing two drop down lists.  I need to figure out a 
way to populate/update the second drop down list based on a selection of 
the first one (the data for both drop down lists is in a MySQL 
database).  Is this something I need to do in JavaScript?  Or can I 
somehow trick PHP to do this?



client side = Javascript

maybe mix it with PHP with an AJAX call or something...

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



RE: [PHP] Updating dropdown list

2007-06-11 Thread Jay Blanchard
[snip]
Without refreshing the page would require JavaScript, but if it
doesn't matter if the page is refreshed, you could use PHP.
[/snip]

Or a combination, using AJAX. 

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Tijnema

On 6/11/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/11/07, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote:
>
> I have a page containing two drop down lists.  I need to figure out
> a way to populate/update the second drop down list based on a selection
> of the first one (the data for both drop down lists is in a MySQL
> database).  Is this something I need to do in JavaScript?  Or can I
> somehow trick PHP to do this?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Without refreshing the page would require JavaScript, but if it
doesn't matter if the page is refreshed, you could use PHP.
--
Daniel P. Brown


I think he means something like on the nvidia driver download page [1]
This is only possible with javascript, you could take a look at the
page I gave to see how they did it ;)
But Javascript != PHP, so if this is what you want, you're on the wrong list...

Tijnema

[1] http://www.nvidia.com/content/drivers/drivers.asp

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Ashley M. Kirchner

Tijnema wrote:
But Javascript != PHP, so if this is what you want, you're on the 
wrong list...
   Ik weet dat meneer.  But I also hate JavaScript.  So if I can avoid 
it and use PHP, then I will.  Hence me asking here first to see if I can 
get it accomplished with PHP.  :)


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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 20:47 +0200, Tijnema wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > > > >To be a bit easier, I whipped up a quick example on the web.  It's
> > > > > just static images, not a working system, but you'll see what we're
> > > > > getting at here:
> > > > >http://pilotpig.net/captcha-example.php
> > > > >
> > > >
> > > > You could even use a color check here to see which color matches the 
> > > > best ;)
> > > >
> > >
> > > Ah, but that validates my exact point --- the system will see the
> > > overlay over the legitimate cigarette image as being image-synonymous
> > > with the snake as an option by color pattern, while the parent image
> > > matches best with the first child option image in shape.
> >
> > Not as easy as Tijnema thinks... all the icons are in a single image so
> > first he needs to find the icon boundaries to extract them to perform
> > colour analysis. And that can be more or less hard depending on how the
> > icons are merged. For instance using PNG images with alpha transparency
> > so that an overlay and merge looks right would make edge detection of
> > the icon difficult ths making colour analysis difficult.
> 
> Sure, but what if I convert the image first to JPEG or GIF? GIF would
> be the easiest option I think, because if I convert both then I could
> easily count the color of each pixel and you can call the job done. :)

No, I'm talking multiple PNG images. Each icon is a PNG image with
appropriate boundary alpha transparency that hugs the shape. These are
added to the primary display CAPTCHA thus the edges blend nicely with
the master background for the given CAPTCHA in the RESULTING image. Thus
you can convert to GIF all you want... it won't help you with edge
detection / colour analysis.

> > Also, the
> > colour analysis only works in the case where you're presented with an
> > image and asked to pick the same image form the set. It doesn't work in
> > the semantic example where you are asked "which of the following doesn't
> > belong?" :)
> 
> Of course, it was just an easy example, as there could be images
> presented with exactly the same color. Different CAPTCHA program needs
> different kind of hack...

As already stated this particular method employs multiple methods. It
would require multiple approaches and then again would require the
cracking programs knows what constitutes what approach :) Imagery is
much more difficult to crack than simple text. Take 5 pictures of
apples, different apples for fun ;), to each all but one apple add a
smaller sub icon a leaf, again to all but one apple add another
sub-icon, let's say a worm. Finally, let's add one more sub-icon, a pie
( apple pie ;). Now the challenge is:

What icons are present with the apple that doesn't have a leaf.

Good luck :) Pictures within pictures are very complex and then
requiring semantic understanding of those pictures and the question
asked is even harder.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Tijnema

On 6/11/07, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> But Javascript != PHP, so if this is what you want, you're on the
> wrong list...
   Ik weet dat meneer.  But I also hate JavaScript.  So if I can avoid
it and use PHP, then I will.  Hence me asking here first to see if I can
get it accomplished with PHP.  :)


Just keep in mind that PHP is server side, and can't do anything on
the client, except that you can make PHP request calls with ajax, but
then there's still not really PHP involved.

Tijnema





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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > > >To be a bit easier, I whipped up a quick example on the web.  It's
> > > > just static images, not a working system, but you'll see what we're
> > > > getting at here:
> > > >http://pilotpig.net/captcha-example.php
> > > >
> > >
> > > You could even use a color check here to see which color matches the best 
;)
> > >
> >
> > Ah, but that validates my exact point --- the system will see the
> > overlay over the legitimate cigarette image as being image-synonymous
> > with the snake as an option by color pattern, while the parent image
> > matches best with the first child option image in shape.
>
> Not as easy as Tijnema thinks... all the icons are in a single image so
> first he needs to find the icon boundaries to extract them to perform
> colour analysis. And that can be more or less hard depending on how the
> icons are merged. For instance using PNG images with alpha transparency
> so that an overlay and merge looks right would make edge detection of
> the icon difficult ths making colour analysis difficult.

Sure, but what if I convert the image first to JPEG or GIF? GIF would
be the easiest option I think, because if I convert both then I could
easily count the color of each pixel and you can call the job done. :)

> Also, the
> colour analysis only works in the case where you're presented with an
> image and asked to pick the same image form the set. It doesn't work in
> the semantic example where you are asked "which of the following doesn't
> belong?" :)

Of course, it was just an easy example, as there could be images
presented with exactly the same color. Different CAPTCHA program needs
different kind of hack...

Tijnema



   Not to mention the fact that, by the time your processor was able
to count the pixels and compare color similarities to be able to even
get close enough to an educated guess (not counting the
randomly-generated filter color pixels, which I think you're
forgetting), my session would've expired and you'd have to start all
over on a new series of images.

   Which actually brings up an excellent point, if I may say so
myself --- it's not so much of what kind of obfuscation is used in the
CAPTCHA image, as any good Turing robot or OCR software could detect
the sequence almost as well as a human (if not better in some
cases) but it can take a while to do so.  Why not shorten the
session timeout for the page on which it's displayed?

   Have two separate areas --- area one is for registration, data
submission, or whatever you're trying to de-automate; area two is your
CAPTCHA area.  Upon submitting the data, and to verify the
authenticity as a human intending to submit said data, a page is
displayed with four slightly skewed characters on a random background
with a random filter.  The user has 15 seconds to type in the
characters he or she sees.  The only characters which exist are
UPPER-CASE letters ABCDEF.  The user can then easily distinguish which
letter is which, but a robot would only have those fifteen seconds to
do the same.  This means a combination of 6^4, which is 1,296
potential combinations to try to match in 15 seconds or less.

   Not bank-level security, by any means, but something to expand on,
considering I don't think any existing CAPTCHA technology focuses on
time limitations, but rather only on making it more annoying for the
average user to submit form data.


--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Paul Novitski

At 6/11/2007 11:38 AM, Ashley M. Kirchner wrote:
   I have a page containing two drop down lists.  I need to figure 
out a way to populate/update the second drop down list based on a 
selection of the first one (the data for both drop down lists is in 
a MySQL database).  Is this something I need to do in 
JavaScript?  Or can I somehow trick PHP to do this?



I don't think you need to trick PHP -- it will be friendly and 
cooperative as long as you feed it some nice juicy strings from time to time.


The main difference between implementing this in javascript and 
implementing it in PHP is that PHP will require a round-trip to the 
server between menu changes, while javascript will act more immediately.


Because javascript is so commonly disabled, I write the logic first 
in PHP so that everyone can use the page, then again in javascript to 
enhance the experience for folks with scripting enabled.  This is not 
a doubling of work: both scripts can utilize the same datasets (since 
PHP is downloading the page it can feed javascript a version of the 
same data it uses), and both scripts have very similar syntax 
(they're really cousins) so it's possible in many cases to write 
nearly identical logic in key functions, reducing programming, 
debugging, and maintenance time.  This technique is known variously 
as 'unobtrusive javascript' and 'progressive enhancement.'


Regards,

Paul
__

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com 


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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 14:57 -0400, Daniel Brown wrote:
> On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > > > > >To be a bit easier, I whipped up a quick example on the web.  
> > > > > > It's
> > > > > > just static images, not a working system, but you'll see what we're
> > > > > > getting at here:
> > > > > >http://pilotpig.net/captcha-example.php
> > > > > >
> > > > >
> > > > > You could even use a color check here to see which color matches the 
> > > > > best ;)
> > > > >
> > > >
> > > > Ah, but that validates my exact point --- the system will see the
> > > > overlay over the legitimate cigarette image as being image-synonymous
> > > > with the snake as an option by color pattern, while the parent image
> > > > matches best with the first child option image in shape.
> > >
> > > Not as easy as Tijnema thinks... all the icons are in a single image so
> > > first he needs to find the icon boundaries to extract them to perform
> > > colour analysis. And that can be more or less hard depending on how the
> > > icons are merged. For instance using PNG images with alpha transparency
> > > so that an overlay and merge looks right would make edge detection of
> > > the icon difficult ths making colour analysis difficult.
> >
> > Sure, but what if I convert the image first to JPEG or GIF? GIF would
> > be the easiest option I think, because if I convert both then I could
> > easily count the color of each pixel and you can call the job done. :)
> >
> > > Also, the
> > > colour analysis only works in the case where you're presented with an
> > > image and asked to pick the same image form the set. It doesn't work in
> > > the semantic example where you are asked "which of the following doesn't
> > > belong?" :)
> >
> > Of course, it was just an easy example, as there could be images
> > presented with exactly the same color. Different CAPTCHA program needs
> > different kind of hack...
> >
> > Tijnema
> >
> 
> Not to mention the fact that, by the time your processor was able
> to count the pixels and compare color similarities to be able to even
> get close enough to an educated guess (not counting the
> randomly-generated filter color pixels, which I think you're
> forgetting), my session would've expired and you'd have to start all
> over on a new series of images.
> 
> Which actually brings up an excellent point, if I may say so
> myself --- it's not so much of what kind of obfuscation is used in the
> CAPTCHA image, as any good Turing robot or OCR software could detect
> the sequence almost as well as a human (if not better in some
> cases) but it can take a while to do so.  Why not shorten the
> session timeout for the page on which it's displayed?
> 
> Have two separate areas --- area one is for registration, data
> submission, or whatever you're trying to de-automate; area two is your
> CAPTCHA area.  Upon submitting the data, and to verify the
> authenticity as a human intending to submit said data, a page is
> displayed with four slightly skewed characters on a random background
> with a random filter.  The user has 15 seconds to type in the
> characters he or she sees.  The only characters which exist are
> UPPER-CASE letters ABCDEF.  The user can then easily distinguish which
> letter is which, but a robot would only have those fifteen seconds to
> do the same.  This means a combination of 6^4, which is 1,296
> potential combinations to try to match in 15 seconds or less.
> 
> Not bank-level security, by any means, but something to expand on,
> considering I don't think any existing CAPTCHA technology focuses on
> time limitations, but rather only on making it more annoying for the
> average user to submit form data.

OCR is extremely fast. I've done work in the past using OCR and while it
was simple text in documents, the OCR program could extract the text
from the image of a magazine page in about a second. For simplistic
displays of text, or even only slight noise, the OCR will beat human
hands down every time.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Tijnema

On 6/11/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:
> On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > > > >To be a bit easier, I whipped up a quick example on the web.  It's
> > > > > just static images, not a working system, but you'll see what we're
> > > > > getting at here:
> > > > >http://pilotpig.net/captcha-example.php
> > > > >
> > > >
> > > > You could even use a color check here to see which color matches the 
best ;)
> > > >
> > >
> > > Ah, but that validates my exact point --- the system will see the
> > > overlay over the legitimate cigarette image as being image-synonymous
> > > with the snake as an option by color pattern, while the parent image
> > > matches best with the first child option image in shape.
> >
> > Not as easy as Tijnema thinks... all the icons are in a single image so
> > first he needs to find the icon boundaries to extract them to perform
> > colour analysis. And that can be more or less hard depending on how the
> > icons are merged. For instance using PNG images with alpha transparency
> > so that an overlay and merge looks right would make edge detection of
> > the icon difficult ths making colour analysis difficult.
>
> Sure, but what if I convert the image first to JPEG or GIF? GIF would
> be the easiest option I think, because if I convert both then I could
> easily count the color of each pixel and you can call the job done. :)
>
> > Also, the
> > colour analysis only works in the case where you're presented with an
> > image and asked to pick the same image form the set. It doesn't work in
> > the semantic example where you are asked "which of the following doesn't
> > belong?" :)
>
> Of course, it was just an easy example, as there could be images
> presented with exactly the same color. Different CAPTCHA program needs
> different kind of hack...
>
> Tijnema
>

   Not to mention the fact that, by the time your processor was able
to count the pixels and compare color similarities to be able to even
get close enough to an educated guess (not counting the
randomly-generated filter color pixels, which I think you're
forgetting), my session would've expired and you'd have to start all
over on a new series of images.


Do you realize what a quite good machine(Let's say 2.2 Ghz Dual Core)
can do in a few seconds? IIRC, a 2.2Ghz Dual Core machine has 88
Gigaflops, which means it can do 880 commands in 1 second*.
That's enough to analyze the full image and compare the colors with
each other.



   Which actually brings up an excellent point, if I may say so
myself --- it's not so much of what kind of obfuscation is used in the
CAPTCHA image, as any good Turing robot or OCR software could detect
the sequence almost as well as a human (if not better in some
cases) but it can take a while to do so.  Why not shorten the
session timeout for the page on which it's displayed?

   Have two separate areas --- area one is for registration, data
submission, or whatever you're trying to de-automate; area two is your
CAPTCHA area.  Upon submitting the data, and to verify the
authenticity as a human intending to submit said data, a page is
displayed with four slightly skewed characters on a random background
with a random filter.  The user has 15 seconds to type in the
characters he or she sees.  The only characters which exist are
UPPER-CASE letters ABCDEF.  The user can then easily distinguish which
letter is which, but a robot would only have those fifteen seconds to
do the same.  This means a combination of 6^4, which is 1,296
potential combinations to try to match in 15 seconds or less.

   Not bank-level security, by any means, but something to expand on,
considering I don't think any existing CAPTCHA technology focuses on
time limitations, but rather only on making it more annoying for the
average user to submit form data.


--
Daniel P. Brown


Same here, computers are way too fast for these things, and what about
somebody at a dialup connection? it might take 2 seconds to load the
page, 5 seconds for the CAPTCHA image, 7 seconds to type the word, and
3 seconds to submit the page. You would end up in 17 seconds...
Note that typing it in 7 seconds is quite fast, especiall when you
look at people with some kind of handicap...

Tijnema


* At peak performance, and of course there's OS running etc.

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Philip Thompson

On Jun 11, 2007, at 1:52 PM, Jay Blanchard wrote:


[snip]
Without refreshing the page would require JavaScript, but if it
doesn't matter if the page is refreshed, you could use PHP.
[/snip]

Or a combination, using AJAX.



Or you could use CSS and JS. Use PHP to populate all your lists (may  
be time-consuming if you have lots of really large lists) from your  
MySQL database. Only show the first drop-down upon load. Then, based  
off of what's selected in that list, show/hide your other lists as well.


This won't be as "pretty" b/c in the HTML source you'll have lots of  
nasty lists, but it's an option. Good luck!


~Philip

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



Re: [PHP] Updating dropdown list

2007-06-11 Thread Ashley M. Kirchner

Tijnema wrote:

I think he means something like on the nvidia driver download page [1]
This is only possible with javascript, you could take a look at the
page I gave to see how they did it ;)
But Javascript != PHP, so if this is what you want, you're on the 
wrong list...


Tijnema

[1] http://www.nvidia.com/content/drivers/drivers.asp

   Honestly, that's overkill.  Though elegant, I don't need something 
like that.  Just a drop down that allows one to pick names, and when 
picked it would update a second drop down (on the same page) with events 
related to that name.  Then one can pick one of those events and hit a 
submit button to trigger an external script.


--
W | It's not a bug - it's an undocumented feature.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Imaging   . 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 


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



[PHP] call to undefined function which is defined

2007-06-11 Thread Bing Du
Hi,

RHEL 4
PHP 4.3.9
Apache 2.0.52

Without knowing much about the web application we use, can anybody tell me
what kind of situation could trigger the following 'call to undefined
function' error?

PHP Fatal error:  Call to undefined function:  encryptchar
code() in /data/www/html/typo3_src/typo3/sysext/cms/tslib/class.tslib_fe.p
hp on line 3439

Line 3439 is:

$out .= $this->encryptCharcode($charValue,0x61,0x7A,$offset);

Here is the function block that has line 3439.

function encryptEmail($string,$back=0)  {
$out = '';

if ($this->spamProtectEmailAddresses === 'ascii') {
for ($a=0; $aspamProtectEmailAddresses)*($back?-1:1);
for ($i=0; $i<$len; $i++)   {
$charValue = ord($string{$i});
if ($charValue >= 0x2B && $charValue <=
0x3A)   {   // 0-9 . , - + / :
$out .=
$this->encryptCharcode($charValue,0x2B,0x3A,$offset);
} elseif ($charValue >= 0x40 && $charValue
<= 0x5A) {   // A-Z @
$out .=
$this->encryptCharcode($charValue,0x40,0x5A,$offset);
} else if ($charValue >= 0x61 &&
$charValue <= 0x7A){   // a-z
$out .=
$this->encryptCharcode($charValue,0x61,0x7A,$offset);
} else {
$out .= $string{$i};
}
}
}
return $out;
}

And the encryptCharcode() function the fatal error complained about is
defined right before encrytEmail().

==
 function encryptCharcode($n,$start,$end,$offset){
$n = $n + $offset;
if ($offset > 0 && $n > $end)   {
$n = $start + ($n - $end - 1);
} else if ($offset < 0 && $n < $start)  {
$n = $end - ($start - $n - 1);
}
return chr($n);
}
==

I don't understand why the error is about a function that's defined fine??

Thanks in advance for any help,

Bing

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Daniel Brown

On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/11/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/11/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > On Mon, 2007-06-11 at 14:29 -0400, Daniel Brown wrote:
> > > > > >To be a bit easier, I whipped up a quick example on the web.  
It's
> > > > > > just static images, not a working system, but you'll see what we're
> > > > > > getting at here:
> > > > > >http://pilotpig.net/captcha-example.php
> > > > > >
> > > > >
> > > > > You could even use a color check here to see which color matches the 
best ;)
> > > > >
> > > >
> > > > Ah, but that validates my exact point --- the system will see the
> > > > overlay over the legitimate cigarette image as being image-synonymous
> > > > with the snake as an option by color pattern, while the parent image
> > > > matches best with the first child option image in shape.
> > >
> > > Not as easy as Tijnema thinks... all the icons are in a single image so
> > > first he needs to find the icon boundaries to extract them to perform
> > > colour analysis. And that can be more or less hard depending on how the
> > > icons are merged. For instance using PNG images with alpha transparency
> > > so that an overlay and merge looks right would make edge detection of
> > > the icon difficult ths making colour analysis difficult.
> >
> > Sure, but what if I convert the image first to JPEG or GIF? GIF would
> > be the easiest option I think, because if I convert both then I could
> > easily count the color of each pixel and you can call the job done. :)
> >
> > > Also, the
> > > colour analysis only works in the case where you're presented with an
> > > image and asked to pick the same image form the set. It doesn't work in
> > > the semantic example where you are asked "which of the following doesn't
> > > belong?" :)
> >
> > Of course, it was just an easy example, as there could be images
> > presented with exactly the same color. Different CAPTCHA program needs
> > different kind of hack...
> >
> > Tijnema
> >
>
>Not to mention the fact that, by the time your processor was able
> to count the pixels and compare color similarities to be able to even
> get close enough to an educated guess (not counting the
> randomly-generated filter color pixels, which I think you're
> forgetting), my session would've expired and you'd have to start all
> over on a new series of images.

Do you realize what a quite good machine(Let's say 2.2 Ghz Dual Core)
can do in a few seconds? IIRC, a 2.2Ghz Dual Core machine has 88
Gigaflops, which means it can do 880 commands in 1 second*.
That's enough to analyze the full image and compare the colors with
each other.

>
>Which actually brings up an excellent point, if I may say so
> myself --- it's not so much of what kind of obfuscation is used in the
> CAPTCHA image, as any good Turing robot or OCR software could detect
> the sequence almost as well as a human (if not better in some
> cases) but it can take a while to do so.  Why not shorten the
> session timeout for the page on which it's displayed?
>
>Have two separate areas --- area one is for registration, data
> submission, or whatever you're trying to de-automate; area two is your
> CAPTCHA area.  Upon submitting the data, and to verify the
> authenticity as a human intending to submit said data, a page is
> displayed with four slightly skewed characters on a random background
> with a random filter.  The user has 15 seconds to type in the
> characters he or she sees.  The only characters which exist are
> UPPER-CASE letters ABCDEF.  The user can then easily distinguish which
> letter is which, but a robot would only have those fifteen seconds to
> do the same.  This means a combination of 6^4, which is 1,296
> potential combinations to try to match in 15 seconds or less.
>
>Not bank-level security, by any means, but something to expand on,
> considering I don't think any existing CAPTCHA technology focuses on
> time limitations, but rather only on making it more annoying for the
> average user to submit form data.
>
>
> --
> Daniel P. Brown

Same here, computers are way too fast for these things, and what about
somebody at a dialup connection? it might take 2 seconds to load the
page, 5 seconds for the CAPTCHA image, 7 seconds to type the word, and
3 seconds to submit the page. You would end up in 17 seconds...
Note that typing it in 7 seconds is quite fast, especiall when you
look at people with some kind of handicap...

Tijnema


* At peak performance, and of course there's OS running etc.



   Yes, but I don't think you understand that it was just an idea in
the infantile stages.  I'm going to try to knock out a
proof-of-concept later this week if I can to bring some of it
together.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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

Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 16:37 -0400, Daniel Brown wrote:
> On 6/11/07, Tijnema <[EMAIL PROTECTED]> wrote:
> >
> > * At peak performance, and of course there's OS running etc.
> >
> 
> Yes, but I don't think you understand that it was just an idea in
> the infantile stages.  I'm going to try to knock out a
> proof-of-concept later this week if I can to bring some of it
> together.

Something to perhaps think about... create a way to assign tags to icons
that provide grouping information. For instance a pencil might have:

Pencil:

writing, sticklike

Pen:

writing, sticklike

Crayon:

writing, sticklike

Marker:

writing, sticklike

Fork:

eating, sticklike

Then you can use a query to select a specific group (if you play "which
of these isn't like the others").  For instance:

likeType   = SELECT name FROM tag_types order by rand() limit 1;
unlikeType = SELECT name FROM tag_types where name <> likeType order
by rand() limit 1;

Then we can pick group alike icons using (pseudocode queries ;)

SELECT icon FROM icons where HAS_TAG( likeType ) and NOT
HAS_TAG( unlikeType );

And finally:

SELECT icon from icons where HAS_TAG( unlikeType ) and NOT
HAS_TAG( likeType )

So now without actually manually creating questions we could generate
the following questions dynamically:

Which of the above items is not for writing?
Which of the above items is not like the others?
Which of the above items is for eating?

I cheated in the above, it would be nice to know if a tag is an
adjective or verb so that you can form the English properly :)

Anyways, just some thoughts.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'


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



[PHP] Re: "tail" solution for PHP5 wanted

2007-06-11 Thread Darren Whitlen

Michelle Konzack wrote:

*
* Do not Cc: me, because I am on THIS list, if I write here.*
* Keine Cc: an mich, bin auf DIESER Liste wenn ich hier schreibe.   *
* Ne me mettez pas en Cc:, je suis sur CETTE liste, si j'ecris ici. *
*

Hello, 


I am working again on my PHP Admin interace an need a "tail"
solution in PHP5 to show "fetchmail" and "procmail" in realtime.

Does anyone have done this already and if yes, how?

My ADSL router can do this but it use a crapy JavaScript which can
show only logs UNDER 100 lines since it refresh the whole page
once a second but I need at least the last 500 lines of logfiles.

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant




read the file, and save the last position you read from in a session. 
when the page reloads, carry on reading from the saved position.


Darren

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



Re: [PHP] Persistent MySQL Connection

2007-06-11 Thread Richard Lynch
On Mon, June 11, 2007 12:53 pm, PHP Mailing List wrote:
> Can I maintain just one mysql connection resource to all my pages per
> user session. As far as I knows create connection is more expensive
> than
> executing queries ?
>
> Any reference how to make efficient for connection resources ?

Yes, no, sort of.

mysql_pconnect will allow MySQL to re-use a connection *IF*:
  same user/password is asking for the connection
  same process (Apache child, or FCGI process) is asking for connection

Thus, you will need to take the number of Apache children, times the
number of username/password in MySQL, and have enough RAM and
configure MySQL to allow enough concurrent connections for that
number.

You also want a few "extra" connections in case you need to access
MySQL from the shell for backups, and admin tasks.

It turns out to be not that useful for many applications, but still is
for some.

I suspect the connection is expensive because MySQL has to do a heck
of a lot of work in the areas of authentication, locking, and data
integrity per connection...  Ain't no way you're gonna want to bypass
any of that, really...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] "tail" solution for PHP5 wanted

2007-06-11 Thread Richard Lynch
On Mon, June 11, 2007 11:37 am, Michelle Konzack wrote:
> * Do not Cc: me, because I am on THIS list, if I write here.*

Actually, not everybody who posts here is subscribed... :-v

But I did remember to not Cc: you this time.

> I am working again on my PHP Admin interace an need a "tail"
> solution in PHP5 to show "fetchmail" and "procmail" in realtime.
>
> Does anyone have done this already and if yes, how?
>
> My ADSL router can do this but it use a crapy JavaScript which can
> show only logs UNDER 100 lines since it refresh the whole page
> once a second but I need at least the last 500 lines of logfiles.


  

  
  

  



>
> Greetings
> Michelle Konzack
> Systemadministrator
> Tamay Dogan Network
> Debian GNU/Linux Consultant
>
>
> --
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> # Debian GNU/Linux Consultant
> #
> Michelle Konzack   Apt. 917  ICQ #328449886
>50, rue de Soultz MSN LinuxMichi
> 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] [RFC] HTTP timezone

2007-06-11 Thread Richard Lynch
On Mon, June 11, 2007 9:05 am, Stefanos Harhalakis wrote:
>   There is no need to include the DST information since when on DST
> the client
> will be sending the propper offset. For example, EET+2EEST is +0200
> during
> winter and +0300 during DST.

I think you are over-simplifying things too much...

I do not believe that users will be sending the correct offset during
DST.

Especially not during the actual change-over time/day.

And, of course, users living in/near areas that don't use DST will
probably have issues.

And you can just about write off any laptop users who travel.

I don't reset my clock on my laptop as I travel through each timezone,
or even if I'm staying somewhere for anything less than a couple
weeks.

So your server-side will be converting to a date-time which is pretty
irrelevant, really.

>   Hope this clears things a bit...
>
>   By the way, what makes you think that most people have an invalid
> timezone
> configured? Windows XP have NTP support that is enabled by default.

It's not that MOST people have improper timezone.

It's that ENOUGH people have improper timezone (and clock as well)
that you'll not be able to make this useful.

Now if you wanna write an RFC to just do away with DST completely,
sign me up! :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Re: Not getting expected result from file()

2007-06-11 Thread Richard Lynch
trim is probably sub-optimal, as you MIGHT have leading/trailing
whitespace as part of the actual data at some point.

You should trim off ONLY one last newline character, no more, no less.

I dunno why it's not working still though...

On Mon, June 11, 2007 12:14 am, kvigor wrote:
> OK, I trimmed the elements in the array. using var_dump() it shows
> strings
> are identical, however nothing is storing in DB still.
>
> view new code
> =//doesn't store in central still,
> also
> shows no MySQL errors.
> $theFileArray = file('C:\htdocs\folder1\file.txt');
>
> function trim_value(&$value)
> {
> $value = trim($value);
> }
>
> array_walk($theFileArray, 'trim_value');
>
>
> if(isset($_POST['strName'], $_POST['strCity'], $_POST['strState']))
> {
>  $space = " ";
>  $stringOne = $_POST['strName']. $space. $_POST['strCity']. $space .
> $_POST['strState'];
>
> }
>  if(in_array($storeInfo, $theFileArray))
>  {
>   $queryCentral = "INSERT INTO central (conName, conAddress, conCity,
> conState, conZip, conPhone, schName, schAddress, schCity, schState,
> schZip,
> strName, strCity, strState) VALUES('$regName', '$regAddress',
> '$regCity',
> '$regState', '$regZip', '$regPhone', '$sclName', '$sclAddress',
> '$sclCity',
> '$sclState', '$sclZip', '$stoName', '$stoCity', '$stoState')";
>
>   mysql_query($queryCentral, $connection) or die("Query failed: ".
> mysql_error($connection));
>  }
>
>
> else
> {
> $queryUnknown = "INSERT INTO unknown (conName, conAddress, conCity,
> conState, conZip, conPhone, schName, schAddress, schCity, schState,
> schZip,
> strName, strCity, strState) VALUES('$regName', '$regAddress',
> '$regCity',
> '$regState', '$regZip', '$regPhone', '$sclName', '$sclAddress',
> '$sclCity',
> '$sclState', '$sclZip', '$stoName', '$stoCity', '$stoState')";
> mysql_query($queryUnknown, $connection) or die("Query failed: ".
> mysql_error($connection));
> }
> =
>
> "David Robley" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> kvigor wrote:
>>
>>> Hello,
>>>
>>> I'm using the file function create an array.  I'm using a value
>>> from a
>>> form to see if it matches in elements in the array.
>>>
>>> My problem is I expect  the condition to be true but info but my DB
>>> isn't
>>> populated as I in the right DB...
>>> =Code
>>> Begins==
>>> $theFileArray = file('C:\htdocs\folder1\file.txt');
>>>
>>
>> Your problem starts here - file returns the file in an array. Each
>> element
>> of the array corresponds to a line in the file, with the newline
>> still
>> attached. When you compare to a string without the newline at the
>> end, the
>> comparison fails.
>>
>> If you have php > 5.0.0 you can use the FILE_IGNORE_NEW_LINES flag
>> in the
>> file() arguments, otherwise use trim() to remove trailing whitespace
>> from
>> the array elements.
>>
>>
>>
>> Cheers
>> --
>> David Robley
>>
>> "I hate playing craps," Tom said dicily.
>> Today is Boomtime, the 16th day of Confusion in the YOLD 3173.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] call to undefined function which is defined

2007-06-11 Thread Jim Lucas

Bing Du wrote:

Hi,

RHEL 4
PHP 4.3.9
Apache 2.0.52

Without knowing much about the web application we use, can anybody tell me
what kind of situation could trigger the following 'call to undefined
function' error?

PHP Fatal error:  Call to undefined function:  encryptchar
code() in /data/www/html/typo3_src/typo3/sysext/cms/tslib/class.tslib_fe.p
hp on line 3439

Line 3439 is:

$out .= $this->encryptCharcode($charValue,0x61,0x7A,$offset);

Here is the function block that has line 3439.

function encryptEmail($string,$back=0)  {
$out = '';

if ($this->spamProtectEmailAddresses === 'ascii') {
for ($a=0; $aspamProtectEmailAddresses)*($back?-1:1);
for ($i=0; $i<$len; $i++)   {
$charValue = ord($string{$i});
if ($charValue >= 0x2B && $charValue <=
0x3A)   {   // 0-9 . , - + / :
$out .=
$this->encryptCharcode($charValue,0x2B,0x3A,$offset);
} elseif ($charValue >= 0x40 && $charValue
<= 0x5A) {   // A-Z @
$out .=
$this->encryptCharcode($charValue,0x40,0x5A,$offset);
} else if ($charValue >= 0x61 &&
$charValue <= 0x7A){   // a-z
$out .=
$this->encryptCharcode($charValue,0x61,0x7A,$offset);
} else {
$out .= $string{$i};
}
}
}
return $out;
}

And the encryptCharcode() function the fatal error complained about is
defined right before encrytEmail().

==
 function encryptCharcode($n,$start,$end,$offset){
$n = $n + $offset;
if ($offset > 0 && $n > $end)   {
$n = $start + ($n - $end - 1);
} else if ($offset < 0 && $n < $start)  {
$n = $end - ($start - $n - 1);
}
return chr($n);
}
==

I don't understand why the error is about a function that's defined fine??

Thanks in advance for any help,

Bing

you are calling it as a method to an object.  Is it actually defined within that object or a parent 
object??


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Going from simple to super CAPTCHA

2007-06-11 Thread Richard Lynch
On Mon, June 11, 2007 12:59 pm, Daniel Brown wrote:
>> > http://pilotpig.net/captcha-example.php

I would be hard-pressed to answer correctly, I think.

Which doesn't matter.

Any multiple-choice CAPTCHA is pointless.

Spammers would consider at 33% success ratio WONDERFUL.

Their entire business model is based on much worse odds than that!

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] MySQL UTF-8 vs Extended ASCII

2007-06-11 Thread Richard Lynch
This may actually be a MySQL question...

Or not.

I'm scraping about 55,000 pages from a website into a MySQL database.

Some of these pages have "extended ASCII" values in their content, or,
in some cases, just plain junk ASCII values, as far as I can tell.

For example, decimal 163 is sometimes used to represent the UK
monetary symbol for a Pound.

Unforunately, when I insert/update the text into the database, the
text is chopped off, as far as I can tell, at any extended ASCII
value.

Now, I've set things up for UTF-8, expressly to avoid this kind of
problem, I thought:

  var_dump(mysql_get_server_info($connection));
  var_dump(mysql_get_client_info());
  var_dump(mysql_client_encoding($connection));

string(10) "5.0.26-log"
string(6) "5.0.26"
string(4) "utf8"

I'm open to any advice about the correct solution to convert "extended
ASCII" as typed in emails by tens of thousands of users on diverse
systems, from diverse countries...

Note that "extended ASCII" is inconsistent from Microsoft to Apple to
Unix to ..., as far as I understand it, so I really can't be sure
which charset the original user was using.

Of course, for now, I'll just change any extended ASCII into space and
move on with life...  But that is not what I would like to end up with
in the long run.

And why is MySQL not just taking these extended ASCII chars in the
first place?  Seems to me that UTF-8 encoding should accept them, no?

Disclaimer: I am so NOT hip to this encoding stuff...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] MySQL UTF-8 vs Extended ASCII

2007-06-11 Thread Larry Garfield
The underlying problem is that there is no one "Extended ASCII".  There's a 
dozen or so different schemes for the 129-255 range, all of them 
incompatible.  That's why Unicode now exists. :-)

I've been tracking this issue myself on my blog, which may be of background 
use for you (especially some of the pages I link, which give more theoretical 
background):

http://www.garfieldtech.com/blog/stupid-quotes
http://www.garfieldtech.com/blog/more-on-stupid-quotes
http://www.garfieldtech.com/blog/unicode-8-vs-16

Odds are that the pages you're scraping are saved as ISO 8859-1, but actually 
contain Windows-1252.  If you try to save Windows-1252 as UTF-8, then the 
characters in the extended range (129-255) will get mangled.  

You may find this useful:
http://us.php.net/manual/en/function.mb-convert-encoding.php

It is frequently reasonably good at guessing the incoming character set, at 
least the one time we used it at work.  Try running all pages/strings through 
that first before sending them to the database to convert everything to 
UTF-8.  

You should also make sure that not only is the MySQL connection set to UTF-8, 
the tables and columns themselves are, too.  MySQL lets you vary the encoding 
by table and field, so you should check to make sure that *everything* is 
UTF-8 explicitly.

Cheers.

PS: The free copy of php|architect from php|tek had a really good article on 
Unicode.  Even if you don't read anything else from that issue, read 
that. :-)

On Monday 11 June 2007, Richard Lynch wrote:
> This may actually be a MySQL question...
>
> Or not.
>
> I'm scraping about 55,000 pages from a website into a MySQL database.
>
> Some of these pages have "extended ASCII" values in their content, or,
> in some cases, just plain junk ASCII values, as far as I can tell.
>
> For example, decimal 163 is sometimes used to represent the UK
> monetary symbol for a Pound.
>
> Unforunately, when I insert/update the text into the database, the
> text is chopped off, as far as I can tell, at any extended ASCII
> value.
>
> Now, I've set things up for UTF-8, expressly to avoid this kind of
> problem, I thought:
>
>   var_dump(mysql_get_server_info($connection));
>   var_dump(mysql_get_client_info());
>   var_dump(mysql_client_encoding($connection));
>
> string(10) "5.0.26-log"
> string(6) "5.0.26"
> string(4) "utf8"
>
> I'm open to any advice about the correct solution to convert "extended
> ASCII" as typed in emails by tens of thousands of users on diverse
> systems, from diverse countries...
>
> Note that "extended ASCII" is inconsistent from Microsoft to Apple to
> Unix to ..., as far as I understand it, so I really can't be sure
> which charset the original user was using.
>
> Of course, for now, I'll just change any extended ASCII into space and
> move on with life...  But that is not what I would like to end up with
> in the long run.
>
> And why is MySQL not just taking these extended ASCII chars in the
> first place?  Seems to me that UTF-8 encoding should accept them, no?
>
> Disclaimer: I am so NOT hip to this encoding stuff...
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] MySQL UTF-8 vs Extended ASCII

2007-06-11 Thread Richard Lynch
On Mon, June 11, 2007 7:34 pm, Larry Garfield wrote:
> You may find this useful:
> http://us.php.net/manual/en/function.mb-convert-encoding.php
>
> It is frequently reasonably good at guessing the incoming character
> set, at
> least the one time we used it at work.  Try running all pages/strings
> through
> that first before sending them to the database to convert everything
> to
> UTF-8.

I'll give that a shot, if I have mb installed...

> You should also make sure that not only is the MySQL connection set to
> UTF-8,
> the tables and columns themselves are, too.  MySQL lets you vary the
> encoding
> by table and field, so you should check to make sure that *everything*
> is
> UTF-8 explicitly.

The table is:

ENGINE=InnoDB DEFAULT CHARSET=utf8

I'd be ecstatic if the characters were just getting mangled -- The
TRUNCATION of the data is what's killing me, and which is "unexpected
behaviour" to my mind.

> PS: The free copy of php|architect from php|tek had a really good
> article on
> Unicode.  Even if you don't read anything else from that issue, read
> that. :-)

I am behind on my reading for some odd reason... :-v

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] What can cause session_destroy to fail?

2007-06-11 Thread Mattias Thorslund
Hi,

One of my clients just received a PHP warning that session_destroy()
failed. Using the default session handler (with tmp files), what are the
most likely things that can cause session_destroy() to return false?

Thanks for any suggestions.

Mattias

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



[PHP] weird. iceweasel crash my laptop after i use costum sessions

2007-06-11 Thread jeffry s

i am using my laptop with PHP 4+ and mysql 5+, everything start to be weird
after i implement my costume sessions (storing in database).
i only use one database connection for the whole website.
what i mean is, the session and every query connect to mysqlserver using the
same user.

I am not sure if it is because of the sessions. but it happen after i use
costume sessions.

if i make a SQL query with non existant column name eg: noe

SELECT * FROM test WHERE noe=1;

Suddenly, if i use top to monitor process on my laptop i saw the processor
usage for the mysqld and firefox-bin(iceweasel) increasing.
Icewasel will continue to consume processor usage to 100% and memory up to
80% all the time.

Worst still, the mouse, keyboard do not work anymore. My laptop very-very
slow until i cannot move my mouse cursor at all..

there is no way i can go except turn off the laptop power.

I don't know what the problem is this. but, i think there is something to do
with the sessions. And it related to PHP or may be problem with Iceweasel.
I will try to ask debian mailing list for this.

In case anyone experience the same thing. please let me know how you fix it.


Re: [PHP] Login page error

2007-06-11 Thread Robert Cummings
On Mon, 2007-06-11 at 21:28 -0500, Humani Power wrote:
>
> [-- SNIIP --]
>
> I have searched for possible answers, and all I have found is that I
> should not send any output before the session_start(); But in this
> code the session_start(); output is before anything else.
> can you give me a tip?

Look through the source files and make sure you have no spaces or
content preceding 

These count as output.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Login page error

2007-06-11 Thread Janet Valade
The error comes from having output before the session_start(). This 
means that anything before the space.


Janet


Humani Power wrote:


Hi! Im trying to make a login page. I have searched for examples that makes
me check the user name with a database, and the one that suits better is
this code.






Login



" method="POST">
Members only. Please login to access this document.


 
Username:
 
 

 


 
Password:
 
 

 


 


 





" method="POST">
Incorrect login information, please try again. You
must login to access this document.


 
Username:
 
 

 


 
Password:
 
 

 


 


 







After this, I have only included on a file that has this code




But when I try to see it in a browser I got the error


*Warning*:  session_start() [function.session-start
]: Cannot
send session cache limiter - headers already sent (output started at
/var/www/apache2-default/visual_imag.php:2) in
*/var/www/apache2-default/connection/login.php* on line *2

I have searched for possible answers, and all I have found is that I
should not send any output before the session_start(); But in this
code the session_start(); output is before anything else.
can you give me a tip?

Thanks in advance.
Yamil
*




--
Janet Valade -- janet.valade.com

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



[PHP] Re: Not getting expected result from file()

2007-06-11 Thread kvigor
Found out the issue this afternoon.  I realized that my .txt file was tab 
delimited and not space delimited.  So I changed $space to equal $tab and 
query was successful! All is working now. Thanks to all who replied.  I 
appreciate all.

"David Robley" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> kvigor wrote:
>
>> Hello,
>>
>> I'm using the file function create an array.  I'm using a value from a
>> form to see if it matches in elements in the array.
>>
>> My problem is I expect  the condition to be true but info but my DB isn't
>> populated as I in the right DB...
>> =Code
>> Begins==
>> $theFileArray = file('C:\htdocs\folder1\file.txt');
>>
>
> Your problem starts here - file returns the file in an array. Each element
> of the array corresponds to a line in the file, with the newline still
> attached. When you compare to a string without the newline at the end, the
> comparison fails.
>
> If you have php > 5.0.0 you can use the FILE_IGNORE_NEW_LINES flag in the
> file() arguments, otherwise use trim() to remove trailing whitespace from
> the array elements.
>
>
>
> Cheers
> -- 
> David Robley
>
> "I hate playing craps," Tom said dicily.
> Today is Boomtime, the 16th day of Confusion in the YOLD 3173. 

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



Re: [PHP] What can cause session_destroy to fail?

2007-06-11 Thread Jim Lucas

Mattias Thorslund wrote:

Hi,

One of my clients just received a PHP warning that session_destroy()
failed. Using the default session handler (with tmp files), what are the
most likely things that can cause session_destroy() to return false?

Thanks for any suggestions.

Mattias


The session was never initiated on that page with session_start() ??

on this page

http://us.php.net/manual/en/function.session-destroy.php

the first couple comments talk about different ways that the 
session_destroy() function call mail fail?  Any sound close?


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



[PHP] Persistent MySQL Connection

2007-06-11 Thread PHP Mailing List

Can I maintain just one mysql connection resource to all my pages per
user session. As far as I knows create connection is more expensive than
executing queries ?

Any reference how to make efficient for connection resources ?

Thanks,

Dino

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