![]() |
|
#1
|
|||
|
|||
JavaScript to PHP Data PortYea this is probably easier that I would assume it to be. But here is the deal anyway. I have a javascript code that returns (actively as you type) how many words are in a certain text box. When the user is done with the box and submits the form, I need to take the word count that javascript gave on the page (which is contained in a span value at the moment), and somehow route it into a hidden input field or somehow save it to a PHP value, but I can't figure out how.
<span id="review_credits">0<span> The ID review_credits is controlled and updated by this: PHP Code:
This script basically counts the words and then sends it back to the HTML page as you type in the textarea. (onKeyUp function). How can I convert that span ID (when the user is done) into a PHP variable that I can then store into a MySQL dbase? Last edited by LuciWiz : 11-Jan-2006 at 00:04.
Reason: Please insert your Php code between [php] & [/php] tags
|
|
#2
|
|||
|
|||
Re: JavaScript to PHP Data PortNevermind once again. I just used cookies from javascript to PHP, worked quite well. I know this can be dangerous, but once I set the cookie to a variable in PHP, I removed it right after, in a split second. It would be quite hard to hack that information or retreive it from that. But all the same if they did get the info, they wouldn't know what to do with it because the numbers are hard to decipher. Oh well for them! Haha.
|
Recent GIDBlog
Last Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| An Introduction to Javascript | JasonMichael | Web Design Forum | 2 | 24-Oct-2004 10:19 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
| JavaScript Tutorial Part 1 | pcxgamer | Web Design Forum | 2 | 01-Dec-2003 09:16 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The