Re: [PHP] Form validation issue

2009-12-21 Thread Phpster

Does the js function return false on the errors to block the submission?

Bastien

Sent from my iPod

On Dec 20, 2009, at 9:43 PM, "Ernie Kemp"   
wrote:



Good Day,



I need help in in validating a form.

The for is valdated be a javascript frist then if  
all the fields are filled in its valaded be PHP.




The Form starts with:






The “formValidator()” goes to a javascript and does display the  
missing information in this case BUT then the page gets reloaded and 
 clears all the javascript error messages and does the PHP validation.




The PHP only runs if the fields are set by testing using ‘isset”.



Without puting on numeric lines of go can you suggest things I must  
have overlooked. Silly request but there must be something I’m overl 
ooking.I have simular code on other programs but this one is cas 
uing me trouble.




Thanks every so much..



../Ernie












Re: [PHP] SQL Queries

2009-12-21 Thread Floyd Resler
You should be able to do this from within the query.  Try the following query:

DELETE users.*
FROM users 
LEFT JOIN notes 
USING(user_id) 
WHERE notes.note_id IS NULL

Take care,
Floyd

On Dec 20, 2009, at 4:30 PM, דניאל דנון wrote:

> Hey, Lets assume I got a table named "users".
> It contains id & name.
> 
> I have another table called "notes" - which contains id, user_id, contents
> 
> 
> I want to delete all users from table "users" that don't have notes (SELECT
> ... FROM notes WHERE user_id=ID) returns empty result.
> 
> 
> What is the fastest way to do it?
> 
> -- 
> Use ROT26 for best security


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



RE: [PHP] Checking for internet connection.

2009-12-21 Thread Bob McConnell
From: Andy Shellam

>> By attempting to connect you will implicitly query DNS (which itself
>> is a connection to server).  
> 
> No it's not - it's putting out a packet targeted at an IP address
> and hoping a server will answer - hence why multi-cast works for
> DNS because you're not directly connecting to a specified server,
> like you do with TCP/IP.  I believe it's similar for ping which is
> why it's used so commonly in monitoring applications.
> 
> > If you're not online you won't be able to
>> resolve the domain name.  
> 
> Exactly - so if all the OP wanted to check for was a working
> Internet connection, then DNS is a better way to go IMHO.

Both at home and at work there are caching DNS on the LAN. So a DNS
request may come back with a valid IP address when the WAN connection is
down. I still won't be able to connect to the remote site.

Bob McConnell

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



Re: [PHP] Form validation issue

2009-12-21 Thread tedd

At 9:43 PM -0500 12/20/09, Ernie Kemp wrote:

Good Day,

I need help in in validating a form.
The for is valdated be a javascript frist then if 
all the fields are filled in its valaded be PHP.


The Form starts with:



The "formValidator()" goes to a javascript and does display the 
missing information in this case BUT then the page gets reloaded and 
clears all the javascript error messages and does the PHP validation.


The PHP only runs if the fields are set by testing using 'isset".

Without puting on numeric lines of go can you suggest things I must 
have overlooked. Silly request but there must be something I'm 
overlooking.I have simular code on other programs but this one 
is casuing me trouble.


Thanks every so much..




Ernie:

Client-side javascript can help populate fields and correct any 
problems a user might have, but once the form is submitted to the 
server, then the data is sent and evaluated server-side, hence 
validation.


However, if the server-side evaluation fails and the page is 
refreshed, then all the previous values are lost -- UNLESS -- you 
keep them in a cookie, database, or session. I suggest using a 
session.


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