Difference between revisions of "PHP-and-MySQL/C2/GET-Variable/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 4: Line 4:
 
|-
 
|-
 
|00:01  
 
|00:01  
|Welcome to this Spoken Tutorial on get variable.
+
|Welcome to this Spoken Tutorial on '''get variable'''.
 
|-
 
|-
 
|00:09
 
|00:09
|Get variable is a very useful variable type.  
+
|'''get''' variable is a very useful variable type.  
 
|-
 
|-
 
|00:17
 
|00:17
|It is used for most of the  dynamic website with forms that have click-able buttons.
+
|It is used for most of the  '''dynamic website''' with '''forms''' that have click-able '''buttons'''.
 
|-  
 
|-  
 
|00:27
 
|00:27
|It's also visible to the user.You may have seen anything like this on your page.
+
|It's also visible to the user. You may have seen anything like this on your page.
 
|-
 
|-
 
|00:33
 
|00:33
|Let us click on this.You may have seen something like this, a question mark.  
+
|Let us click on this. You may have seen something like this, a question mark.  
 
|-
 
|-
 
|00:39
 
|00:39
|Say for example, name equals to Alex. Something similar may have appeared in your address bar.
+
|Say for example, '''name''' equals to "Alex". Something similar may have appeared in your '''address bar'''.
 
|-
 
|-
 
|00:47
 
|00:47
|You may have seen 'and' something else as well, for example your name equals to Kyle
+
|You may have seen 'and' something else as well, for example your name equals to "Kyle".
 
|-
 
|-
 
|00:54
 
|00:54
|This is the get variable.
+
|This is the '''get''' variable.
 
|-
 
|-
 
|00:56  
 
|00:56  
|What it basically does is, it takes submitted data from an HTML form. Puts it in the storage which we're supposed to use. And,it's just in your address bar.
+
|What it basically does is, it takes submitted data from an '''HTML form'''. Puts it in the storage which we're supposed to use. And, it's just in your address bar.
 
|-
 
|-
 
|01:08
 
|01:08
|The get variable has limitations. It can only be a 100 characters long. It is visible to the user. So, it's not good to use it for a password.
+
|The '''get''' variable has limitations. It can only be a 100 characters long. It is visible to the user. So, it's not good to use it for a password.
 
|-
 
|-
 
|01:20
 
|01:20
|Now, to create the use for this, you don't need to declare it, as the other variables in Php.
+
|Now, to create the use for this, you don't need to declare it as the other variables in '''Php'''.
 
|-
 
|-
 
|01:28
 
|01:28
|I'm going to say echo , then a dollar sign, an underscore and a get.
+
|I'm going to say '''echo''' , then a dollar sign ($), an underscore and a '''get'''.
 
|-
 
|-
 
|01:33
 
|01:33
|And in square brackets you need to write the name of the variable for example, "my name" .
+
|And in square brackets you need to write the name of the variable, for example: "myname".
 
|-
 
|-
 
|01:40
 
|01:40
|This is all I need to basically echo out, i.e, what has been posted in a form. Even though I don't have a form , I can still mimic this.
+
|This is all I need to basically '''echo''' out, i.e what has been posted in a '''form'''. Even though I don't have a '''form''', I can still mimic this.
 
|-
 
|-
 
|01:51
 
|01:51
|What I do is I put a ? and I say my name is equals to Alex. Then I press enter and the data is displayed.
+
|What I do is, I put a "?" and I say '''myname''' is equals to "Alex". Then I press '''Enter''' and the '''data''' is displayed.
 
|-
 
|-
 
|02:03
 
|02:03
|The same way I can write Kyle or any other name or variable I want
+
|The same way, I can write "Kyle" or any other name or variable I want.
 
|-
 
|-
 
|02;09
 
|02;09
|It can be numbers, letters or strings.
+
|It can be numbers, letters or '''strings'''.
 
|-
 
|-
 
|02:15
 
|02:15
|Now, I'm going to show you how to submit a form using the get method.
+
|Now, I'm going to show you how to submit a '''form''' using the '''get''' method.
 
|-
 
|-
 
|02:22
 
|02:22
|Basically,I'm going to create an HTML page.
+
|Basically, I'm going to create an '''HTML page'''.
 
|-
 
|-
 
|02:30
 
|02:30
|I'm going to have a form and the action of the form.
+
|I'm going to have a '''form''' and the action of the form.
 
|-
 
|-
 
|02:34
 
|02:34
Line 67: Line 67:
 
|-
 
|-
 
|02:44
 
|02:44
|The action is going to be in the same pace that we're working with. This method is going to equal get because that's the method we're using. Finally, you can end your form like that.
+
|The '''action''' is going to be in the same pace that we're working with. This method is going to equal '''get''' because that's the method we're using. Finally, you can end your '''form''' like that.
 
|-
 
|-
 
|02:58
 
|02:58
|We're going to need an input box and it's name is very important.
+
|We're going to need an '''input box''' and it's name is very important.
 
|-
 
|-
 
|03:03
 
|03:03
Line 76: Line 76:
 
|-
 
|-
 
|03:11
 
|03:11
|We're also going to need a submit buzzer. In the input type 'submit' put some user friendly value like 'click here'.
+
|We're also going to need a '''submit''' buzzer. In the '''input''', type 'submit', put some user friendly value like "click here".
 
|-
 
|-
 
|03:26
 
|03:26
|Refresh it and there you go.Just leave this as it is.
+
|'''Refresh''' it and there you go. Just leave this as it is.
 
|-
 
|-
 
|03:33
 
|03:33
|Let me type the name 'Alex' and click here.You can see this is changed here. It is giving my name, which is the name of this box here. Also it's giving the value of what I've typed in.
+
|Let me type the name 'Alex' and click here.You can see this is changed here. It is giving 'my name' which is the name of this box here. Also it's giving the value of what I've typed in.
 
|-
 
|-
 
|03:47
 
|03:47
|So, now what I want to do in Php is, echo out this value.
+
|So, now what I want to do in '''Php''' is, '''echo''' out this value.
 
|-
 
|-
 
|03:52
 
|03:52
|I'll start quoting underneath this HTML. It is possible to incorporate Php and HTML on one page. So long as it is not between Php tags. Unless it's in an echo function.
+
|I'll start quoting underneath this HTML. It is possible to incorporate '''Php''' and '''HTML''' on one page. So long as it is not between '''Php tags'''. Unless it's in an '''echo''' function.
 
|-
 
|-
 
|04:07
 
|04:07
|Now, let' say name is equal to dollar sign, underscore, get.
+
|Now, let' say '''name''' is equal to dollar sign, underscore, '''get'''.
 
|-
 
|-
 
|04:14
 
|04:14
|And, in my name, I better mind this has to match this. Otherwise you won't get any response.
+
|And, in 'my name', I better mind this has to match this. Otherwise you won't get any response.
 
|-
 
|-
 
|04:20
 
|04:20
|Then just say echo and Your or just Hello and then name.
+
|Then just say '''echo''' and Your or just '''Hello''' and then name.
 
|-
 
|-
 
|04:31
 
|04:31
Line 103: Line 103:
 
|-
 
|-
 
|04:35
 
|04:35
|We've already got hello.
+
|We've already got "hello".
 
|-
 
|-
 
|04:40
 
|04:40
|And using an if, I'll type in Alex, since I clicked that.  
+
|And using an '''if''', I'll type in "Alex" since I clicked that.  
 
|-
 
|-
 
|04:48
 
|04:48
|This is how Alex appears. But now we've a problem. We've got Hello and then a blank here with a full stop. We want to get rid of that.
+
|This is how "Alex" appears. But now we've a problem. We've got "Hello" and then a blank here with a full stop. We want to get rid of that.
 
|-
 
|-
 
|05:06
 
|05:06
|You just have to say 'if name' because we've already got one line.We don't need curly brackets and name itself is present.So, it's true.
+
|You just have to say 'if name' because we've already got one line. We don't need curly brackets and 'name' itself is present. So, it's '''true'''.
 
|-
 
|-
 
|05:23
 
|05:23
|If there's no value sent to name this will automatically assume as false. Therefore it won't execute this.
+
|If there's no value sent to '''name''' this will automatically assume as '''false'''. Therefore it won't execute this.
 
|-
 
|-
 
|05:33
 
|05:33
|So, Refresh.There, it's gone.
+
|So, '''Refresh'''.There, it's gone.
 
|-
 
|-
 
|05:39
 
|05:39
Line 127: Line 127:
 
|-
 
|-
 
|05:47
 
|05:47
|So,that's the end of the get variable.
+
|So,that's the end of the '''get''' variable.
 
|-
 
|-
 
|05:50
 
|05:50
|In my next tutorial, I will talk about the post variable and it's uses. This is Anoushka for the Spoken Tutorial Project. Thanks for watching.
+
|In my next tutorial, I will talk about the '''post''' variable and its uses. This is Anoushka for the Spoken Tutorial Project. Thanks for watching.

Revision as of 14:51, 21 May 2015

Time Narration
00:01 Welcome to this Spoken Tutorial on get variable.
00:09 get variable is a very useful variable type.
00:17 It is used for most of the dynamic website with forms that have click-able buttons.
00:27 It's also visible to the user. You may have seen anything like this on your page.
00:33 Let us click on this. You may have seen something like this, a question mark.
00:39 Say for example, name equals to "Alex". Something similar may have appeared in your address bar.
00:47 You may have seen 'and' something else as well, for example your name equals to "Kyle".
00:54 This is the get variable.
00:56 What it basically does is, it takes submitted data from an HTML form. Puts it in the storage which we're supposed to use. And, it's just in your address bar.
01:08 The get variable has limitations. It can only be a 100 characters long. It is visible to the user. So, it's not good to use it for a password.
01:20 Now, to create the use for this, you don't need to declare it as the other variables in Php.
01:28 I'm going to say echo , then a dollar sign ($), an underscore and a get.
01:33 And in square brackets you need to write the name of the variable, for example: "myname".
01:40 This is all I need to basically echo out, i.e what has been posted in a form. Even though I don't have a form, I can still mimic this.
01:51 What I do is, I put a "?" and I say myname is equals to "Alex". Then I press Enter and the data is displayed.
02:03 The same way, I can write "Kyle" or any other name or variable I want.
02;09 It can be numbers, letters or strings.
02:15 Now, I'm going to show you how to submit a form using the get method.
02:22 Basically, I'm going to create an HTML page.
02:30 I'm going to have a form and the action of the form.
02:34 If you haven't learnt HTML already, it would be very useful to learn it before you start working with this.
02:44 The action is going to be in the same pace that we're working with. This method is going to equal get because that's the method we're using. Finally, you can end your form like that.
02:58 We're going to need an input box and it's name is very important.
03:03 I'm going to call it 'my name' which is the variable that's going to appear.
03:11 We're also going to need a submit buzzer. In the input, type 'submit', put some user friendly value like "click here".
03:26 Refresh it and there you go. Just leave this as it is.
03:33 Let me type the name 'Alex' and click here.You can see this is changed here. It is giving 'my name' which is the name of this box here. Also it's giving the value of what I've typed in.
03:47 So, now what I want to do in Php is, echo out this value.
03:52 I'll start quoting underneath this HTML. It is possible to incorporate Php and HTML on one page. So long as it is not between Php tags. Unless it's in an echo function.
04:07 Now, let' say name is equal to dollar sign, underscore, get.
04:14 And, in 'my name', I better mind this has to match this. Otherwise you won't get any response.
04:20 Then just say echo and Your or just Hello and then name.
04:31 Let's get rid of this and start again.
04:35 We've already got "hello".
04:40 And using an if, I'll type in "Alex" since I clicked that.
04:48 This is how "Alex" appears. But now we've a problem. We've got "Hello" and then a blank here with a full stop. We want to get rid of that.
05:06 You just have to say 'if name' because we've already got one line. We don't need curly brackets and 'name' itself is present. So, it's true.
05:23 If there's no value sent to name this will automatically assume as false. Therefore it won't execute this.
05:33 So, Refresh.There, it's gone.
05:39 We have our value in and I click there.
05:42 It's detected that a value is present here and it's echoed out.
05:47 So,that's the end of the get variable.
05:50 In my next tutorial, I will talk about the post variable and its uses. This is Anoushka for the Spoken Tutorial Project. Thanks for watching.

Contributors and Content Editors

Minal, PoojaMoolya, Pratik kamble, Sandhya.np14