Difference between revisions of "PHP-and-MySQL/C4/Sending-Email-Part-1/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '{| border=1 !Time !Narration |- |0:00 |Hello and welcome. Today I will teach you how to create an email script particularly when you are registering a user onto a website. |- |…')
 
Line 1: Line 1:
 
{| border=1
 
{| border=1
!Time
+
|'''Time'''
!Narration
+
|'''Narration'''
 
|-
 
|-
|0:00
+
|00:00
 
|Hello and welcome.  Today I will teach you how to create an email script particularly when you are registering a user onto a website.  
 
|Hello and welcome.  Today I will teach you how to create an email script particularly when you are registering a user onto a website.  
 
|-
 
|-
|0:12
+
|00:12
 
|How do you send them an email confirming that they have registered.  I will do that partly by creating a script - a "Send me an email" script.  
 
|How do you send them an email confirming that they have registered.  I will do that partly by creating a script - a "Send me an email" script.  
 
|-
 
|-
|0:24
+
|00:24
 
|This will be in an HTML form in which you can write a subject and a message and send to a specified address.  
 
|This will be in an HTML form in which you can write a subject and a message and send to a specified address.  
 
|-
 
|-
|0:34
+
|00:34
 
|So, we will create an address variable.  
 
|So, we will create an address variable.  
 
|-
 
|-
|0:39
+
|00:39
 
|I will type my "hotmail" address here.
 
|I will type my "hotmail" address here.
 
|-
 
|-
|0:48
+
|00:48
 
|You can see when I open up my current "hotmail" page and click on "Inbox", there are no emails here from me.
 
|You can see when I open up my current "hotmail" page and click on "Inbox", there are no emails here from me.
 
|-
 
|-
|0:55
+
|00:55
 
|There are no new emails at the moment.  
 
|There are no new emails at the moment.  
 
|-
 
|-
|1:05
+
|01:05
 
|So This is the address in my address variable. I will rename the variable as "to" instead.
 
|So This is the address in my address variable. I will rename the variable as "to" instead.
 
|-
 
|-
|1:13
+
|01:13
 
|We will use the mail function to send this out.
 
|We will use the mail function to send this out.
 
|-
 
|-
|1:17
+
|01:17
 
|We will have the from and subject in here.
 
|We will have the from and subject in here.
 
|-
 
|-
|1:21
+
|01:21
 
|We will have a standard subject which says "Email from PHPAcademy".
 
|We will have a standard subject which says "Email from PHPAcademy".
 
|-
 
|-
|1:32
+
|01:32
 
|Next we need an HTML form that will submit.  I will create a self submission one.  
 
|Next we need an HTML form that will submit.  I will create a self submission one.  
 
|-
 
|-
|1:39
+
|01:39
 
|So lets put some html code here. I will have a form here which will submit to this page with "send me an email dot php".
 
|So lets put some html code here. I will have a form here which will submit to this page with "send me an email dot php".
 
|-
 
|-
|1:54
+
|01:54
 
|The method is going to be POST.  
 
|The method is going to be POST.  
 
|-
 
|-
|1:59
+
|01:59
 
|We will end our form here.
 
|We will end our form here.
 
|-
 
|-
|2:02
+
|02:02
 
|The user can type in whatever they want to send to the email address that is specified here.
 
|The user can type in whatever they want to send to the email address that is specified here.
 
|-
 
|-
|2:10
+
|02:10
 
|Obviously you can take this into account. When creating a form, you could say you want to send to this particular address.   
 
|Obviously you can take this into account. When creating a form, you could say you want to send to this particular address.   
 
|-
 
|-
|2:18
+
|02:18
 
|This one will just be "send me an email" script - the email that you want to include in one of your website.  
 
|This one will just be "send me an email" script - the email that you want to include in one of your website.  
 
|-
 
|-
|2:27
+
|02:27
 
|Now we will have a "text" input.  
 
|Now we will have a "text" input.  
 
|-
 
|-
|2:31
+
|02:31
 
|This will be the name of the person sending me the email.
 
|This will be the name of the person sending me the email.
 
|-
 
|-
|2:34
+
|02:34
 
|So you have type "text" whose name is "name"
 
|So you have type "text" whose name is "name"
 
|-
 
|-
|2:39
+
|02:39
 
|We'll have "max length" equal 20 for now.
 
|We'll have "max length" equal 20 for now.
 
|-
 
|-
|2:45
+
|02:45
 
|Underneath this we will create a text area.  
 
|Underneath this we will create a text area.  
 
|-
 
|-
|2:49
+
|02:49
 
|So I will type "textarea" and end it like that.
 
|So I will type "textarea" and end it like that.
 
|-
 
|-
|2:53
+
|02:53
 
|Then we will name it as "message".  
 
|Then we will name it as "message".  
 
|-
 
|-
|2:59
+
|02:59
 
|We put a paragraph beginning and a paragraph ending here  
 
|We put a paragraph beginning and a paragraph ending here  
 
|-
 
|-
|3:04
+
|03:04
 
|And down here we will create a submit button whose value equals "Send"
 
|And down here we will create a submit button whose value equals "Send"
  
 
|-
 
|-
|3:14
+
|03:14
 
|Or.... "Send me this", okay?
 
|Or.... "Send me this", okay?
 
|-
 
|-
|3:17
+
|03:17
 
|So if you come to our page and choose this page here  
 
|So if you come to our page and choose this page here  
 
|-
 
|-
|3:21
+
|03:21
 
|this is the space for the name and this is the space for the message.
 
|this is the space for the name and this is the space for the message.
 
|-
 
|-
|3:25
+
|03:25
 
|So let me just put "Name:" in here and "Message:" in here.  
 
|So let me just put "Name:" in here and "Message:" in here.  
 
|-
 
|-
|3:31
+
|03:31
 
|And this will look much better now.  We have our name box and our message box.  
 
|And this will look much better now.  We have our name box and our message box.  
 
|-
 
|-
|3:38
+
|03:38
 
|And when we click this button, the email will send.
 
|And when we click this button, the email will send.
 
|-
 
|-
|3:44
+
|03:44
 
|Okay so first of all inside our php code we need to check whether the submit button has been pressed.
 
|Okay so first of all inside our php code we need to check whether the submit button has been pressed.
 
|-
 
|-
|3:53
+
|03:53
 
|For that we have our "if" statement here in parenthesis and our curly brackets for our block if the condition is TRUE.  
 
|For that we have our "if" statement here in parenthesis and our curly brackets for our block if the condition is TRUE.  
 
|-
 
|-
|4:01
+
|04:01
 
|The condition will be inside these parenthesis.  
 
|The condition will be inside these parenthesis.  
 
|-
 
|-
|4:05
+
|04:05
 
|The condition will be the post variable of the "submit" button.
 
|The condition will be the post variable of the "submit" button.
 
|-
 
|-
|4:15
+
|04:15
 
|As long as the submit button has a value.... a spelling mistake....
 
|As long as the submit button has a value.... a spelling mistake....
 
|-
 
|-
|4:19
+
|04:19
 
|So long as the submit button has been pressed, this will contain a value and that value is "Send me this".  
 
|So long as the submit button has been pressed, this will contain a value and that value is "Send me this".  
 
|-
 
|-
|4:30
+
|04:30
 
|That would just mean that the form has been submitted because the button has been pressed.
 
|That would just mean that the form has been submitted because the button has been pressed.
 
|-
 
|-
|4:37
+
|04:37
 
|So inside here the first thing we need to do is get the data from the form.  
 
|So inside here the first thing we need to do is get the data from the form.  
 
|-
 
|-
|4:44
+
|04:44
 
|And that is the name of the person sending the email by submitting the form.
 
|And that is the name of the person sending the email by submitting the form.
 
|-
 
|-
|4:49
+
|04:49
 
|And their name is contained within this form here - sorry this field here called "name".
 
|And their name is contained within this form here - sorry this field here called "name".
 
|-
 
|-
|4:56
+
|04:56
 
|Also we have the message so we can easily duplicate this variable structure and say message in there.
 
|Also we have the message so we can easily duplicate this variable structure and say message in there.
 
|-
 
|-
|5:08
+
|05:08
 
|To test this out I'll say echo name.  
 
|To test this out I'll say echo name.  
 
|-
 
|-
|5:12
+
|05:12
 
|And I'll concatenate the message into that.  
 
|And I'll concatenate the message into that.  
 
|-
 
|-
|5:17
+
|05:17
 
|Lets just test this out.  Here I'll type "Alex".  
 
|Lets just test this out.  Here I'll type "Alex".  
 
|-
 
|-
|5:21
+
|05:21
 
|And here I will type "Hi there!"  
 
|And here I will type "Hi there!"  
 
|-
 
|-
|5:23
+
|05:23
 
|Click "Send me this" and we get "Alex" and "Hi there!" up there.  
 
|Click "Send me this" and we get "Alex" and "Hi there!" up there.  
 
|-
 
|-
|5:28
+
|05:28
 
|Ok so, we know that the form data has been submitted correctly.
 
|Ok so, we know that the form data has been submitted correctly.
 
|-
 
|-
|5:33
+
|05:33
 
|In the next part of this video we will learn how to validate this and eventually send this mail to the user specified in this email-id here.  
 
|In the next part of this video we will learn how to validate this and eventually send this mail to the user specified in this email-id here.  
 
|-
 
|-
|5:42
+
|05:42
 
|So join me in the next part. Bye for now.
 
|So join me in the next part. Bye for now.
 
|-
 
|-
|5:45
+
|05:45
 
|This is Evan Varkey dubbing for the Spoken Tutorial Project.
 
|This is Evan Varkey dubbing for the Spoken Tutorial Project.

Revision as of 12:55, 10 July 2014

Time Narration
00:00 Hello and welcome. Today I will teach you how to create an email script particularly when you are registering a user onto a website.
00:12 How do you send them an email confirming that they have registered. I will do that partly by creating a script - a "Send me an email" script.
00:24 This will be in an HTML form in which you can write a subject and a message and send to a specified address.
00:34 So, we will create an address variable.
00:39 I will type my "hotmail" address here.
00:48 You can see when I open up my current "hotmail" page and click on "Inbox", there are no emails here from me.
00:55 There are no new emails at the moment.
01:05 So This is the address in my address variable. I will rename the variable as "to" instead.
01:13 We will use the mail function to send this out.
01:17 We will have the from and subject in here.
01:21 We will have a standard subject which says "Email from PHPAcademy".
01:32 Next we need an HTML form that will submit. I will create a self submission one.
01:39 So lets put some html code here. I will have a form here which will submit to this page with "send me an email dot php".
01:54 The method is going to be POST.
01:59 We will end our form here.
02:02 The user can type in whatever they want to send to the email address that is specified here.
02:10 Obviously you can take this into account. When creating a form, you could say you want to send to this particular address.
02:18 This one will just be "send me an email" script - the email that you want to include in one of your website.
02:27 Now we will have a "text" input.
02:31 This will be the name of the person sending me the email.
02:34 So you have type "text" whose name is "name"
02:39 We'll have "max length" equal 20 for now.
02:45 Underneath this we will create a text area.
02:49 So I will type "textarea" and end it like that.
02:53 Then we will name it as "message".
02:59 We put a paragraph beginning and a paragraph ending here
03:04 And down here we will create a submit button whose value equals "Send"
03:14 Or.... "Send me this", okay?
03:17 So if you come to our page and choose this page here
03:21 this is the space for the name and this is the space for the message.
03:25 So let me just put "Name:" in here and "Message:" in here.
03:31 And this will look much better now. We have our name box and our message box.
03:38 And when we click this button, the email will send.
03:44 Okay so first of all inside our php code we need to check whether the submit button has been pressed.
03:53 For that we have our "if" statement here in parenthesis and our curly brackets for our block if the condition is TRUE.
04:01 The condition will be inside these parenthesis.
04:05 The condition will be the post variable of the "submit" button.
04:15 As long as the submit button has a value.... a spelling mistake....
04:19 So long as the submit button has been pressed, this will contain a value and that value is "Send me this".
04:30 That would just mean that the form has been submitted because the button has been pressed.
04:37 So inside here the first thing we need to do is get the data from the form.
04:44 And that is the name of the person sending the email by submitting the form.
04:49 And their name is contained within this form here - sorry this field here called "name".
04:56 Also we have the message so we can easily duplicate this variable structure and say message in there.
05:08 To test this out I'll say echo name.
05:12 And I'll concatenate the message into that.
05:17 Lets just test this out. Here I'll type "Alex".
05:21 And here I will type "Hi there!"
05:23 Click "Send me this" and we get "Alex" and "Hi there!" up there.
05:28 Ok so, we know that the form data has been submitted correctly.
05:33 In the next part of this video we will learn how to validate this and eventually send this mail to the user specified in this email-id here.
05:42 So join me in the next part. Bye for now.
05:45 This is Evan Varkey dubbing for the Spoken Tutorial Project.

Contributors and Content Editors

Gyan, Pratik kamble, Sandhya.np14