The PHP tutorial Youtube videos from Elithecomputerguy were like online class lectures about the basics of PHP to more sophisticated uses of the language. His teaching method is praised by many for he goes through material in a pace that newcomers can keep up with as well as being in-depth with the functionality of the language so others can relate to it. There are segments in every video in which he gives the viewer the opportunity to write programs alongside him to get practice and a bit of hands-on experience. Each lesson in the series is organized from beginner to advanced, as each is very detailed. Below, questions from parts 1 - 6 can be found with my answers to them.
How does Eli describe PHP?
Great language to learn to do admin tasks or develop web tools. Wonderful and easy. Allows creation of useful web apps. Makes Websites useful. Heavy lifting for websites; allows interaction of data and write and change dynamic websites. It serves as an intermediary for files to a database or etc.
Briefly compare and contrast scripted and compiled languages
Compiled language is writing all the code and putting it through a compiler, creating an executable file; cannot edit. Scripted languages upload text files to a server, an interpreter, and is read, creating the website to the user.
Briefly explain the difference between client side and server side scripting.
The client-side environment used to run scripts is usually a browser. The processing takes place on the end users computer. The server-side environment that runs a scripting language is a web server. A user request is fulfilled by running a script directly on the web server to generate dynamic HTML pages.
What popular website does Eli cite as an example of what you can do with PHP and MySQL? Why did Eli that that this particular site was a good example?
Craigslist. Is a simple looking website designed with HTML, but is also one of the most functional websites ever. It is fueled by numerous forms, functions, and databases that PHP helps with managing all the time. MySQL stores everything the site hosts into its web server/.
What does Eli emphasize as the 'nice' thing about scripted languages such as PHP?
The nice thing about scripted languages such as PHP is that it is dynamic.
What is notepad++? Why would Eli recommend notepad++?
Its more sophisticated than notepad and it is free to use. It has extra features such as file upload when creating small applications or new to coding.
If you want to write and run PHP code, what do you need?
You need a web server and text editor like notepad++. FTP will be needed as well in order to upload and download scripts from the server.
How does Eli describe syntax? How you spell the commands when writing code
Syntax is the principle on writing code in PHP.
In a Linux context, does capitalization matter?
Yes. For linux, capitalization is very important. Scripts in uppercase and lowercase can be different, even if they have the same name.
What are the basic attirbutes of PHP syntax?
Basic PHP attributes are: - tell browser there is PHP. Print - prints to screen of web browser. Use quotation marks. Finally, The semicolon is the equivalent of a period in the English language
Discuss one of the PHP error handling techniques that Eli presents.
Using the error messages from the webpage, you can trace back to the location of the error and debug your program until the problem is fixed.
What is the difference between printing text and printing HTML?
The formatting is different and may not look the same. Websites sees text in HTML format, so printing text out normally will not be recognized by the browser. Any new line breaks for a print will not be seen .
What happens if you add a PHP script to a HTML page and you don’t change the file type to .php from .html?
The script will not function at all and will be interpreted as html text.
What are the three ways that you can make comments in PHP?
You can make comments by using the / and * characters. The second way is using the HTML comment syntax. The third was is to put double /.
What is the PHP include function? Why is it useful?
The include function takes all the text/code/markup that exists in the specified file and copies it into the file that uses the include statement.
What are the three types of PHP variables that Eli discusses?
The three types of variables discussed are strings, integers, and floats.
What naming rules apply to PHP variables?
Whenever variables are named, it needs to start with a $ sign. After the $ sign, the actual name needs to start with either a letter or an underscore. Numbers are not allowed to be the start of a variable name.
Compare and contrast the html br tag in HTML and the \n in PHP
What does it mean when Eli says that HTML creates static pages while PHP creates dynamic pages
HTML creates websites that do not update with new user information, whilst PHP can actively adjust websites accordingly to the user’s information within forms and/or databases.
In this exercise, you will use an HTML Textbox, an Option Box, and a Radio button. What function does each of these input methods provide?
Textbox options provide users the ability to type in credentials, like their name, email, or custom comments they want to provide. Option boxes provide input organized in styles such as drop down boxes so that users can scroll through the choices. Radio buttons require users to choose one option such as a gender; it is somewhat like a option box, but laid out in a different fashion.
In this example, you use the PHP file_put_contents() function. Briefly describe this function.
The file_put_contents() function takes variables from a php script and writes them to a file. Putting form contents into a file organizes the record of numerous entries and has the ability to append to the form, not causing overwrite.
What is a CSV file? Why would you want to use one?
CSV means Comma-separated values. CSV values really come in handy when dealing with user profiles that have a lot of information (name, phone number, email address, etc). Every entry is separated by a comma, as such CSV forms are very compatible with spreadsheet software such as Excel which itself has a function that can separate entries by commas. Thus, it makes handling information very easy.