Skip to main content

Testing variables with PHP

First, we'll take a look at how to display what's in your variables. We're going to be viewing our results on a web page.

So see if you can get this script working first, because it's the one we'll be building on. Using a text editor like Notepad, or your PHP software, type the following. (You can copy and paste it, if you prefer.

But you learn more by typing it out yourself - it doesn't really sink in unless you're making mistakes!)

<html>
<head>
<title>Variables - Some Practice</title>
</head>
<body>

<?php print("It Worked!"); ?>


</body>
</html>

J2program
Software Developer Ishan
When you've finished typing it all, save the page as variables.php. Then Run the script. Remember: when you're saving your work, save it to the WWW folder, as explained here.

To run the page, start your browser up and type this in the address bar:

 http://localhost/variables.php

If you've created a folder inside the www folder,
then the address to type in your browser would be something like: http://localhost/FolderName/variables.php

Comments

Popular posts from this blog

Nodejs Events

Events in Node.js The EventEmitter Object You can assign event handlers to your own events with the EventEmitter object. In the example below we have created a function that will be executed when a "scream" event is fired. To fire an event, use the  emit()  method. var events = require('events'); var eventEmitter = new events.EventEmitter();  //Create an event handler:  var myEventHandler = function () {   console.log('I hear a scream!');  }  //Assign the event handler to an event: eventEmitter.on('scream', myEventHandler);  //Fire the 'scream' event:  eventEmitter.emit('scream');

Family get-together with Ramadan Ifthar 2017

Family get-together with Ramadan Ifthar 2017

Node.js and Raspberry Pi

Raspberry Pi is a small, multi-use computer. With Node.js you can do amazing things with your Raspberry Pi. What is the Raspberry Pi? The Raspberry Pi is a small, affordable, and amazingly capable, credit card size computer. It is developed by the Raspberry Pi Foundation, and it might be the most versatile tech ever created. Creator Eben Upton's goal was to create a low-cost device that would improve programming skills and hardware understanding. Due to the small size and price of the device, it has become the center of a wide range of projects by tinkerers, makers, and electronics enthusiasts. Raspberry Pi and Node.js The Raspberry Pi has a row of GPIO (General Purpose input/output) pins, and these can be used to interact in amazing ways with the real world. This tutorial will focus on how to use these with Node.js. Write Raspbian OS Image to MicroSD Card Before we can start using our Raspberry Pi for anything, we need to get a OS installed. ...