Terion Miller wrote:
I have a php form, that uses a javascript word counter to make sure
submissions are a certain number of words, I have now been tasked with
taking that word count and having it pass in the email that gets sent when
someone submits a form ..in the subject line.
Here is the code I'm using so far. Is it possible to just echo a
javascript variable on a page like you can a php var?
javascript is client side.
php is server side.
To use something client side in a server side script, the web page has
to send it to the server from the client.
The best way to do what you want to do is probably to do the work count
server side, but if you really want to use what javascript produced you
can create a hidden input with a specified id, and use dhtml via
javascript to modify the input and insert the value into the value field
of the hidden input. Then it will get sent to the server when the user
hits the post button.
However, since you should be validating any user input server side,
you'll need to validate that the variable is accurate - might as well
just do the count with php server side.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php