Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Resources to learn languages

...

LAMP Stack development

  • For local development download XAMPP (for Mac) or WAMP (for PC)

    • This comes with an Apache server, MySQL database, and a FTP client. Drop all your php files into the htdocs folder in C:/xampp, start up your apache server in the xampp control panel, then open a browser to navigate to localhost:[portnumber]/url to see your php renderings.
    • You can choose to download a separate MySQL onto your computer if you wish. After installation, navigate to C:/Program Files/MySQL/MySQL Server [5.7]/bin. Use the following command to access the database: mysql -u [username] -p (-h [host ip] if you are accessing a remote mysql database)
    • Create reasonable modules. PHP lets you break down code into smaller segments and join them together to render a complete page. Make your code shorter so it's easier to maintain and make changes. For example, you can create a header.php with the common header every page shares, then you can simply use the <?php include header.php ?> in every other page to re-use the code you've written.
    • Download XAMPP control panel
    • MySQL server
    • PHP modulation
  • Best practices

    • Keep that in a central file, so you don't have to write a connection string every time a page needs to be linked up to the database.
    • You can use objects in PHP-- OOP makes your complex logic so much easier to organize.
    • Keep your files stored in proper folders. Your css files should be in a folder called "assets", images should be in a folder called "images", shared files like connection string, headers, footers should be put in "includes" folder.
    • This is something that a lot of people overlook. Improper php code is especially vulnerable to common attacks such as cross site scripting, cross site request forgery, and sql injections. To do the best job we can here are some tips:
      • Escape all user inputs
      • Users may enter data that gets executed as part of the query, but if they enter say in the username field - john'; drop table tblUsers;. The query that now gets executed may look like SELECT * FROM tblUsers where username = 'john';drop table tblUsers';. The solution here is to use the built in real_escape_string([input]) to sanitize all user inputs. (Google it for details)
      • Use HTTPS if you can
      • Not all clients will support this, but ask if they can get a HTTPS connection. This will encrypt the communication between clients and the server.
      • Don't store your passwords in PLAINTEXT
      • If you are making a log in page, please store only the hashes of the passwords. When the user logs in you should hash their input and compare it with the hash you stored in the database. Further, md5 and sha1 are not safe hashes and are being phased out, for industry standard hashes use sha-256 and above [This is done very easily in php, simply use hash("sha256", STRING) function]. Finally, using randomly generated salts for each user is also standard practice. Read the Wikipedia page for an overview as to why it is important : https://en.wikipedia.org/wiki/Salt_(cryptography) (Links to an external site.)Links to an external site. 
  • Deployment

    • FTP/FTPS - Use a FTP client (Filezilla, WinSCP) to copy all your php files to the designated server with proper credentials.
  • Other Insights/Tips
    • Phpstorm and Jetbrain IDEs for free - Jetbrains, the maker of IntelliJ IDEA Java IDE (which powers Android Studio) and other IDEs, offers free licenses for students with a .edu email address. One of these IDEs, Phpstorm, can prove very useful to 374 teams building web applications with Php, Javascript, and HTML/CSS. With early warning on coding errors, git/svn integration, and FTP/SFTP deployment, Phpstorm is a great tool. Student can get it at https://www.jetbrains.com/student/ (Links to an external site.)Links to an external site. 
    • Use MAMP to run PHP and MySQL server locally. MAMP, free of charge and runs on both Mac and Windows, installs a local server environment and allows you to have access to a local PHP server and MySQL server. Instead of using the online code editor, a local PHP server given through MAMP will give you more flexibility and control over your code and development environment.

...

Javascript

...

  • MagicMockups (Free Web-based Mockup Generator)
    • Upload a screenshot of your system to create a fabulous mockup.
    • Supports several different devices (iPhones, Androids, Macbooks, Laptops, Desktops, iMacs) – useful to demonstrate what your website would look like on mobile.
  • Youtube iFrame API (Easily embed YouTube videos into CMSs and custom builds)
    • Very simple to use Javascript based API guide written by Google
    • Can be useful to embed training videos or guide videos directly on your solution. You can even use the API to create a “playlist” of instructional videos as well as specify the start time and end time of each video.