Join Kevin Skoglund for an in-depth discussion in this video Random color squares, part of Easy PHP Projects: Single-Serving Sites.
- [Voiceover] In this movie we'll use what we just learned…about using PHP's rand function to generate random colors…to explore a variation of that idea.…Let's build a single serving site…that generates a page filled with randomly colored squares.…In the last movie we were working with randomcolors.php.…If we open that up,…I'm going to take all the content that's in there,…and I'm going to copy it…and I'm going to put it in a new document.…And I'm going to just save that as sites.…And we'll call it 'randomcolorsquares.php'.…
Ok, and we're just going to use that as a starting place.…I can close the old document now.…We had the colors before.…It's up to you.…I'm going to just switch back to using these colors.…And take the hex value colors out.…It's up to you which ones you use.…I just want to stick with something that's nice and simple.…Red, green, blue.…And it's really obvious what those colors are.…Alright so we saw how to make…the background different colors before.…Now what I want us to see how to do…is to make a box that is going to be a colored box.…
- Finding and validating an IP address with PHP
- Parsing the HTTP request for browser details
- Comparing dates and times in PHP
- Randomizing data with PHP
- Styling page content dynamically
- Generating random sentences
Skill Level Beginner
1. What is My IP Address?
2. Browser Mirror
3. Is it New Years Yet?
4. Random Data and Styling
5. Random Phrase Generator
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.