Jump to content

Automatic Post


-twenty

Recommended Posts

First, it depends on how you want to do it, the easy way (JS framework) or hard way (built-in javascript functions).  I don't know if you have experience with JS, but you need to make javascript send a POST or GET request to a page with the content using the format "/url?post=[...]" which you would process like any other form using PHP.

 

From briefly searching google for "PHP AJAX tutoria"l, I found this.  It covers sending the request without using a framework.  If you're going to use a framework I suggest either MooTools or jQuery.  I prefer Mootools mostly because it's geared more toward programmers and I find the native extensions very useful.

 

Edit:

To post when the character count is a set amount, you simple do this (using Mootools):

var ta = $('myTextarea');
ta.addEvent('keyup', function() {
     var length = ta.get('value').length;
     if(length >= 10) {
         var value = length.substr(0, 10);
         // Send POST request
     }
}

Link to comment
https://forums.phpfreaks.com/topic/183373-automatic-post/#findComment-967931
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.