php-general Digest 21 Dec 2009 16:04:17 -0000 Issue 6499

Topics (messages 300621 through 300625):

Re: Form validation issue
        300621 by: Midhun Girish
        300622 by: Phpster
        300625 by: tedd

Re: SQL Queries
        300623 by: Floyd Resler

Re: Checking for internet connection.
        300624 by: Bob McConnell

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
"then the page gets reloaded and clears all the javascript error messages
and does the PHP validation."
That is because the form is getting submitted... make sure you js code
prevents form submit if errors are found....



Midhun Girish


On Mon, Dec 21, 2009 at 8:13 AM, Ernie Kemp <ernie.k...@sympatico.ca> 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:
>
>                 <form name="myForm" action="<?php echo
> $_SERVER['PHP_SELF'];?>" method="post" onsubmit='return formValidator()' >
>
>
>
> 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
>
>
>
>
>
>
>
>
>
>
>

--- End Message ---
--- Begin Message ---
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" <ernie.k...@sympatico.ca> 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:

<form name="myForm" action="<?php echo $_SERVER ['PHP_SELF'];?>" method="post" onsubmit='return formValidator()' >



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











--- End Message ---
--- Begin Message ---
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:
<form name="myForm" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" onsubmit='return formValidator()' >

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

--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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

--- End Message ---

Reply via email to