Php runs on the server, before sending the apge to the client (user).
 This means the php script is completed when the user sees the page. 
To get php to execute code in response to the user's requests, the
whole page must be reloaded, with some sort of variable passed to the
php script to indicate which logical path to follow (ie. something to
put into an 'if' statment to get the code to do what you want).

If you want to communicate with your server based on what a user does,
without reloading your entire page, you should look at AJAX.

--- In [email protected], "Gordon Stewart" <[EMAIL PROTECTED]> wrote:
>
> I've sent the below to a Javascript group a short while ago - But i'll
> send here too...
> - I know this PHP group has experienced people & is a more active
group...
> 
> (although technically, what I need to know is a Javascript code that
> can activate a PHP script)
> 
> ==============================
> 
> Hi,
> 
> At this point of the script,
> 
> if (nochange == false)
>         {
>         alert("You have sent this message already. The text has been
left in
> place so that you do not need to type in everything all over again. If
> you would like to start from fresh use the \"Clear form\" button near
> the top right of the form.\n\nIf you would like to send it again click
> in each input area to enable the send buttons.")
> 
>         return;
>         }
> 
> 
> Is there a way for a javascript to activate a PHP script.. - before
> the "return" command...
> 
> (As yet, we dont need it to pass any variables...)
> 
> 
> -- 
> G
> NZ community groups - [EMAIL PROTECTED]
> Freecycle Auckland :-
> http://groups.yahoo.com/group/AucklandFreecycle/
>


Reply via email to