RE: [PHP] <form action="?">

From: Date: Wed, 12 Nov 2003 16:43:15 +0000
Subject: RE: [PHP] <form action="?">
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-169300@lists.php.net to get a copy of this message
> -----Original Message----- > From: Chris Shiflett [mailto:shiflett@php.net] > Sent: woensdag 12 november 2003 17:23 > To: Alan Lord; php-general@lists.php.net > Subject: Re: [PHP] <form action="?"> > > --- Alan Lord <lord_alan@hotmail.com> wrote: > > can I put a function_name() in the <form action="..."> place holder? For once and for all .. NO, you cannot do that. The form is submitted to a page, and this page will execute funtions. What you might want to do is this (though I doubt if you want to do it cuz it is pretty unsafe): <forma action='execute.php?f=function_name' method='post'> == execute.php ====== <?php if (isset($_POST['f'])) $_POST['f'](); ?> > > I think you can do this with JavaScript, yes. No, Chris. For as far as I know you cannot even do this with JavaScript. Though I've never tried it. What you can do is use the 'onSubmit' event like this: <form action='foo.php' onSubmit='return FunctionDeclaredInJavascript()'> Where FunctionDeclaredInJavascript() is a function declared in JS (not in PHP). If it returns false the form will not be submitted, if it returns true the form will .. Guesss what? :P > > Chris > > ===== > My Blog > http://shiflett.org/ > HTTP Developer's Handbook > http://httphandbook.org/ > RAMP Training Courses > http://www.nyphp.org/ramp > > -- > PHP General Mailing List (http://www.php.net/) To > unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#169300) next »