Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
autosave text in html text box to MySQL
Old 10-17-2010, 10:56 PM autosave text in html text box to MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
I would like a user to enter text into an HTML textbox, and have that data be Automatically saved to MySQL every 10 minutes, etc.


Not asking you to code this for me, just wondering how it would work.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-17-2010, 11:01 PM Re: autosave text in html text box to MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
For instance: if "sally loves joe" was entered into a textbox and saved to MySQL, would an adequate script require that the code flush the data previously stored before storing the newly saved data in it's place?
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 10-18-2010, 12:36 AM Re: autosave text in html text box to MySQL
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
If I'm understanding correctly you'd need to use ajax to submit the data. From there it would be up to whether or not to replace the data previously stored or to create another row.

Wordpress does something like this; if you're writing a post it will be saved periodically. In this particular case, every time the data is saved a new row is inserted.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 10-18-2010, 11:06 PM Re: autosave text in html text box to MySQL
ice800's Avatar
Banned

Posts: 2
Name: joan
Trades: 0
o, i have suffered the same problem as you, but i do not find the best method. need help!
ice800 is offline
Reply With Quote
View Public Profile
 
Old 10-23-2010, 02:30 AM Re: autosave text in html text box to MySQL
Junior Talker

Posts: 1
Trades: 0
i am looking for the solution too, but did fond it yet
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
criss81 is offline
Reply With Quote
View Public Profile Visit criss81's homepage!
 
Old 10-23-2010, 02:39 AM Re: autosave text in html text box to MySQL
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
Quote:
Originally Posted by NullPointer View Post

Wordpress does something like this; if you're writing a post it will be saved periodically.
This is exactly what came to mind.


I've never worked with AJAX, looks like now is the time to learn.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 10-26-2010, 01:29 PM Re: autosave text in html text box to MySQL
Justinwiz's Avatar
Skilled Talker

Posts: 58
Name: Justin
Location: /etc/httpd/logs/error_log
Trades: 0
Use AJAX and Javascript to call a PHP script every 10 minutes and send the value of the textarea to the PHP script (GET), the PHP script then takes the data and replaces the current value in the MySQL table with the new one.
__________________
█ Reliable VPS and Minecraft server hosting at extremely affordable prices.

Please login or register to view this content. Registration is FREE
Justinwiz is offline
Reply With Quote
View Public Profile
 
Old 10-27-2010, 02:52 AM Re: autosave text in html text box to MySQL
Banned

Posts: 4
Name: AP
Trades: 0
You should use AJAX along with window.setInterval and some server side PHP scripting. Draft outline of the process using jQuery:

HTML Code:
<form id="form1">
    <textarea name="text1"></textarea>
</form>
<script type="text/javascript">
    window.setInterval(function () {
        jQuery.post("save-draft.php", $("#form1").serialize(););
    }, 10 * 60 * 1000);
</script>
Inside the "save-draft.php" script you will have access to all form elements including "text1". Use a MySQL update query to update the draft.
ap2010 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to autosave text in html text box to MySQL
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.91691 seconds with 12 queries