Join Kevin Skoglund for an in-depth discussion in this video Decode browser details, part of Easy PHP Projects: Single-Serving Sites.
- Now we've written our BrowserDetective PHP class,…let's put it to use.…Open up browser_mirror again,…and inside the browser_mirror,…we'll do it right here.…We're going to put in the little bit of PHP…that's going to load in that class for us.…So we're going to require_once…the file browser_detective.php.…So that'll make sure that the code is loaded,…and then I'll actually create a new variable called bd,…which is going to be a new BrowserDetective.…
And then I can just tell bd after I've initialized it,…that it should detect.…That's it, I've loaded the BrowserDetective,…I tell it to detect,…it actually returns some values to me…that I could use if I wanted to catch those returned values.…But I'm actually not going to do that.…Instead, what I'm going to do is jump down here…to right below the User Agent string.…I'm just going to paste these in,…these two lines,…one for the Platform, one for the Browser,…and they're just going to echo back those values…of platform and browser_name.…
So let's save it all,…and let's see how we did.…
- 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.