Web developers may include a JS (JavaScript) file when they work with PHP (Hypertext Processing) for purposes of website development. When someone travels to a Web page that you create, the PHP code operates on your server and leads the visitor to your website via an Internet browser. PHP is known as a server-side programming language. On the other hand, a JS file operates on the client side. A JS file operates via your online browser once your website page gets loaded. If you know how to input the correct command strings on your computer, you can work with both PHP and JS files.
Instructions:
1. Insert your JS file in the form of an external file. Name your JS file "validation.js" and add it to your PHP page with the code below:
- Create your PHP code to make an external JS file if you plan to utilize PHP to personalize your JavaScript and you desire to use it on more than one page. Handle the JS file in the same manner as you would text. For instance, create a PHP file labeled "myjavascript.php" that creates an external JS file, using the code below:$name = $_GET["name"] ;?>function welcomeUser () {var user_id = ;alert("Welcome " + name + "!") ;}
0 comments:
Post a Comment