For 2021 - online Python 3 training - see ((here)).
Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.
Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Sending a message to the server and changing text on a page when a button is pressed
* I wish to provide a button on my page that signals when it's pressed back to the server
* I wish the server to log the button press (a vote, perhaps) but not refresh the page
* I wish to change the text on the page to give visual feedback that the button has been pressed
Easy enough, but hard to find all in one example.
I've just added a "like" facility on to the First Great Western Coffee Shop forum
Here's the HTML for each "like" button" (shown over multiple lines to make it easier to read):
The reference number in the example is the message number that the like button is attached to; this HTML is generated by a modified PHP forum script so that the receiving lyke.php knows [i]what[/i] the user has liked. It uses the forum cookie to identify [i]who[/i] is doing the liking, and registers all likes in a MySQL database to stop users registering lots of votes for the same post.
In order to prevent the browser redrawing the page, the lyke.php includes the following header:
header("HTTP/1.1: 204 No Content");
And (as that might suggest) there is no content. the onClick Javascipt changes the work "like" into "yum!" to indicate that the button was pressed. (written 2014-05-23, updated 2014-05-26)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articlesW603 - Web and Intranet - Server Side Technologies 
How similar are two words - (2006-03-11) 
Easy feed! - (2006-03-21) 
Where is a web site visitor browsing from - (2006-05-24) 
Parallel processing in PHP - (2007-01-03) 
robots.txt - a clue to hidden pages? - (2007-01-13) 
.php or .html extension? Morally Static Pages - (2007-09-17) 
Korn Shell scripts on the web - (2007-09-25) 
Online hotel reservations - Melksham, Wiltshire (near Bath) - (2008-02-24) 
PHP training courses every month - (2008-04-18) 
Using server side and client side programming together - (2008-08-11) 
Effect on server when memory runs out and swapping starts - (2009-02-26) 
Checking robots.txt from Python - (2009-07-12) 
Django Training Courses - UK - (2012-04-23) 
How does PHP work? - (2012-11-07)W602 - Web and Intranet - Client Side Technologies 
Flash - is it available to your web page? - (2007-08-26) 
Adding a button to a web page to print the page - (2008-06-18) 
Starting Ajax - easy example of browser calling up server data - (2008-09-27) 
Ajax - going Asyncronous and what it means - (2008-09-28) 
Dynamic / changing images on your web page - (2009-09-01) 
How does your browser find out about itself? - (2011-01-11) 
Problem ... I want to print a series of numbered forms - (2014-10-05)
Some other Articles
A different vision for the futureMaking use of huge data, object orientation, unit testing and frameworksUpcoming public courses from Well House ConsultantsFuture Swindon - Westbury train services. At current level into the future?Sending a message to the server and changing text on a page when a button is pressedSwindon to Weymouth - by train, the traditional way - 2014Eurpoean Elections, and other elections ahead. Some thoughts on campaigns and policiesString formatting in Lua - string.format as a wrapper for sprintfDot or Colon separator between table name and member in Lua - what is the difference?Lazy operators in Lua - what they mean, and examples
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page
This is a page archived from The Horse's Mouth at
the diary and writings of Graham Ellis.
Every attempt was made to provide current information at the time the
page was written, but things do move forward in our business - new software
releases, price changes, new techniques. Please check back via
our main site for current courses,
prices, versions, etc - any mention of a price in "The Horse's Mouth"
cannot be taken as an offer to supply at that price.
Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).