Summary

JavaScript’s role in working with server-side languages such as PHP is one of preprocessing. Before data is passed to PHP to be placed into a database, the data needs to be examined to find out whether the user entered the text and values correctly. In this way, when the data is passed to PHP and on to a MySQL database, the user is not surprised to find either empty fields or mistakes that require re-entering data.

However, while JavaScript does have a pivotal role in communications with the server-side elements in a script, the data is passed by the form’s submit routine. Unfortunately, the submit() function in JavaScript will not set in motion the necessary elements to send data in the HTML page’s forms to the PHP script to be processed. ...

Get JavaScript Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.