PHP-and-MySQL/C2/Echo-Function/English-timed

From Script | Spoken-Tutorial
Revision as of 15:42, 2 January 2013 by Minal (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Time Narration
0:01 Hi and welcome to a basic PHP tutorial.
0:05 I'll just go through how to use the "echo" function and how to set up your tags .
0:10 Those of you that are familiar with "html" will know that there are html tags to start your page and to end your page.
0:18 They're not vital in an html page. As long as you've got an html extension, you're fine.
0:25 However, in PHP, you need the tags. This starts and this ends.
0:30 That's basically the standard notation for it.
0:34 However, our content goes in between here.
0:39 Now, I've already saved my file as "helloworld.php".
0:43 So, let's save that and have a look in here.
0:47 Okay, there's nothing in the page at the moment but we've got our page set up. It's absolutely fine.
0:54 The "echo" function works like this: we've got echo, we've got some double quotes and we've got a line terminator which is the semicolon mark.
1:03 And our text goes in between here. Let's save that and we'll refresh. And there we go.
1:09 Right, you can – and I find this very useful – write your "echo" function like this.
1:16 Because when you put an html code inside your echo function these bits here don't represent line breaks. (and just to let you know, if you haven't learnt html yet I suggest you pick it up, at least the basics, because we're going to be using it quite a lot)
1:34 For that you need to add your own html in. So '
' for line break and then 'New line'.
1:43 We'll refresh this and there you go! Our html has been incorporated.
1:48 Okay, just to let you know, this is one thing that a lot of people run into: 'image source equals' and your file goes there.
1:57 However, at the moment we've got 'echo'.
2:01 This shows that we're going to start our output and this here will show that we're ending our output.
2:07 We don't end it here; we're going to end it here.
2:11 So instead of these, we'll need inverted commas.
2:14 Basically, that will let us show our image there.
2:18 There's no file specified, but you get the picture.
2:21 So, let me just show you what would happen if we keep these in and then with that I'll end the tutorial.
2:28 Right, we've got 'Parse error'.
2:31 We either need a comma or a semicolon to end, which proves that as we're coming up to here, we need a semicolon after this.
2:40 But in actual fact, that's not true.
2:42 So, just keep them as inverted commas.
2:45 Okay, that's the basics of the echo function and the PHP tags. Hope you enjoyed learning them.
2:52 Thanks for watching! This script has been translated by ---------------------------(translator's name) and this is -----------------------------------(narrator's name) signing off.

Contributors and Content Editors

Minal, PoojaMoolya, Pratik kamble, Sandhya.np14