php-general Digest 1 Apr 2007 21:28:22 -0000 Issue 4710

2007-04-01 Thread php-general-digest-help
php-general Digest 1 Apr 2007 21:28:22 - Issue 4710 Topics (messages 251880 through 251902): Re: Security Best Practice: typecast? 251880 by: Tijnema ! 251889 by: tedd Re: finding the index name of an associative array 251881 by: Man-wai Chang 251886 by:

Re: [PHP] Alternative/Addition to using a CAPTCHA

2007-04-01 Thread Richard Lynch
On Fri, March 30, 2007 2:29 pm, [EMAIL PROTECTED] wrote: For those of you not following, what tedd's done with is blue dot is created a larger image that contains a blue dot somewhere. You can click in a fairly wide area, but only clicking on the blue dot yields a success. But it's probably

Re: [PHP] Gnome and MIME types

2007-04-01 Thread Richard Lynch
On Fri, March 30, 2007 11:20 am, Nathan Ziarek wrote: I'm capturing the output of exec in an array -- exec(command, $array); Shouldn't $array have the error from bash? Nope. Errors go to stderr, and output goes to stdout, and never the 'twain shall meet. Unless you re-direct in your

Re: [PHP] pdo::lastInsertId() error with SQL Server

2007-04-01 Thread Richard Lynch
On Thu, March 29, 2007 12:57 pm, Sady Marcos wrote: hey.. I am not obtaining use the function pdo::lastInsertId() with sql My code: $db = new PDO(mssql:host=host;dbname=database,user,password); $sql = INSERT INTO users(name,status) VALUES('username','1); Are you really missing the '

Re: [PHP] CURL questions

2007-04-01 Thread Richard Lynch
On Thu, March 29, 2007 11:15 am, Angelo Zanetti wrote: I have a script on a server that does some processing, now I want to execute that script using cURL. This is a basic scenario and I assume its possible but its not working. I get a 500 Internal server error, not sure why as this page

Re: [PHP] Audio CAPTCHA review request

2007-04-01 Thread Richard Lynch
I am relatively certain that the QUICKTIME instructions are irrelevant on Linux... Unless they finally released QT for Linux while I wasn't paying attention... On Fri, March 30, 2007 1:15 am, Zoltán Németh wrote: 2007. 03. 29, csütörtök keltezéssel 22.00-kor Tijnema ! ezt írta: On

Re: [PHP] Form Handler Script Security Discussion

2007-04-01 Thread Richard Lynch
On Thu, March 29, 2007 10:06 am, Daniel Brown wrote: Just wondering how many of you actually use any type of secure coding when doing form processing. Always. For all new code. I can't possibly go back and re-write every script everywhere I ever wrote over the past decade, though...

Re: [PHP] Form Handler Script Security Discussion

2007-04-01 Thread Richard Lynch
On Thu, March 29, 2007 10:25 am, cajbecu wrote: And even then, some smart programmers are probably going to find a way to read your image code :) that, of course, if your app will be an interface to client`s bank account, with online management. :) One does have to balance Risk with the

Re: [PHP] Audio CAPTCHA review request

2007-04-01 Thread Richard Lynch
On Thu, March 29, 2007 6:46 pm, TG wrote: On Thu, March 29, 2007 3:45 pm, Tijnema ! wrote: You're maybe on the right path, adding images as the background makes it really hard to read the code from the image. You could for example use random images as background. Some of the CAPTCHA

Re: [PHP] Audio CAPTCHA review request

2007-04-01 Thread Richard Lynch
On Thu, March 29, 2007 3:50 pm, tedd wrote: And because you can't do anything on the internet without bumping into adult material. Don't worry, this is safe... no pics or bad words, just an article about using porn sites to break visual CAPTCHA. The spambots would take your visual CAPTCHA images

[PHP] finding the index name of an associative array

2007-04-01 Thread Man-wai Chang
myarray=array() myarray['a']=1 myarray['b']=1 myarray['c']=1 Is there an iterative way to find out the array index values ('a', 'b' and 'c') of myarray? -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _

Re: [PHP] Audio CAPTCHA review request

2007-04-01 Thread Richard Lynch
On Fri, March 30, 2007 2:23 am, Tijnema ! wrote: Speech recognition isn't working very well, and i don't think it would be able to get these numbers from the audio, but I have too less experience with speech recognition. Put it this way: If Corporate America uses speech recognition on

RE: [PHP] finding the index name of an associative array

2007-04-01 Thread Jake McHenry
foreach ($myarray as $key = $value) { echo $key = $value; } -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Man-wai Chang Sent: Sunday, April 01, 2007 3:59 AM To: php-general@lists.php.net Subject: [PHP] finding the index name of an associative array

Re: [PHP] Re: 0x9f54

2007-04-01 Thread Tijnema !
On 4/1/07, Man-wai Chang [EMAIL PROTECTED] wrote: MySQL? MSSQL? PgSQL? Tijnema It seems he wanted to insert a Chinese character with that hex value. Yes... I tried the insert with PHP, including the use of mysql_real_escape_string(), but MySQL still gave me a blank only. Well, show us

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Tijnema !
On 4/1/07, Larry Garfield [EMAIL PROTECTED] wrote: So there's no PDO experts out there, eh? :-( No, not really a PDO expert ;) On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: HI all. The PHP.net manual is somewhat unclear on this point, so I thought I'd ask here. Does PDO

[PHP] Downloads for subsrcibers only

2007-04-01 Thread Mário Gamito
Hi, I made this site in PHP that has a page with some PDFs to download. My costumer wants that only subscribed people are allowed to download the PDFs. I've already made the subscrbe and login mechanism. Now, my question for you is about letting only subscribers download the PDFs. What is the

Re: [PHP] Security Best Practice: typecast?

2007-04-01 Thread Tijnema !
On 4/1/07, Richard Lynch [EMAIL PROTECTED] wrote: So, after a recent thread on data filtering, I'm wondering... Is this good enough in ALL possible Unicode/charset situations: $foo_id = (int) $_POST['foo_id']; $query = insert into whatever(foo_id) values($foo_id); Or is it possible, even

[PHP] Re: finding the index name of an associative array

2007-04-01 Thread Man-wai Chang
Jake McHenry wrote: foreach ($myarray as $key = $value) { echo $key = $value; } Thanks. I just found that there is an array_key() function. -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\

[PHP] why would these few statements writes the array?

2007-04-01 Thread Man-wai Chang
$array = array(1,2,3); foreach( $array as $item ); foreach( $array as $item ); print_r( $array ); foreach is a read, not a write, isn't it? -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu

Re: [PHP] Saving css state in javascript and passing to php via form submit

2007-04-01 Thread Jürgen Wind
Richard Lynch wrote: On Fri, March 30, 2007 12:13 pm, Juergen Wind wrote: Tijnema ! wrote: You can use session within javascript too i believe. no, sessions are completely serverside, but you can use js to pass variables using the query string when sending a xmlHttpRequest.

[PHP] Re: why would these few statements writes the array?

2007-04-01 Thread Man-wai Chang
Man-wai Chang wrote: $array = array(1,2,3); foreach( $array as $item ); foreach( $array as $item ); print_r( $array ); foreach is a read, not a write, isn't it? I got it... -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force

[PHP] Re: Downloads for subsrcibers only

2007-04-01 Thread itoctopus
Depends where you store the file, if you store the file in the database, then it's much easier to do it. Your idea (as it is right now) won't work, because anyone will be able to copy and paste the link to your PDF document and download it (thus easily overriding the logic you have in the page).

[PHP] Re: finding the index name of an associative array

2007-04-01 Thread itoctopus
Note, however, that array_keys is not recursive. -- itoctopus - http://www.itoctopus.com Man-wai Chang [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jake McHenry wrote: foreach ($myarray as $key = $value) { echo $key = $value; } Thanks. I just found that there is an

[PHP] Get free broadband internet from google!

2007-04-01 Thread Tijnema !
Hi, It's true, free broadband internet from google :) Have a look at this page: http://www.google.com/tisp Start now with installing: http://www.google.com/tisp/install.html Tijnema ps. 1 April is cool huh? -- PHP General

[PHP] Re: Get free broadband internet from google!

2007-04-01 Thread itoctopus
That's funny, looks like the good people at google have lots of time on their hands. -- itoctopus - http://www.itoctopus.com Tijnema ! [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, It's true, free broadband internet from google :) Have a look at this page:

Re: [PHP] Security Best Practice: typecast?

2007-04-01 Thread tedd
At 11:03 PM -0500 3/31/07, Richard Lynch wrote: So, after a recent thread on data filtering, I'm wondering... Is this good enough in ALL possible Unicode/charset situations: $foo_id = (int) $_POST['foo_id']; $query = insert into whatever(foo_id) values($foo_id); The range of Unicode is

[PHP] Re: finding the index name of an associative array

2007-04-01 Thread Man-wai Chang
itoctopus wrote: Note, however, that array_keys is not recursive. foreach is recursive??? thanks. -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.10) Linux 2.6.20.4 ^ ^ 20:44:01 up

RE: [PHP] Re: finding the index name of an associative array

2007-04-01 Thread Peter Lauri
-Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Man-wai Chang Sent: Sunday, April 01, 2007 2:45 PM To: php-general@lists.php.net Subject: [PHP] Re: finding the index name of an associative array itoctopus wrote: Note, however, that array_keys is not

[PHP] Re: finding the index name of an associative array

2007-04-01 Thread itoctopus
foreach is also not recursive, writing a recursive function to recursively return the keys in an array should be trivial. -- itoctopus - http://www.itoctopus.com Man-wai Chang [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] itoctopus wrote: Note, however, that array_keys is not

Re: [PHP] Alternative/Addition to using a CAPTCHA

2007-04-01 Thread tedd
At 2:00 AM -0500 4/1/07, Richard Lynch wrote: On Fri, March 30, 2007 2:29 pm, [EMAIL PROTECTED] wrote: For those of you not following, what tedd's done with is blue dot is created a larger image that contains a blue dot somewhere. You can click in a fairly wide area, but only clicking on

Re: [PHP] Audio CAPTCHA review request

2007-04-01 Thread tedd
At 3:02 AM -0500 4/1/07, Richard Lynch wrote: On Fri, March 30, 2007 2:23 am, Tijnema ! wrote: Speech recognition isn't working very well, and i don't think it would be able to get these numbers from the audio, but I have too less experience with speech recognition. Put it this way: If

Re: [PHP] Get free broadband internet from google!

2007-04-01 Thread tedd
At 2:29 PM +0200 4/1/07, Tijnema ! wrote: Hi, It's true, free broadband internet from google :) Have a look at this page: http://www.google.com/tisp Start now with installing: http://www.google.com/tisp/install.html Tijnema Tijnema: Not that I fell for it, but I just couldn't imagine why

Re: [PHP] Re: Downloads for subsrcibers only

2007-04-01 Thread Mário Gamito
Hi, itoctopus wrote: Depends where you store the file, if you store the file in the database, then it's much easier to do it. Your idea (as it is right now) won't work, because anyone will be able to copy and paste the link to your PDF document and download it (thus easily overriding the

Re: [PHP] PHP sample code for XMLHttprequest with jQuery

2007-04-01 Thread tedd
At 10:26 PM +0200 3/30/07, Otto Wyss wrote: I'm currently evaluating jQuery as a Javascript library for my web site but first would like to see a working sample with PHP doing XMLHttprequest. Is anyone else using jQuery and has some sample code to look at? O. Wyss I'm not using php to

Re: [PHP] Gnome and MIME types

2007-04-01 Thread Nathan Ziarek
Thanks for the tips. What I ultiamtely ended up finding was that www-data's home dir is / var/www/. I made a writeable directory called .gnome2 in there and then the command worked. I then made that directory read-only and the command still works. For whatever it is worth (in case I'm

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Larry Garfield
On Sunday 01 April 2007 3:42 am, Tijnema ! wrote: On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: HI all. The PHP.net manual is somewhat unclear on this point, so I thought I'd ask here. Does PDO automatically buffer queries the way that the mysql_* extension does, in

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Jürgen Wind
Larry Garfield wrote: ...segfaults under PHP 5.1.6 ... php 5.1.5/6 was the source for many segfaults (f.e. using phpmyadmin) better don't use it any more. See also: http://bugs.php.net/bug.php?id=39036 -- View this message in context:

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Larry Garfield
On Sunday 01 April 2007 3:09 pm, Jürgen Wind wrote: Larry Garfield wrote: ...segfaults under PHP 5.1.6 ... php 5.1.5/6 was the source for many segfaults (f.e. using phpmyadmin) better don't use it any more. See also: http://bugs.php.net/bug.php?id=39036 Oh goodie. That only includes all

[PHP] HTDIGEST FILE FORMAT

2007-04-01 Thread Manolet Gmail
hi, i want a php script to create htdigest file... the correct file is: username:admin digest:trac pass:admin admin:trac:71ea86385b35d5e2575b0baec1904ded i try to do it on php with this: echo admin:trac:.md5(admin); but i receive this: admin:trac:21232f297a57a5a743894a0e4a801fc3 how is the

Re: [PHP] simple page not found 404 script - PHP

2007-04-01 Thread Zoltán Németh
2007. 03. 30, péntek keltezéssel 19.01-kor Dwayne Heronimo ezt írta: wierd.. your code is behaving exactly the same as mine did. it will display the error and the page.. but both at the same time :S it is working but somehow it continues to execute.

[PHP] RE: HTDIGEST FILE FORMAT

2007-04-01 Thread Buesching, Logan J
The password is the hash of the entire thing, not just the password. So it would be the following: echo admin:trac:.md5('admin:trac:admin'); -Logan -Original Message- From: Manolet Gmail [mailto:[EMAIL PROTECTED] Sent: Sunday, April 01, 2007 5:28 PM To: php-general@lists.php.net

Re: [PHP] finding the index name of an associative array

2007-04-01 Thread Myron Turner
Man-wai Chang wrote: myarray=array() myarray['a']=1 myarray['b']=1 myarray['c']=1 Is there an iterative way to find out the array index values ('a', 'b' and 'c') of myarray? array *array_keys* ( array $input [, mixed $search_value [, bool $strict]] ) *array_keys()* returns the keys,

Re: [PHP] Ide help needed

2007-04-01 Thread Davi
Em Sexta 30 Março 2007 14:39, [EMAIL PROTECTED] escreveu: I am a beginer with php and i need to know which IDE is best suited under windows and linux both i have seen dreamweaver working and have heard about GoLive too but don't know whichone to go for can you please help me decide and