Re: [PHP] two questions on serverside validation

2010-08-27 Thread Jan G.B.
2010/8/25 Paul M Foster : > On Wed, Aug 25, 2010 at 01:05:12PM -0400, David Mehler wrote: > >> Hello, >> Thanks to all who answered my quotes question. I've got another one. >> I've got several combo boxes that are sticky, below is an example of >> one and the function. Now i'd like to tighten it u

Re: [PHP] two questions on serverside validation

2010-08-27 Thread Jan G.B.
2010/8/27 Jan G.B. : > But make sure the other code which we don't see > - does not outpot any _POST / _GET / _REQUEST / _COOKIE variables > without encoding the contents (f.e. htmlspecialchars), or > - does not send and user supplied data without scaping the sb-related > special chars.. (f.e. mysq

Re: [PHP] two questions on serverside validation

2010-08-26 Thread tedd
At 3:59 PM +0100 8/25/10, Ashley Sheridan wrote: 2.4 seconds doesn't seem so bad on 10 million iterations, but yes, it does show that you should avoid it if it's really not necessary. Most often I'll use that sort of syntax if I do something like this: $greeting = "Hello $name, not seen you sin

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Paul M Foster
On Wed, Aug 25, 2010 at 01:05:12PM -0400, David Mehler wrote: > Hello, > Thanks to all who answered my quotes question. I've got another one. > I've got several combo boxes that are sticky, below is an example of > one and the function. Now i'd like to tighten it up by ensuring that > an external

Re: [PHP] two questions on serverside validation

2010-08-25 Thread David Mehler
Hello, Thanks to all who answered my quotes question. I've got another one. I've got several combo boxes that are sticky, below is an example of one and the function. Now i'd like to tighten it up by ensuring that an external user can't inject values other than value1 or value2 in to the script. Th

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Jan G.B.
2010/8/25 Marc Guay : >> function html($text) >> { >>        return htmlentities($text, ENT_QUOTES, 'UTF-8'); >> } >> >> function htmlout($text) >> { >>        return html($text); >> } > > Possibly irrelevant, and definitely not related to your questions, but > is it just me or is htmlout() a usele

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Marc Guay
> function html($text) > { >        return htmlentities($text, ENT_QUOTES, 'UTF-8'); > } > > function htmlout($text) > { >        return html($text); > } Possibly irrelevant, and definitely not related to your questions, but is it just me or is htmlout() a useless function? Why not just call html

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Ashley Sheridan
On Wed, 2010-08-25 at 16:48 +0200, Bostjan Skufca wrote: > Speed difference is substantial: > > ### Test 1: > $message1 = "asdf werqwe"; > for ($i=0; $i<1000; $i++) { > $message2 = $message1; > } > ### Takes 1,1 seconds (on machine tested) > > ### Test2: > $message1 = "asdf werqwe"; > fo

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Bostjan Skufca
Speed difference is substantial: ### Test 1: $message1 = "asdf werqwe"; for ($i=0; $i<1000; $i++) { $message2 = $message1; } ### Takes 1,1 seconds (on machine tested) ### Test2: $message1 = "asdf werqwe"; for ($i=0; $i<1000; $i++) { $message2 = "$message1"; } ### Takes 2,4 seconds

RE: [PHP] two questions on serverside validation

2010-08-25 Thread Bob McConnell
From: David Mehler > I've got two questions. I'm having to redo my form. Can you tell me > the difference if any between these two lines of code? This is for > output filtering. > > > > > One has the quotes around the parameter in the function call the other > does not. Here's the functions:

Re: [PHP] two questions on serverside validation

2010-08-25 Thread Ashley Sheridan
On Wed, 2010-08-25 at 10:24 -0400, David Mehler wrote: > Hello, > I've got two questions. I'm having to redo my form. Can you tell me > the difference if any between these two lines of code? This is for > output filtering. > > ?> > > > One has the quotes around the parameter in the function

Re: [PHP] two questions about usning session.

2003-03-12 Thread Marek Kilimajer
of IE 6.1 running, I didn't get two distinct values. Any idea? - Joe - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Joe Wong" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, March 12, 2003 8:43 PM Subject: Re: [PHP]

Re: [PHP] two questions about usning session.

2003-03-12 Thread Joe Wong
o: "Joe Wong" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, March 12, 2003 8:43 PM Subject: Re: [PHP] two questions about usning session. > on 07/03/03 5:45 PM, Joe Wong ([EMAIL PROTECTED]) wrote: > > > Hello, > > > > I have two questions about u

Re: [PHP] two questions about usning session.

2003-03-12 Thread Justin French
on 07/03/03 5:45 PM, Joe Wong ([EMAIL PROTECTED]) wrote: > Hello, > > I have two questions about using sessions in PHP. > > Firstly, I use session to remeber the username and a session ID for the > given user. When I hit the BACK button on the browser (IE), it always set > that my page is expire

Re: [PHP] Two questions

2001-02-19 Thread Brian T. Allen
SELECT SUBSTRING(COL3,0,100) AS COL3 FROM TABLE That will return the first 100 characters of your 10 pages of text... If you want characters 200 through 299 do: SELECT SUBSTRING(COL3,200,100) AS COL3 FROM TABLE Untested, but I am 99.9% sure that will meet your needs. Brian > > hmm...I don`