[PHP] PHP 4.4.8 Released!

2008-01-03 Thread Derick Rethans
Hello!

The PHP development team would like to announce the immediate 
availability of PHP 4.4.8. It continues to improve the security and the 
stability of the 4.4 branch and all users are strongly encouraged to 
upgrade to it as soon as possible. This release wraps up all the 
outstanding patches for the PHP 4.4 series, and is therefore the last 
normal PHP 4.4 release. If necessary, releases to address security 
issues could be made until 2008-08-08.

A separate release announcement is also available. For changes in PHP 
4.4.8 since PHP 4.4.7, please consult the PHP 4 ChangeLog. 

Release Announcement: http://www.php.net/release_4_4_8.php
Downloads:http://www.php.net/downloads.php#v4
Changelog:http://www.php.net/ChangeLog-4.php#4.4.8

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org

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



[PHP] mysql date question

2008-01-03 Thread Adam Williams

I have a field in mysql as shown by describe contract;

| length_start | date| YES  | | NULL
||


Which stores it in the mysql format of -MM-DD.  However, I need the 
output of my select statement to show it in MM-DD- format.  I can 
select it to see the date in the field:


select length_start from contract where user_id = 1;
+--+
| length_start |
+--+
| 2006-01-12   |
+--+
1 row in set (0.00 sec)

so then I do my date_format() select statement, but it returns a NULL 
value.  Why?


select date_format('contract.length_start', '%m-%d-%Y') as length_start 
from contract where user_id = 1;

+--+
| length_start |
+--+
| NULL |
+--+
1 row in set, 1 warning (0.00 sec)

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



Re: [PHP] mysql date question

2008-01-03 Thread Stut

Adam Williams wrote:
select date_format('contract.length_start', '%m-%d-%Y') as length_start 
from contract where user_id = 1;


This has nothing to do with PHP, but the first parameter to date_format 
should not be in quotes.


-Stut

--
http://stut.net/

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



[PHP] Re: mysql date question

2008-01-03 Thread Adam Williams
nevermind, figure it out, had to take the ' ' away from 
contract.length_start :)


Adam Williams wrote:

I have a field in mysql as shown by describe contract;

| length_start | date| YES  | | NULL
||


Which stores it in the mysql format of -MM-DD.  However, I need 
the output of my select statement to show it in MM-DD- format.  I 
can select it to see the date in the field:


select length_start from contract where user_id = 1;
+--+
| length_start |
+--+
| 2006-01-12   |
+--+
1 row in set (0.00 sec)

so then I do my date_format() select statement, but it returns a NULL 
value.  Why?


select date_format('contract.length_start', '%m-%d-%Y') as 
length_start from contract where user_id = 1;

+--+
| length_start |
+--+
| NULL |
+--+
1 row in set, 1 warning (0.00 sec)




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



RE: [PHP] mysql date question

2008-01-03 Thread Bastien Koert

no need for quotes
 
select date_format(contract.length_start, '%m-%d-%Y') as length_start from 
contract where user_id = 1;
 
bastien
 Date: Thu, 3 Jan 2008 08:30:55 -0600 From: [EMAIL PROTECTED] To: 
 php-general@lists.php.net Subject: [PHP] mysql date question  I have a 
 field in mysql as shown by describe contract;  | length_start | date | YES 
 | | NULL  | |  Which stores it in the mysql format of -MM-DD. However, 
 I need the  output of my select statement to show it in MM-DD- format. I 
 can  select it to see the date in the field:  select length_start from 
 contract where user_id = 1; +--+ | length_start | 
 +--+ | 2006-01-12 | +--+ 1 row in set (0.00 sec) 
  so then I do my date_format() select statement, but it returns a NULL  
 value. Why?  select date_format('contract.length_start', '%m-%d-%Y') as 
 length_start  from contract where user_id = 1; +--+ | 
 length_start | +--+ | NULL | +--+ 1 row in set, 1 
 warning (0.00 sec)  --  PHP General Mailing List (http://www.php.net/) To 
 unsubscribe, visit: http://www.php.net/unsub.php 
_
Discover new ways to stay in touch with Windows Live! Visit the City @ Live 
today!
http://getyourliveid.ca/?icid=LIVEIDENCA006

RE: [PHP] mysql date question

2008-01-03 Thread Jay Blanchard
[snip]
I have a field in mysql as shown by describe contract;

| length_start | date| YES  | | NULL
||

Which stores it in the mysql format of -MM-DD.  However, I need the 
output of my select statement to show it in MM-DD- format.  I can 
select it to see the date in the field:

select length_start from contract where user_id = 1;
+--+
| length_start |
+--+
| 2006-01-12   |
+--+
1 row in set (0.00 sec)

so then I do my date_format() select statement, but it returns a NULL 
value.  Why?

select date_format('contract.length_start', '%m-%d-%Y') as length_start 
from contract where user_id = 1;
+--+
| length_start |
+--+
| NULL |
+--+
1 row in set, 1 warning (0.00 sec)
[/snip]


Actually this is more a question for the MySQL list.

Start first by taking the ticks or quotes off of the column;

select date_format(contract.length_start, '%m-%d-%Y') as length_start 
from contract where user_id = 1;

You are essentially trying to turn that text string into a date, it will
not work.

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



[PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Balaji A
Hi,

I have a table with the below fields. (id, title, language, author 
link to the book).

Initially I want to display a page with 3 select boxes (language,
author  title).

Initially first select box displays the available language by querying
the database. On selecting one language, author select box should show
the matching records from the database. After selecting the author,
matching records should display in title.


Could any body send the sample script files with 3 select boxes?

Thanks
Balaji

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



Re: [PHP] mysql date question

2008-01-03 Thread Silvio Porcellana

Uhm, a shot in the dark - try:
select date_format(contract.length_start, '%m-%d-%Y') as length_start

HTH, cheers!
Silvio

Adam Williams wrote:

I have a field in mysql as shown by describe contract;

| length_start | date| YES  | | NULL
||


Which stores it in the mysql format of -MM-DD.  However, I need the 
output of my select statement to show it in MM-DD- format.  I can 
select it to see the date in the field:


select length_start from contract where user_id = 1;
+--+
| length_start |
+--+
| 2006-01-12   |
+--+
1 row in set (0.00 sec)

so then I do my date_format() select statement, but it returns a NULL 
value.  Why?


select date_format('contract.length_start', '%m-%d-%Y') as length_start 
from contract where user_id = 1;

+--+
| length_start |
+--+
| NULL |
+--+
1 row in set, 1 warning (0.00 sec)



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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Robert Cummings
On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,
 
 I have a table with the below fields. (id, title, language, author 
 link to the book).
 
 Initially I want to display a page with 3 select boxes (language,
 author  title).
 
 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?

Anything else you'd like to add to the requirements document?

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-03 Thread Nisse Engström
On Wed, 2 Jan 2008 19:36:56 -0500, tedd wrote:

 To find out, I did put the operation through FireFox and reversed the 
 POST/GET operations to get a look at the string -- it is:
 
 %C2%A0%C2%A0%C2%A0Z%C2%A0%C2%A0%C2%A0   where Z is the value passed.
 
 Now, C2 (HEX) is a linefeed (194 DEC)
 
 And, A0 (HEX) is a non-breaking space (160 DEC;) which is a nbsp;

Not quite. A0 is non-breaking space in *some* character
encodings, such as the ISO-8859-... encodings. It may
be different in other encodings. In UTF-8, it is C2 A0,
which is exactly what you're seing.

 Therefore, if I simply use:
 
 $submit = str_replace( chr(194), '', $submit );
 $submit = str_replace( chr(160), '', $submit );
 
 This is the solution.

Hardly.

 Now, why does a POST operation add in C2's?  I'll leave that for 
 another post. :-)

I haven't had time to look at the code, but perhaps you
need to specify a character encoding for the page.


/Nisse

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jim Lucas
Robert Cummings wrote:
 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?
 
 Anything else you'd like to add to the requirements document?
 
 Cheers,
 Rob.

I would think it be best if it was javascript based so it dynamically loads the 
data via AJAX or a
predefined JS hash, but then when JS was disabled, it would be best if it fell 
back to old school
and submitted the form when I select the lang-auth-book.

Thanks

-- 
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] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jochem Maas
Robert Cummings schreef:
 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?
 
 Anything else you'd like to add to the requirements document?

no - he'll be happy if you just get on and complete the sample script as 
requested asap.
as you know it's urgent. ;-)

 
 Cheers,
 Rob.

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jim Lucas
Jochem Maas wrote:
 Robert Cummings schreef:
 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?
 Anything else you'd like to add to the requirements document?
 
 no - he'll be happy if you just get on and complete the sample script as 
 requested asap.
 as you know it's urgent. ;-)
 

YOU need to make sure the OP meets their deadline.  Now quit waisting time 
reading these email mails
and get to work!

 Cheers,
 Rob.
 


-- 
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] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Balaji A
Hi

Thanks for the replies. :-)

Robert I do not mean hear to write a new script for me and send..
Requesting if you have any sample file to share..

But any way thanks a lot for the replies.

Thanks
Balaji

On Jan 3, 2008 9:41 AM, Jim Lucas [EMAIL PROTECTED] wrote:

 Jochem Maas wrote:
  Robert Cummings schreef:
  On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
  Hi,
 
  I have a table with the below fields. (id, title, language, author 
  link to the book).
 
  Initially I want to display a page with 3 select boxes (language,
  author  title).
 
  Initially first select box displays the available language by querying
  the database. On selecting one language, author select box should show
  the matching records from the database. After selecting the author,
  matching records should display in title.
 
  Could any body send the sample script files with 3 select boxes?
  Anything else you'd like to add to the requirements document?
 
  no - he'll be happy if you just get on and complete the sample script as 
  requested asap.
  as you know it's urgent. ;-)
 

 YOU need to make sure the OP meets their deadline.  Now quit waisting time 
 reading these email mails
 and get to work!

  Cheers,
  Rob.

 


 --
 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] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jochem Maas
Jim Lucas schreef:
 Jochem Maas wrote:
 Robert Cummings schreef:
 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?
 Anything else you'd like to add to the requirements document?
 no - he'll be happy if you just get on and complete the sample script as 
 requested asap.
 as you know it's urgent. ;-)

 
 YOU need to make sure the OP meets their deadline.  Now quit waisting time 
 reading these email mails
 and get to work!

no no. that's Rob's job to do other peoples work for them. he's this years 
designated off-shore gimp.

 
 Cheers,
 Rob.
 
 

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



RE: [PHP] Sample script files with 3 different select boxes withmysql conditions in select boxes

2008-01-03 Thread Jay Blanchard
[snip]
I don't suppose any of you punks know the meaning of rhetorical? ;)
[/snip]

Rhetorical?

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Robert Cummings
On Thu, 2008-01-03 at 07:48 -0800, Jim Lucas wrote:
 Jochem Maas wrote:
  Jim Lucas schreef:
  Jochem Maas wrote:
  Robert Cummings schreef:
  On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
  Hi,
 
  I have a table with the below fields. (id, title, language, author 
  link to the book).
 
  Initially I want to display a page with 3 select boxes (language,
  author  title).
 
  Initially first select box displays the available language by querying
  the database. On selecting one language, author select box should show
  the matching records from the database. After selecting the author,
  matching records should display in title.
 
  Could any body send the sample script files with 3 select boxes?
  Anything else you'd like to add to the requirements document?
  no - he'll be happy if you just get on and complete the sample script as 
  requested asap.
  as you know it's urgent. ;-)
 
  YOU need to make sure the OP meets their deadline.  Now quit waisting time 
  reading these email mails
  and get to work!
  
  no no. that's Rob's job to do other peoples work for them. he's this years 
  designated off-shore gimp.
 
 I was thinking about signing up for that program, but not if it requires more 
 then a day or two.
 
 Wow, a year?  Man, Rob, you are committed...   Wait, you need to be 
 committed... :)

Actually I need to bail on my contract. When I first signed up the U.S.
dollar was worth more, but now that it's almost worthless, I've decided
I can just pay for cheap labour in the U.S.

:)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



RE: [PHP] Sample script files with 3 different select boxes withmysql conditions in select boxes

2008-01-03 Thread Robert Cummings
On Thu, 2008-01-03 at 09:52 -0600, Jay Blanchard wrote:
 [snip]
 I don't suppose any of you punks know the meaning of rhetorical? ;)
 [/snip]
 
 Rhetorical?

Rhetorical??

-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



RE: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jay Blanchard
[snip]
I have a table with the below fields. (id, title, language, author 
link to the book).

Initially I want to display a page with 3 select boxes (language,
author  title).

Initially first select box displays the available language by querying
the database. On selecting one language, author select box should show
the matching records from the database. After selecting the author,
matching records should display in title.

Could any body send the sample script files with 3 select boxes?
[/snip]

There are several examples here
http://www.google.com/search?hl=enq=populating+select+boxes

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jochem Maas
Jim Lucas schreef:
 Robert Cummings wrote:
 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?
 Anything else you'd like to add to the requirements document?

 Cheers,
 Rob.
 
 I would think it be best if it was javascript based so it dynamically loads 
 the data via AJAX or a
 predefined JS hash, but then when JS was disabled, it would be best if it 
 fell back to old school
 and submitted the form when I select the lang-auth-book.

ah, indeed, quite right Jim. sorry Rob I thought all that was implied. while 
your
at it you might as well implement it (whilst keeping graceful degradation) 
using something
like extJS thereby offering the user a more elegant selectbox replacement for 
those
with js enabled.

 
 Thanks
 

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Robert Cummings
On Thu, 2008-01-03 at 16:38 +0100, Jochem Maas wrote:
 Jim Lucas schreef:
  Robert Cummings wrote:
  On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
  Hi,
 
  I have a table with the below fields. (id, title, language, author 
  link to the book).
 
  Initially I want to display a page with 3 select boxes (language,
  author  title).
 
  Initially first select box displays the available language by querying
  the database. On selecting one language, author select box should show
  the matching records from the database. After selecting the author,
  matching records should display in title.
 
  Could any body send the sample script files with 3 select boxes?
  Anything else you'd like to add to the requirements document?
 
  Cheers,
  Rob.
  
  I would think it be best if it was javascript based so it dynamically loads 
  the data via AJAX or a
  predefined JS hash, but then when JS was disabled, it would be best if it 
  fell back to old school
  and submitted the form when I select the lang-auth-book.
 
 ah, indeed, quite right Jim. sorry Rob I thought all that was implied. while 
 your
 at it you might as well implement it (whilst keeping graceful degradation) 
 using something
 like extJS thereby offering the user a more elegant selectbox replacement for 
 those
 with js enabled.

I don't suppose any of you punks know the meaning of rhetorical? ;)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Jim Lucas
Jochem Maas wrote:
 Jim Lucas schreef:
 Jochem Maas wrote:
 Robert Cummings schreef:
 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?
 Anything else you'd like to add to the requirements document?
 no - he'll be happy if you just get on and complete the sample script as 
 requested asap.
 as you know it's urgent. ;-)

 YOU need to make sure the OP meets their deadline.  Now quit waisting time 
 reading these email mails
 and get to work!
 
 no no. that's Rob's job to do other peoples work for them. he's this years 
 designated off-shore gimp.
 
 Cheers,
 Rob.

 

I was thinking about signing up for that program, but not if it requires more 
then a day or two.

Wow, a year?  Man, Rob, you are committed...   Wait, you need to be 
committed... :)

-- 
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] Sample script files with 3 different select boxes withmysql conditions in select boxes

2008-01-03 Thread Børge Holen
On Thursday 03 January 2008 16:55:41 Robert Cummings wrote:
 On Thu, 2008-01-03 at 09:52 -0600, Jay Blanchard wrote:
  [snip]
  I don't suppose any of you punks know the meaning of rhetorical? ;)
  [/snip]
 
  Rhetorical?

 Rhetorical??

what???


 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...



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

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread Børge Holen
On Thursday 03 January 2008 16:54:55 Robert Cummings wrote:
 On Thu, 2008-01-03 at 07:48 -0800, Jim Lucas wrote:
  Jochem Maas wrote:
   Jim Lucas schreef:
   Jochem Maas wrote:
   Robert Cummings schreef:
   On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:
   Hi,
  
   I have a table with the below fields. (id, title, language, author
link to the book).
  
   Initially I want to display a page with 3 select boxes (language,
   author  title).
  
   Initially first select box displays the available language by
   querying the database. On selecting one language, author select box
   should show the matching records from the database. After selecting
   the author, matching records should display in title.
  
   Could any body send the sample script files with 3 select boxes?
  
   Anything else you'd like to add to the requirements document?
  
   no - he'll be happy if you just get on and complete the sample script
   as requested asap. as you know it's urgent. ;-)
  
   YOU need to make sure the OP meets their deadline.  Now quit waisting
   time reading these email mails and get to work!
  
   no no. that's Rob's job to do other peoples work for them. he's this
   years designated off-shore gimp.
 
  I was thinking about signing up for that program, but not if it requires
  more then a day or two.
 
  Wow, a year?  Man, Rob, you are committed...   Wait, you need to be
  committed... :)

 Actually I need to bail on my contract. When I first signed up the U.S.
 dollar was worth more, but now that it's almost worthless, I've decided
 I can just pay for cheap labour in the U.S.

Love that us $ just about now. Bought christmas gifts for both the lady'n me 
over internet. Half the usual price!!!
Wonder if I should by a new car, cheat some customs affair for some 
*blingbling*


 :)

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...



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

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



Re: [PHP] Sample script files with 3 different select boxes withmysql conditions in select boxes

2008-01-03 Thread Wolf

 Børge Holen [EMAIL PROTECTED] wrote: 
 On Thursday 03 January 2008 16:55:41 Robert Cummings wrote:
  On Thu, 2008-01-03 at 09:52 -0600, Jay Blanchard wrote:
   [snip]
   I don't suppose any of you punks know the meaning of rhetorical? ;)
   [/snip]
  
   Rhetorical?
 
  Rhetorical??
 
 what???
 
 
Reminds me of an old programming book I had, under Functions, Recursive it said 
see Recursive Functions...   And when you looked at Recursive Functions it said 
see Functions, Recursive...

Gotta love teachers who write their own books and lawyers who proof them...

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-03 Thread tedd

At 4:24 PM +0100 1/3/08, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:

On Wed, 2 Jan 2008 19:36:56 -0500, tedd wrote:


 To find out, I did put the operation through FireFox and reversed the
 POST/GET operations to get a look at the string -- it is:

 %C2%A0%C2%A0%C2%A0Z%C2%A0%C2%A0%C2%A0   where Z is the value passed.

 Now, C2 (HEX) is a linefeed (194 DEC)

 And, A0 (HEX) is a non-breaking space (160 DEC;) which is a nbsp;


Not quite. A0 is non-breaking space in *some* character
encodings, such as the ISO-8859-... encodings. It may
be different in other encodings. In UTF-8, it is C2 A0,
which is exactly what you're seing.


Well considering that UTF-8 encompasses/includes all of the code 
points found ISO-8859, then I think that both encodings would 
reference the same character. After all, if they didn't then what's 
the point of Unicode?


Now, one can argue how many bytes are needed to represent a character 
in what encoding, but that doesn't change the character. In the end, 
I believe that A0 is the same regardless of what charset or 
encoding you're using.


I just don't understand where C2 comes from or why it's there. I 
would think that 00 A0 would be more appropriate.



  Therefore, if I simply use:


 $submit = str_replace( chr(194), '', $submit );
 $submit = str_replace( chr(160), '', $submit );

 This is the solution.


Hardly.


If you mean my solution doesn't work, then you are mistaken -- for 
works for me.




  Now, why does a POST operation add in C2's?  I'll leave that for

 another post. :-)


I haven't had time to look at the code, but perhaps you
need to specify a character encoding for the page.



That's a valid point. Not only the encoding that's declared for the 
page via it's html DOCTYPE, but also what encoding was used to 
actually save that file on the server.


This entire encoding process is more involved than it looks, or so it 
appears to me.


Cheers,

tedd

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

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread tedd

At 10:41 AM -0500 1/3/08, Robert Cummings wrote:

I don't suppose any of you punks know the meaning of rhetorical? ;)


That really isn't a question, is it?

Cheers,

tedd

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

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



Re: [PHP] Sample script files with 3 different select boxes with mysql conditions in select boxes

2008-01-03 Thread tedd

At 4:38 PM +0100 1/3/08, Jochem Maas wrote:

Jim Lucas schreef:

 Robert Cummings wrote:

 On Thu, 2008-01-03 at 09:18 -0600, Balaji A wrote:

 Hi,

 I have a table with the below fields. (id, title, language, author 
 link to the book).

 Initially I want to display a page with 3 select boxes (language,
 author  title).

 Initially first select box displays the available language by querying
 the database. On selecting one language, author select box should show
 the matching records from the database. After selecting the author,
 matching records should display in title.

 Could any body send the sample script files with 3 select boxes?

 Anything else you'd like to add to the requirements document?

 Cheers,
 Rob.


 I would think it be best if it was javascript based so it 
dynamically loads the data via AJAX or a
 predefined JS hash, but then when JS was disabled, it would be 
best if it fell back to old school

 and submitted the form when I select the lang-auth-book.


ah, indeed, quite right Jim. sorry Rob I thought all that was 
implied. while your
at it you might as well implement it (whilst keeping graceful 
degradation) using something
like extJS thereby offering the user a more elegant selectbox 
replacement for those

with js enabled.


And don't forget to make it accessible, work on all modern browsers, 
pass w3c validation, and the code be unobtrusive. I think that about 
covers it. Oh yes, one more thing, it should be SE friendly as well.


Cheers,

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

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



RE: [PHP] Sample script files with 3 different select boxes withmysql conditions in select boxes

2008-01-03 Thread Ford, Mike
On 03 January 2008 16:16, Wolf wrote:

  Børge Holen [EMAIL PROTECTED] wrote:
  On Thursday 03 January 2008 16:55:41 Robert Cummings wrote:
   On Thu, 2008-01-03 at 09:52 -0600, Jay Blanchard wrote:
[snip]
I don't suppose any of you punks know the meaning of
rhetorical? ;) [/snip] 

Rhetorical?
   
   Rhetorical??
  
  what???
  
   
 Reminds me of an old programming book I had, under Functions,
 Recursive it said see Recursive Functions...   And when you
 looked at Recursive Functions it said see Functions, Recursive...
 
 Gotta love teachers who write their own books and lawyers who proof
 them... 

Reminds me of the first dictionary I had in primary school. Under Gaol it 
said see Jail and under Jail it said see Gaol. Spent many a happy hour 
trying to figure out exactly what sort of a place the teacher was threatening 
I'd end up if I didn't pay attention! ... ;) ;) ;)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 812 4730  Fax:  +44 113 812 3211 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm


[PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Adam Williams
In my form, I am parsing all the text inputs through 
mysql_real_escape_string() before inserting the data.  however, when I 
look at the SQL query in PHP, when I type the word blah's to my text box 
variable, and then insert it into mysql after being ran through 
mysql_real_escape_string(), it does:


insert into contract (contract_id, responsibility) VALUES (15, 'blah\\\'s')

and when I query the in mysql/PHP it shows:

select responsibility from contract where contract_id = 15;
++
| responsibility |
++
| blah\'s|
++
1 row in set (0.00 sec)

and when I run that select statement in PHP it prints blah\'s on the 
screen.  I want it to print back blah's without the \.  So what are my 
options?  run every variable through stripslashes(); before printing 
them to the screen?


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



Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread afan pasalic
Adam Williams wrote:
 In my form, I am parsing all the text inputs through
 mysql_real_escape_string() before inserting the data.  however, when I
 look at the SQL query in PHP, when I type the word blah's to my text box
 variable, and then insert it into mysql after being ran through
 mysql_real_escape_string(), it does:
 
 insert into contract (contract_id, responsibility) VALUES (15, 'blah\\\'s')
 
 and when I query the in mysql/PHP it shows:
 
 select responsibility from contract where contract_id = 15;
 ++
 | responsibility |
 ++
 | blah\'s|
 ++
 1 row in set (0.00 sec)
 
 and when I run that select statement in PHP it prints blah\'s on the
 screen.  I want it to print back blah's without the \.  So what are my
 options?  run every variable through stripslashes(); before printing
 them to the screen?
 

If you have access to php.ini turn the magic_quotes_gpc off.
If not, then you have to use one of examples on
http://us.php.net/manual/en/function.get-magic-quotes-gpc.php

-afan

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



Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread David Giragosian
On 1/3/08, Adam Williams [EMAIL PROTECTED] wrote:

 In my form, I am parsing all the text inputs through
 mysql_real_escape_string() before inserting the data.  however, when I
 look at the SQL query in PHP, when I type the word blah's to my text box
 variable, and then insert it into mysql after being ran through
 mysql_real_escape_string(), it does:

 insert into contract (contract_id, responsibility) VALUES (15,
 'blah\\\'s')

 and when I query the in mysql/PHP it shows:

 select responsibility from contract where contract_id = 15;
 ++
 | responsibility |
 ++
 | blah\'s|
 ++
 1 row in set (0.00 sec)

 and when I run that select statement in PHP it prints blah\'s on the
 screen.  I want it to print back blah's without the \.  So what are my
 options?  run every variable through stripslashes(); before printing
 them to the screen?

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


Andy,

The magic quotes directive is likely set to on in php.ini.

Set it to 0 (zero) or 'Off'.

David


Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Brady Mitchell
 when I type the word blah's to my text box
 variable, and then insert it into mysql after being ran through
 mysql_real_escape_string(), it does:

 insert into contract (contract_id, responsibility) VALUES (15, 'blah\\\'s')

It looks like magic quotes is turned on. Take a look at
http://us2.php.net/magic_quotes.

 and when I run that select statement in PHP it prints blah\'s on the
 screen.  I want it to print back blah's without the \.  So what are my
 options?  run every variable through stripslashes(); before printing
 them to the screen?

Using stripslashes is a nice quick fix, but for a long term solution
turn off magic_quotes and then update your data to remove the extra
slashes.

A simple way to do that is to loop through your database records, run
stripslashes and update the database. As always be sure to backup your
database before doing this, just to be safe! :)

HTH,

Brady

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



Re: [PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Richard Lynch
On Thu, January 3, 2008 1:22 pm, Adam Williams wrote:
 In my form, I am parsing all the text inputs through
 mysql_real_escape_string() before inserting the data.  however, when I
 look at the SQL query in PHP, when I type the word blah's to my text
 box
 variable, and then insert it into mysql after being ran through
 mysql_real_escape_string(), it does:

 insert into contract (contract_id, responsibility) VALUES (15,
 'blah\\\'s')

 and when I query the in mysql/PHP it shows:

 select responsibility from contract where contract_id = 15;
 ++
 | responsibility |
 ++
 | blah\'s|
 ++
 1 row in set (0.00 sec)

 and when I run that select statement in PHP it prints blah\'s on the
 screen.  I want it to print back blah's without the \.  So what are my
 options?  run every variable through stripslashes(); before printing
 them to the screen?

TURN OFF MAGIC QUOTES!!!

Sorry for shouting.

Not really, though. :-)

Magic Quotes GPC in php.ini is ALREADY (trying to) escaping your data,
before you filter it.

This is just plain bassakwards, but was conceived back in the good ol'
days when the 'net was a kinder, gentler place.

But since Magic Quotes already escaped the data, and added \' for
every ' that was there, *YOUR* mysql_real_escape_string was adding
\\\' for the original ', because there was already a \ in there from
Magic Quotes, which needs escaping, just as ' does:

Stage 1:
Original data: blah's

Stage 2:
Magic Quotes GPC tells PHP to do this as it crams stuff into $_POST
blah\'s

Stage 3:
mysql_real_escape_string converts that to:
blah\\\'s

Stage 4:
MySQL stores what you told it to store:
blah\'s

Stage 5:
You select it, and you get what you put in:
blah\'s

Magic Quotes GPC should just be turned OFF, period.

If you have any data already put into your database with both Magic
Quotes and mysql_real_escape_string, then you will need to:

  lock the DB
  pull all the data out
  run stripslashes on all affected data
  call mysql_real_escape_string on affected data
  put affected data back in
  turn OFF magic quotes
  unlock the DB

-- 
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/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] handling ' with mysql/php insert and select

2008-01-03 Thread Bastien Koert

lots of ways to handle this
 
use HTMLentities($string) to convert the apostrophes
use addslashes($string) to escape them
use mysql_real_escape_string($string) to escape them
 
the last is my preferred method
 
 
bastien Date: Thu, 3 Jan 2008 13:22:09 -0600 From: [EMAIL PROTECTED] To: 
php-general@lists.php.net Subject: [PHP] handling ' with mysql/php insert and 
select  In my form, I am parsing all the text inputs through  
mysql_real_escape_string() before inserting the data. however, when I  look at 
the SQL query in PHP, when I type the word blah's to my text box  variable, 
and then insert it into mysql after being ran through  
mysql_real_escape_string(), it does:  insert into contract (contract_id, 
responsibility) VALUES (15, 'blah\\\'s')  and when I query the in mysql/PHP 
it shows:  select responsibility from contract where contract_id = 15; 
++ | responsibility | ++ | blah\'s | 
++ 1 row in set (0.00 sec)  and when I run that select 
statement in PHP it prints blah\'s on the  screen. I want it to print back 
blah's without the \. So what are my  options? run every variable through 
stripslashes(); before printing  them to the screen?  --  PHP General 
Mailing List (http://www.php.net/) To unsubscribe, visit: 
http://www.php.net/unsub.php 
_
Read what Santa`s been up to! For all the latest, visit 
asksantaclaus.spaces.live.com!
http://asksantaclaus.spaces.live.com/

Re: [PHP] mysql date question

2008-01-03 Thread Richard Lynch
On Thu, January 3, 2008 8:30 am, Adam Williams wrote:
 I have a field in mysql as shown by describe contract;

 | length_start | date| YES  | | NULL
 ||

 Which stores it in the mysql format of -MM-DD.  However, I need
 the
 output of my select statement to show it in MM-DD- format.  I can
 select it to see the date in the field:

 select length_start from contract where user_id = 1;
 +--+
 | length_start |
 +--+
 | 2006-01-12   |
 +--+
 1 row in set (0.00 sec)

 so then I do my date_format() select statement, but it returns a NULL
 value.  Why?

 select date_format('contract.length_start', '%m-%d-%Y') as
 length_start
 from contract where user_id = 1;
 +--+
 | length_start |
 +--+
 | NULL |
 +--+
 1 row in set, 1 warning (0.00 sec)

There is not PHP in this question.

But to save you subscribing/posting/unsubcribing to the MySQL list:

You put apostrophes on 'contract.length_start' which makes it a
literal DATE.

MySQL silently ignores such a stupid-looking date, and makes it NULL.

Take away the apostrophes on the FIELD NAME and all will be good.

-- 
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/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: automatic caller

2008-01-03 Thread Richard Lynch
On Wed, January 2, 2008 4:35 pm, Dan wrote:
 blackwater dev [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 I'm working on a prototype now and was wondering if anyone new of a
 service
 where I could pass in text and a number and the service would call
 the
 number and read the text.  I know I can do this with asterisk and
 it's php
 api but don't have time to set up all the outgoing
 code/functionality.
 Does
 anyone know of a service that does this so I can show it as a proof
 of
 concept.  I looked at GrandCentral but it doesn't appear to have
 this
 feature.

 Thanks!

 A simple google search for automated calling returns a lot of
 results,
 although most are services which you have to pay to use and they dont'
 seem
 like you can just call them with text but must have a pre-recorded
 message.
 Off the top of my head probably the simplest thing would be to just
 use the
 Skype API and use them for calls.  Since this is just a prototype then
 there
 probably won't be many calls made on it and it should not be very
 expensive.
 You would have to combine the skype API though with some kind of text
 to
 speech software.

If you go this route, festival is a nice open source text-to-speech
engine that is reasonably easy to install and get going.

-- 
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/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] automatic caller

2008-01-03 Thread Richard Lynch
On Wed, January 2, 2008 6:50 pm, Jim Lucas wrote:
 blackwater dev wrote:
 I'm working on a prototype now and was wondering if anyone new of a
 service
 where I could pass in text and a number and the service would call
 the
 number and read the text.  I know I can do this with asterisk and
 it's php
 api but don't have time to set up all the outgoing
 code/functionality.  Does
 anyone know of a service that does this so I can show it as a proof
 of
 concept.  I looked at GrandCentral but it doesn't appear to have
 this
 feature.

 Thanks!


 a few months/years back, I seem to recall someone creating/playing
 with an php app that would take
 text and convert it into an audio file for you.

 The name I think was phpvox.  You might look into that for the service
 providers that require an
 audio file.

 I did a quit google search but couldn't find any references.  You
 might be able to use one of the
 number of sites that cache the php mailing list and be able to search
 those for phpvox.

It was months back, in May, I believe.

http://php-vox.sf.net/

-- 
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/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: automatic caller

2008-01-03 Thread FrozenDice
If you want to make the job really easy go with Delphi, yeah I know
it's not PHP, but it comes with the Jedi components, which I'm pretty
sure have a built in Speech component, and you can do the Skype api on
it.

- Dan

On Jan 3, 2008 1:53 PM, Richard Lynch [EMAIL PROTECTED] wrote:
 On Wed, January 2, 2008 4:35 pm, Dan wrote:
  blackwater dev [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  I'm working on a prototype now and was wondering if anyone new of a
  service
  where I could pass in text and a number and the service would call
  the
  number and read the text.  I know I can do this with asterisk and
  it's php
  api but don't have time to set up all the outgoing
  code/functionality.
  Does
  anyone know of a service that does this so I can show it as a proof
  of
  concept.  I looked at GrandCentral but it doesn't appear to have
  this
  feature.
 
  Thanks!
 
  A simple google search for automated calling returns a lot of
  results,
  although most are services which you have to pay to use and they dont'
  seem
  like you can just call them with text but must have a pre-recorded
  message.
  Off the top of my head probably the simplest thing would be to just
  use the
  Skype API and use them for calls.  Since this is just a prototype then
  there
  probably won't be many calls made on it and it should not be very
  expensive.
  You would have to combine the skype API though with some kind of text
  to
  speech software.

 If you go this route, festival is a nice open source text-to-speech
 engine that is reasonably easy to install and get going.

 --
 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/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] First stupid post of the year.

2008-01-03 Thread Richard Lynch
On Wed, January 2, 2008 5:26 pm, tedd wrote:
 At 2:34 PM -0800 1/2/08, Jim Lucas wrote:
This I think shows what tedd is looking for.

so, from this I deduce that this should work.

$submit = trim($submit, \xA0\x20);

What do you guys/gals think?

 Nope, not a winner. But it produces some interesting results.

http://www.l-i-e.com/a/

-- 
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/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] First stupid post of the year.

2008-01-03 Thread Richard Lynch
On Wed, January 2, 2008 3:07 pm, Daniel Brown wrote:
 On Jan 2, 2008 3:58 PM, Richard Lynch [EMAIL PROTECTED] wrote:
 Works for me:

 [EMAIL PROTECTED] ~/cd $ php -a
 Interactive mode enabled

 ?php
 $a = 'nbsp; nbsp; nbsp; nbsp;Anbsp; nbsp; nbsp; nbsp;';
 $b = str_replace('nbsp;', '', $a);
 echo b: $b\n\n;
 $c = trim($b);
 echo c: $c\n\n;
 ?
 b:A

 c: A

 Tedd's problem is that it's not working on the web, though, Rich.
 I tested mine and it worked fine from the CLI, too, but not when
 encoded and then decoded via HTTP.

D'oh!

Of course nbsp; in the browser is converted to a single character,
whose ASCII (extended ASCII, actually) value is 160.

trim() does not consider chr(160) as whitespace, unless you explicitly
add it in the second arg, along with the usual suspects.

-- 
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/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] First stupid post of the year. [SOLVED]

2008-01-03 Thread Richard Lynch
On Thu, January 3, 2008 11:39 am, tedd wrote:
 At 4:24 PM +0100 1/3/08, Nisse Engström wrote:
On Wed, 2 Jan 2008 19:36:56 -0500, tedd wrote:

  To find out, I did put the operation through FireFox and reversed
 the
  POST/GET operations to get a look at the string -- it is:

  %C2%A0%C2%A0%C2%A0Z%C2%A0%C2%A0%C2%A0   where Z is the value
 passed.

  Now, C2 (HEX) is a linefeed (194 DEC)

  And, A0 (HEX) is a non-breaking space (160 DEC;) which is a nbsp;

Not quite. A0 is non-breaking space in *some* character
encodings, such as the ISO-8859-... encodings. It may
be different in other encodings. In UTF-8, it is C2 A0,
which is exactly what you're seing.

 Well considering that UTF-8 encompasses/includes all of the code
 points found ISO-8859, then I think that both encodings would
 reference the same character. After all, if they didn't then what's
 the point of Unicode?

 Now, one can argue how many bytes are needed to represent a character
 in what encoding, but that doesn't change the character. In the end,
 I believe that A0 is the same regardless of what charset or
 encoding you're using.

 I just don't understand where C2 comes from or why it's there. I
 would think that 00 A0 would be more appropriate.

   Therefore, if I simply use:

  $submit = str_replace( chr(194), '', $submit );
  $submit = str_replace( chr(160), '', $submit );

  This is the solution.

Hardly.

 If you mean my solution doesn't work, then you are mistaken -- for
 works for me.


   Now, why does a POST operation add in C2's?  I'll leave that for
  another post. :-)

I haven't had time to look at the code, but perhaps you
need to specify a character encoding for the page.


 That's a valid point. Not only the encoding that's declared for the
 page via it's html DOCTYPE, but also what encoding was used to
 actually save that file on the server.

 This entire encoding process is more involved than it looks, or so it
 appears to me.

Perhaps you should be taking a whitelist approach to filtering input?...

:-)

In other words, only allow specific characters combinations you expect
to see, and ignore any other goofy characters that were encoded from
nbsp;

Or, possibly, try using just spaces and not nbsp; for the value -- I
suspect that the browsers will NOT collapse the spaces in the VALUE
since it's data, not HTML content...

-- 
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/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] First stupid post of the year. [SOLVED]

2008-01-03 Thread Richard Lynch
On Wed, January 2, 2008 6:36 pm, tedd wrote:
 Now, why does a POST operation add in C2's?  I'll leave that for
 another post. :-)

I believe the POST operation adds nothing.

The BROWSER interprets your nbsp; as whatever it finds most
appropriate to slap into a button VALUE, given the charset and
whatever the browser thinks it should do with that.

nbsp; probably shouldn't be part of a VALUE for a SUBMIT INPUT in the
first place, 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/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] First stupid post of the year. [SOLVED]

2008-01-03 Thread tedd

At 3:35 PM -0600 1/3/08, Richard Lynch wrote:

On Wed, January 2, 2008 6:36 pm, tedd wrote:

 Now, why does a POST operation add in C2's?  I'll leave that for
 another post. :-)


I believe the POST operation adds nothing.

The BROWSER interprets your nbsp; as whatever it finds most
appropriate to slap into a button VALUE, given the charset and
whatever the browser thinks it should do with that.

nbsp; probably shouldn't be part of a VALUE for a SUBMIT INPUT in the
first place, really...



I think we all realize that. The point of the exercise was to 
understand what was happening.


Cheers,

tedd

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

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



Re: [PHP] First stupid post of the year.

2008-01-03 Thread tedd

At 3:28 PM -0600 1/3/08, Richard Lynch wrote:

On Wed, January 2, 2008 5:26 pm, tedd wrote:

 At 2:34 PM -0800 1/2/08, Jim Lucas wrote:

This I think shows what tedd is looking for.

so, from this I deduce that this should work.

$submit = trim($submit, \xA0\x20);

What do you guys/gals think?


 Nope, not a winner. But it produces some interesting results.


http://www.l-i-e.com/a/



That's neat.

Cheers,

tedd

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

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



Re: [PHP] First stupid post of the year. [SOLVED]

2008-01-03 Thread tedd

At 3:33 PM -0600 1/3/08, Richard Lynch wrote:

On Thu, January 3, 2008 11:39 am, tedd wrote:
  That's a valid point. Not only the encoding that's declared for the

 page via it's html DOCTYPE, but also what encoding was used to
 actually save that file on the server.

 This entire encoding process is more involved than it looks, or so it
 appears to me.


Perhaps you should be taking a whitelist approach to filtering input?...


Yes, I always scrub and/or filter any data coming from the user-side.

This was just an experiment because the results I saw didn't fit what 
I (and appears others) expected.


Thanks for your input and code.

Cheers,

tedd

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

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