RE: [PHP] Code help on a multi select list

2004-10-29 Thread Jay Blanchard
[snip]
I want to do a server side trap  Seems people rely more on
javascript these days.  
[/snip]

There is a reason for that. It is in the first chapter of the popular
book 
Server Side is From Mars,
Client Side is From Venus.

Make no mistake, people often confuse the two. You, being the smart
programmer that you are, know that PHP is a server-side language and
JavaScript (often known as ECMAScript 290) is a client-side language.
You must be in touch with both sides to become an effective programmer
in today's world.

Other languages are also mentioned.

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



RE: [PHP] Code help on a multi select list

2004-10-29 Thread Reinhart Viane
I would choose javascript to to check this

-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 29 oktober 2004 15:13
To: [EMAIL PROTECTED]
Subject: [PHP] Code help on a multi select list


I want to do a server side trap if a user selects more
from a mult select list then allowed.  Just unsure and
didn't find any examples.  Seems people rely more on
javascript these days.  

So here is how I grab the array:

if ( is_array( $_REQUEST['LurkerIndustry'] ) ) { $_SESSION['l_industry']
= array_unique( array_merge( $_SESSION['l_industry'],
$_REQUEST['LurkerIndustry'] ) ); }

here is my somewhat hazy notion: 

if 
( is_array( $_REQUEST['LurkerIndustry'] ) ) { $_SESSION['l_industry'] =
array_unique( if $l_industry  5 
   ( Here I'm guess I need to redirect back to page   
 with and error message)

else
array_merge( $_SESSION['l_industry'],  $_REQUEST['LurkerIndustry'] ) );
}

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

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



RE: [PHP] Code help on a multi select list

2004-10-29 Thread Stuart Felenstein
--- Reinhart Viane [EMAIL PROTECTED] wrote:

 I would choose javascript to to check this
 

This response I don't understand.   There are 50
options and the intent is to allow 3 of those 50. 
Then some genius comes along and turns off
javascripting and chooses all 50.  I KNOW it will
happen.  I wouldn't even dare to dream that it may
not.  

Stuart

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



RE: [PHP] Code help on a multi select list

2004-10-29 Thread Reinhart Viane

It is not my intention to start a discussion on this, however, some
things, as you surely know, are better handled with javascript. If you
turn it the way you say now, I can follow your idea and thus you are
correct. It has te be very closed it seems.

Will look into it :)

-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 29 oktober 2004 15:29
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] Code help on a multi select list


--- Reinhart Viane [EMAIL PROTECTED] wrote:

 I would choose javascript to to check this
 

This response I don't understand.   There are 50
options and the intent is to allow 3 of those 50. 
Then some genius comes along and turns off
javascripting and chooses all 50.  I KNOW it will
happen.  I wouldn't even dare to dream that it may
not.  

Stuart

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



Re: [PHP] Code help on a multi select list

2004-10-29 Thread Ben Ramsey
Stuart Felenstein wrote:
I would choose javascript to to check this
This response I don't understand.   There are 50
options and the intent is to allow 3 of those 50. 
Then some genius comes along and turns off
javascripting and chooses all 50.  I KNOW it will
happen.  I wouldn't even dare to dream that it may
not.  

Stuart
Precisely... you can't rely on the the client to do your checking. You 
need to check from the server side to make sure no one's going to spoof 
your code. With that in mind, you mind want to implement both 
client-side and server-side checking. That way, it gives your legitimate 
users a more user-friendly approach, while still ensuring from the 
server-side that no one's going to spoof your form.

--
Regards,
Ben Ramsey
http://benramsey.com
---
Atlanta PHP - http://www.atlphp.org/
The Southeast's premier PHP community.
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Code help on a multi select list

2004-10-29 Thread Jay Blanchard
[snip]
--- Reinhart Viane [EMAIL PROTECTED] wrote:

 I would choose javascript to to check this
 

This response I don't understand.   [/snip]

What is not to understand here...you are the one who said, I want to do
a server side trap. JavaScript would be the only way to do that. I
agree with Ben who said to do both.

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



Re: [PHP] Code help on a multi select list

2004-10-29 Thread Ben Ramsey
Jay Blanchard wrote:
[snip]
I would choose javascript to to check this
This response I don't understand.   [/snip]
What is not to understand here...you are the one who said, I want to do
a server side trap. JavaScript would be the only way to do that. I
agree with Ben who said to do both.
I don't understand this response. ;-)
How is Javascript the /only way/ to do a /server-side/ trap? Javascript 
is for the client side (unless you're coding in ASP and choose to use 
JScript instead of VBScript).

--
Regards,
Ben Ramsey
http://benramsey.com
---
Atlanta PHP - http://www.atlphp.org/
The Southeast's premier PHP community.
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Code help on a multi select list

2004-10-29 Thread Stuart Felenstein

--- Jay Blanchard
[EMAIL PROTECTED] wrote:

 What is not to understand here...you are the one who
 said, I want to do
 a server side trap. JavaScript would be the only
 way to do that. 

Sorry, I used the wrong terminology.  I think my
statement was interpreted as using javascript at the
server level.

Stuart

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



Re: [PHP] Code help on a multi select list

2004-10-29 Thread Greg Donald
On Fri, 29 Oct 2004 09:36:07 -0400, Ben Ramsey [EMAIL PROTECTED] wrote:
 Precisely... you can't rely on the the client to do your checking. You
 need to check from the server side to make sure no one's going to spoof
 your code. With that in mind, you mind want to implement both
 client-side and server-side checking. That way, it gives your legitimate
 users a more user-friendly approach, while still ensuring from the
 server-side that no one's going to spoof your form.

I agree.  No sense in blasting a bad form post off to the server if
you can preempt it with javascript.  Put the load on the client when
possible I say.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



RE: [PHP] Code help on a multi select list

2004-10-29 Thread Graham Cossey
[snip]
 What is not to understand here...you are the one who said, I want to do
 a server side trap. JavaScript would be the only way to do that.
[snip]

Jay, you may want to re-read what you typed as JavaScript, to the best of my
knowledge, is actually client side...

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



RE: [PHP] Code help on a multi select list

2004-10-29 Thread Jay Blanchard
[snip]

-Original Message-
From: Ben Ramsey [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 29, 2004 8:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Code help on a multi select list


Jay Blanchard wrote:
 [snip]
I would choose javascript to to check this
 
 This response I don't understand.   [/snip]
 
 What is not to understand here...you are the one who said, I want to
do
 a server side trap. JavaScript would be the only way to do that. I
 agree with Ben who said to do both.

I don't understand this response. ;-)

How is Javascript the /only way/ to do a /server-side/ trap? Javascript 
is for the client side (unless you're coding in ASP and choose to use 
JScript instead of VBScript).
[/snip]

I don't understand this response. ;-)

The OP said JavaScript, so I couched it in those terms.

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



RE: [PHP] Code help on a multi select list

2004-10-29 Thread Jay Blanchard
[snip]
[snip]
 What is not to understand here...you are the one who said, I want to
do
 a server side trap. JavaScript would be the only way to do that.
[snip]

Jay, you may want to re-read what you typed as JavaScript, to the best
of my
knowledge, is actually client side...
[/snip]

I was just testing ya'lland somebody caught it! And I am still
asleep.

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



Re: [PHP] Code help on a multi select list

2004-10-29 Thread John Nichel
Graham Cossey wrote:
[snip]
What is not to understand here...you are the one who said, I want to do
a server side trap. JavaScript would be the only way to do that.
[snip]
Jay, you may want to re-read what you typed as JavaScript, to the best of my
knowledge, is actually client side...
It's Friday, and Jay probably needs coffee. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Code help on a multi select list

2004-10-29 Thread John Nichel
Jay Blanchard wrote:
snip
I don't understand this response. ;-)
The OP said JavaScript, so I couched it in those terms.
How do you respond to that response when the previous responder 
responded? :)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Code help on a multi select list

2004-10-29 Thread Jay Blanchard
[snip]
It's Friday, and Jay probably needs coffee. ;)
[/snip]

Make mine Communicty New Orleans Blend w/Chicory pleaseintravenously
please...

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



Re: [PHP] Code help on a multi select list

2004-10-29 Thread Greg Donald
On Fri, 29 Oct 2004 10:15:57 -0500, Jay Blanchard
[EMAIL PROTECTED] wrote:
 Make mine Communicty New Orleans Blend w/Chicory pleaseintravenously
 please...

Bah..  Mountain Dew and a couple of Sudafed is where it's at.  :)


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Code help on a multi select list

2004-10-29 Thread John Nichel
Greg Donald wrote:
On Fri, 29 Oct 2004 10:15:57 -0500, Jay Blanchard
[EMAIL PROTECTED] wrote:
Make mine Communicty New Orleans Blend w/Chicory pleaseintravenously
please...

Bah..  Mountain Dew and a couple of Sudafed is where it's at.  :)
The blood running thru my veins is about 85% Mt. Dew, but being from New 
Orleans, I understand that Community New Orleans Blend will slap you 
around a little bit after waking you up. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Code help on a multi select list

2004-10-29 Thread Stuart Felenstein

--- Greg Donald [EMAIL PROTECTED] wrote:

 Bah..  Mountain Dew and a couple of Sudafed is where
 it's at.  :)
 
 
That just doesn't sound right.

Stuart

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



Re: [PHP] Code help - file parse?

2004-01-30 Thread Raditha Dissanayake
Hi,

Parsing HTML is not the easiest thing to do and the best HTML parsers 
are in perl, you will be better of writing the page in PHP {unless you 
know the exact location (say file offset) where your date can be found }

john wrote:

Looking for code help: When my php script inserts data into the database I'd
like to parse an html page for a date and replace it with the current date.
This way visitors to the main html page can see the last time the database
was updated. I know I could re-write the html page using php but would
rather leave it html. Anyone have code to parse and replace based on a
hidden tag?
Thanks

 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Code help - file parse?

2004-01-30 Thread John Nichel
john wrote:

Looking for code help: When my php script inserts data into the database I'd
like to parse an html page for a date and replace it with the current date.
This way visitors to the main html page can see the last time the database
was updated. I know I could re-write the html page using php but would
rather leave it html. Anyone have code to parse and replace based on a
hidden tag?
Thanks

It can be as simple as opening the file, reading the file, looking for 
the hidden tag with a regular expression while writing to a temp file 
line by line, and if all that happens with no errors, replacing the html 
file with the temp file.

Simple, just a few steps involved, eh?

Me thinks is would be easier to rename the file from a html extension to 
a php oneleaving all content as isjust renameand using one 
little sniplet of php to output the date in the document.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Code Help Please

2003-05-31 Thread Jennifer Goodie
 I need to find if table1.username = table2.domain/table2.username  is

If you are using mySQL you can use CONCAT

table1.username = CONCAT(table2.domain,'/',table2.username)

http://www.mysql.com/doc/en/String_functions.html#IDX1174 
 

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



RE: [PHP] Code help

2002-11-06 Thread Martin Towell
CAUTION: It's not reliable

you can use $HTTP_REFERER
(or, I think's it's under $_SERVER, $_SERVER[HTTP_REFERER])

-Original Message-
From: William Holroyd [mailto:w.holroyd;versity-cobalt.com]
Sent: Thursday, November 07, 2002 12:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Code help


I am fairly new to the PHP language and have built a website with it before,
but nothing very complicated. Is there anyway of grabbing information from
the browser as to where a user may have come from (referring page, search
engine, etc.)? And if so, how would I go about getting it?

William



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

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