php-general Digest 22 Feb 2010 15:12:04 -0000 Issue 6603

2010-02-22 Thread php-general-digest-help
php-general Digest 22 Feb 2010 15:12:04 - Issue 6603 Topics (messages 302249 through 302252): Re: Fun with Streams 302249 by: Rene Veerman 302250 by: Rene Veerman 302251 by: Ford, Mike help, please, understanding my problem 302252 by: Stan Administrivia:

Re: [PHP] Fun with Streams

2010-02-22 Thread Rene Veerman
http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ And, hey, when the hell will the PHP developers implement a foreach loop which assigns the array values by reference?? +100! (still reading the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Fun with Streams

2010-02-22 Thread Rene Veerman
just curious, why did you choose to use it from behind a stream wrapper? and sry, i have no exp with these beasts.. On Sun, Feb 21, 2010 at 11:03 PM, Matt Neimeyer m...@neimeyer.org wrote: I created a stream wrapper around the php_writeexcel library found at

RE: [PHP] Fun with Streams

2010-02-22 Thread Ford, Mike
-Original Message- From: Rene Veerman [mailto:rene7...@gmail.com] Sent: 22 February 2010 09:09 http://www.bettina- attack.de/jonny/view.php/projects/php_writeexcel/ And, hey, when the hell will the PHP developers implement a foreach loop which assigns the array values by

[PHP] help, please, understanding my problem

2010-02-22 Thread Stan
I have a PHP page that has require_once(genMyOverlay.js.php); . . . echo body; echo script language=\JavaScript\doit(\mydiv\);/scriptbr; echo /body; genMyOverlay.js.php contains: createDiv() (see below) that creates a DIV ID=mydiv and sets it up to overlay a portion of the wbe page and

Re: [PHP] help, please, understanding my problem

2010-02-22 Thread Ashley Sheridan
On Mon, 2010-02-22 at 09:09 -0600, Stan wrote: I have a PHP page that has require_once(genMyOverlay.js.php); . . . echo body; echo script language=\JavaScript\doit(\mydiv\);/scriptbr; echo /body; genMyOverlay.js.php contains: createDiv() (see below) that creates a DIV ID=mydiv

Re: [PHP] help, please, understanding my problem

2010-02-22 Thread tedd
At 3:15 PM + 2/22/10, Ashley Sheridan wrote: Also, your script tags need a type attribute: script language=javascript type=text/javascript Actually, you only need this: script type=text/javascript The language attribute will throw an error in validation. Cheers, tedd -- ---

Re: [PHP] help, please, understanding my problem

2010-02-22 Thread Ashley Sheridan
On Mon, 2010-02-22 at 12:33 -0500, tedd wrote: At 3:15 PM + 2/22/10, Ashley Sheridan wrote: Also, your script tags need a type attribute: script language=javascript type=text/javascript Actually, you only need this: script type=text/javascript The language attribute will throw

Re: [PHP] help, please, understanding my problem

2010-02-22 Thread tedd
At 5:32 PM + 2/22/10, Ashley Sheridan wrote: On Mon, 2010-02-22 at 12:33 -0500, tedd wrote: At 3:15 PM + 2/22/10, Ashley Sheridan wrote: Also, your script tags need a type attribute: script language=javascript type=text/javascript Actually, you only need this: script

[PHP] $_POST vs $_REQUEST

2010-02-22 Thread Slack-Moehrle
Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? Also, I see examples of these being used with and without the single quotes Like: $_POST[j_orderValue] or $_POST['j_orderValue'] Single

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Richard
Hi, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? It's a wise choice to go with $_POST, unless your form is a GET form, in which case use $_GET. $_REQUEST has the potential to open your

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread shiplu
On Tue, Feb 23, 2010 at 2:39 AM, Slack-Moehrle mailingli...@mailnewsrss.com wrote: Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? Also, I see examples of these being used with and

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Joseph Thayne
Richard wrote: It's a wise choice to go with $_POST, unless your form is a GET form, in which case use $_GET. $_REQUEST has the potential to open your script(s) up to security issues. I am not sure what the security issues are you are referring to as the $_REQUEST superglobal contains

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Rene Veerman
On Mon, Feb 22, 2010 at 9:39 PM, Slack-Moehrle mailingli...@mailnewsrss.com wrote: Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? I like to be specific and go for $_POST, but some

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread John Black
On 02/22/2010 09:39 PM, Slack-Moehrle wrote: Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? When you don't care how you get the data use $_REQUEST. $_REQUEST will contain

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Rene Veerman
i'd expect without quotes to query a define('j_orderValue','??').. oh, and that, if not defined, defaults to the string 'j_orderValue'. So while your $_POST[] with or without quotes will do the same, use single-quotes anyway because it's the right thing to do ;) -- PHP General Mailing List

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Richard
Hi, I am not sure what the security issues are you are referring to as the $_REQUEST superglobal contains both $_GET and $_POST values.  Could you expound on that?  Thanks. Not really, do a search. -- Richard Heyes HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 20th

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Kim Madsen
Hi Slack-Moehrle Slack-Moehrle wrote on 22/02/2010 21:39: Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? $_REQUEST['test'] is true on both $_GET['test'] and $_POST['test'] I use it

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Dotan Cohen
I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. Look at this example: form action=page.php?foo=bar input type=hidden name=foo value=pub /form Now what do you thing $_REQUEST will return? You had better not even think. Just use

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Michael Shadle
On Mon, Feb 22, 2010 at 12:55 PM, Joseph Thayne webad...@thaynefam.org wrote: I am not sure what the security issues are you are referring to as the $_REQUEST superglobal contains both $_GET and $_POST values.  Could you expound on that?  Thanks. $_REQUEST opens you up to POST/GET values

RE: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread David Murphy
Richard, The use of $_REQUEST it no more a security hole than $_GET or $_REQUEST, they should ALL be treats as bad data until normalized and sanitized. The claim that it opens a security hole is just false, that’s like saying PHP is insecure, its not it just allows for lazy coding such as

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Michael Shadle
On Mon, Feb 22, 2010 at 1:30 PM, David Murphy da...@icewatermedia.com wrote: Richard, The use of $_REQUEST it no more a security hole than $_GET or $_REQUEST, they should ALL be treats as bad data until normalized and sanitized.  The claim that it opens a security hole  is  just false,

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Slack-Moehrle
John, Then if you use a MySQL database you would escape the string like this $tmp = mysql_real_escape_string($_REQUEST['yyy']); mysql_real_escape_string() protect from SQL injection by escaping your string according to what your charset requires. Good point, I should be doing that. But only

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread John Black
On 02/22/2010 10:37 PM, Michael Shadle wrote: On Mon, Feb 22, 2010 at 1:30 PM, David Murphyda...@icewatermedia.com wrote: Richard, The use of $_REQUEST it no more a security hole than $_GET or $_REQUEST, they should ALL be treats as bad data until normalized and sanitized. The claim that it

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Michael Shadle
On Mon, Feb 22, 2010 at 2:07 PM, John Black s...@network-technologies.org wrote: And how is this more secure? I can create a cookie, send post or get on my client machine and send anything I want to the server. Just because you are getting a cookie does not mean that you created it :) So you

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Andrew Ballard
On Mon, Feb 22, 2010 at 5:02 PM, Slack-Moehrle mailingli...@mailnewsrss.com wrote: John, Then if you use a MySQL database you would escape the string like this $tmp = mysql_real_escape_string($_REQUEST['yyy']); mysql_real_escape_string() protect from SQL injection by escaping your string

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread John Black
On 02/22/2010 11:17 PM, Michael Shadle wrote: Secure might be the wrong term here. As you can easily change GET to POST and vice-versa and send any cookies you like, this is why I tried to revise my statement and quantify it better... in a properly coded app it doesn't present much issue.

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Daniel Egeberg
On Mon, Feb 22, 2010 at 22:37, Michael Shadle mike...@gmail.com wrote: On Mon, Feb 22, 2010 at 1:30 PM, David Murphy da...@icewatermedia.com wrote: Richard, The use of $_REQUEST it no more a security hole than $_GET or $_REQUEST, they should ALL be treats as bad data until normalized and

[PHP] PHP / mySQL Project...

2010-02-22 Thread Don Wieland
Hello, I am needing assistance IMMEDIATELY in finishing up a project (the developer went in to have shoulder surgery and will be out of commission for 3 weeks) and I need this finished soon. Candidate must have good english skills, a solid knowledge of HTML, CSS, PHP, mySQL, Javascript,

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Michael Shadle
The difference here is you can at least have some control over the data and expect it in a certain fashion. Also the behavior of cookies vs. get vs. post are different (cookies have length and expiration limits, get has length limits, post has server confgured limits) Like I said a

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Jochem Maas
Op 2/22/10 8:39 PM, Slack-Moehrle schreef: Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? use $_POST, $_REQUEST is normally an amalgam of GET, POST and COOKIE - as such using

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread John Black
On 02/22/2010 11:42 PM, Michael Shadle wrote: The difference here is you can at least have some control over the data and expect it in a certain fashion. Also the behavior of cookies vs. get vs. post are different (cookies have length and expiration limits, get has length limits, post has server

[PHP] Re: PHP / mySQL Project...

2010-02-22 Thread Carlos Medina
Hi Don, i work for the company simplynetworks in germany. I have access to may programmers with the best quality to the best prices. We work quick and no dirty ;-) I am programmer too and my company offer you the best object oriented software of the market. Some references of my clients in

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Ashley Sheridan
On Mon, 2010-02-22 at 23:49 +0100, John Black wrote: On 02/22/2010 11:42 PM, Michael Shadle wrote: The difference here is you can at least have some control over the data and expect it in a certain fashion. Also the behavior of cookies vs. get vs. post are different (cookies have length

Re: [PHP] PHP / mySQL Project...

2010-02-22 Thread Ashley Sheridan
On Mon, 2010-02-22 at 14:39 -0800, Don Wieland wrote: Hello, I am needing assistance IMMEDIATELY in finishing up a project (the developer went in to have shoulder surgery and will be out of commission for 3 weeks) and I need this finished soon. Candidate must have good english

[PHP] Sending e-mail via socket

2010-02-22 Thread Andre Polykanine
Hello everyone, I've just subscribed to the list, and I already have a question. what I need to do is to send mail using sockets. Actually, the built-in Mail() function is great and I wouldn't have to search for something else if I didn't need more than one message to be sent at a time. Say, I

RE: [PHP] PHP / mySQL Project... Real men use 'cat'

2010-02-22 Thread Daevid Vincent
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] On Mon, 2010-02-22 at 14:39 -0800, Don Wieland wrote: I am needing assistance IMMEDIATELY in finishing up a project (the developer went in to have shoulder surgery and will be out of commission

Re: [PHP] Sending e-mail via socket

2010-02-22 Thread Rene Veerman
have you tried mail() with a large bcc header? On Tue, Feb 23, 2010 at 1:16 AM, Andre Polykanine an...@oire.org wrote: Hello everyone, I've just subscribed to the list, and I already have a question. what I need to do is to send mail using sockets. Actually, the built-in Mail() function is

Re: [PHP] Sending e-mail via socket

2010-02-22 Thread Paul M Foster
On Tue, Feb 23, 2010 at 02:16:24AM +0200, Andre Polykanine wrote: Hello everyone, I've just subscribed to the list, and I already have a question. what I need to do is to send mail using sockets. Actually, the built-in Mail() function is great and I wouldn't have to search for something else

[PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Paul M Foster
Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows affected? If so, is there a simple workaround? Paul -- Paul M. Foster -- PHP

Re: [PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Nathan Nobbe
On Mon, Feb 22, 2010 at 7:50 PM, Paul M Foster pa...@quillandmouse.comwrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows

Re: [PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Paul M Foster
On Mon, Feb 22, 2010 at 08:18:25PM -0700, Nathan Nobbe wrote: On Mon, Feb 22, 2010 at 7:50 PM, Paul M Foster pa...@quillandmouse.com wrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE

Re: [PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Nathan Nobbe
On Mon, Feb 22, 2010 at 8:39 PM, Paul M Foster pa...@quillandmouse.comwrote: On Mon, Feb 22, 2010 at 08:18:25PM -0700, Nathan Nobbe wrote: On Mon, Feb 22, 2010 at 7:50 PM, Paul M Foster pa...@quillandmouse.com wrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone

Re: [PHP] PDOStatement::rowCount() bug?

2010-02-22 Thread Paul M Foster
On Mon, Feb 22, 2010 at 09:50:30PM -0500, Paul M Foster wrote: Using MySQL 5.075, PHP 5.25 on Debian unstable. Has anyone noticed, when issuing a PDOStatement::rowCount() call after a DELETE, UPDATE or INSERT, the return is uniformly zero, rather than the actual number of rows affected?

[PHP] unpacking an array of structs...

2010-02-22 Thread php.l...@juun.com
I have a desktop app that has a data structure that looks like this: typedef struct MANGOpie { unsigned char mango; unsigned short pie; } MANGOpie; I manage a C array of these things in memory: MANGOpie * pies = (MANGOpie *)malloc(count*sizeof(MANGOpie)); I pass these to a PHP

Re: [PHP] unpacking an array of structs...

2010-02-22 Thread Nathan Nobbe
On Monday, February 22, 2010, php.l...@juun.com php.l...@juun.com wrote: I have a desktop app that has a data structure that looks like this: typedef struct MANGOpie {   unsigned char   mango;   unsigned short  pie; } MANGOpie; I manage a C array of these things in memory:

Re: [PHP] unpacking an array of structs...

2010-02-22 Thread Rene Veerman
have you considered using json as transport? http://json.org/ has code you can re-use. On Tue, Feb 23, 2010 at 7:29 AM, php.l...@juun.com php.l...@juun.com wrote: I have a desktop app that has a data structure that looks like this: typedef struct MANGOpie {   unsigned char   mango;  

Re: [PHP] unpacking an array of structs...

2010-02-22 Thread php.l...@juun.com
I'm actually moving from a string-encoded transport to binary for compactness. The array can potentially get pretty large. I'm shooting for the smallest possible representation of the data, which is 1 char and 1 short per data point. On February 23, 2010, Rene Veerman

Re: [PHP] unpacking an array of structs...

2010-02-22 Thread php.l...@juun.com
In the desktop app's memory the data is packed end-to-end already: typedef struct MANGOpie { unsigned char mango; unsigned short pie; } MANGOpie; MANGOpie * pies = (MANGOpie *)malloc(count*sizeof(MANGOpie)); ...and the entire 'pies' array is sent to the PHP script as binary data

Re: [PHP] Sending e-mail via socket

2010-02-22 Thread Per Jessen
Andre Polykanine wrote: Hello everyone, I've just subscribed to the list, and I already have a question. what I need to do is to send mail using sockets. Actually, the built-in Mail() function is great and I wouldn't have to search for something else if I didn't need more than one message to