• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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. However, you can use the submit() function to launch a PHP script where passing variables in not a requirement.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint