Jump to content
Stef's Coding Community


  • Content Count

  • Joined

  • Last visited

Everything posted by Drew2

  1. Hello you wonderful coders you. I've been staring at this line of code (line 74 highlighted below) for a while in m_template.php, and want to share what it's doing. function getAlerts() { $data = ''; foreach($this->alertTypes as $alert) { if (isset($_SESSION[$alert])) { foreach($_SESSION[$alert] as $value) { $data .= '<li class="'. $alert .'">' . $value . '</li>'; } unset($_SESSION[$alert]);
  2. I'm on the PHP Logic with OOP section, and have what I think may be a pretty simple question. In v_login.php, where I see the login form, line 27 for example has this code: <input type="password" name="password" value="<?php echo $this->getData('input_pass'); ?>"> - This line of code takes the user input, and spits it into the form for the user to see. Then, in login.php, there is this code on line 30: $_SESSION['username'] = $Template->getData('input_user'); - this line of code adds to the $_SESSION variable. As v_login.php is included in login.php,
  3. Hello fellow coder fra168nk. I may have just figured out myself how include works. Imagine one document with the function of bouncing a ball. (D1) Then you have a second document with the request to actually bounce a ball (D2) For D2 to actually bounce a ball, it will need the help of D1. D1 is the tool with which D2 can bounce a ball. By writing, for example, include(D1) in D2, D2 now has access to the bouncing ball function in D1. D1 and D2 have not become one document in a sense (in terms of one benefitting from the other). Although the documents are now one, i
  4. Hello, I'm working through the login System using OOP in Stef's course. In the file m_template.php, there is this line of code: (Line 58) function setAlert($value, $type = null) { if ($type == '') { $type = $this->alertTypes[0]; } $_SESSION[$type][] = $value; } I'm trying to see how the highlighted section of code is working. Ben explains this, but I don't quite understand yet. First of all, I want to check that my concept of the session variable $_SESSION is correct: If I unpack a hypothetical $_SESSION variable, it could
  5. I am pouring over the "simple" php login system code for Ben Falk's tutorial. There is one line of code that I cannot make sense of. After reading several sources online about prepared statements, I *only* ever see them with parameters (e.g. ?). Yet, in Ben's tutorial, there is a prepared statement without parameters in file register.php: // create select options $select = '<option value="">Select an option</option>'; $stmt = $mysqli->prepare("SELECT id, name FROM permissions"); $stmt->execute(); $stmt->bind_result($id, $name); // for more i
  6. Hello, Same problem for me. I'd like to continue with the course, but can't get past this question. Any suggestions? -Andrew
  7. In the course, we are asked to copy and paste code that validates a US phone number. I was unable to find the exact page used in the course. However, I found another page with code that produces the same result. Here is the page: https://jqueryvalidation.org/phoneUS-method/ Here is the code that makes it all work (the bold portions are what I copy and pasted in): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Validation Example</title> <meta http-eq
  8. Adding PHP Validation: Chapter 1 lesson 3 minutes: 2:30 -nutshell: If I understand Ben, he adds the php to the input tags in form.php so that when I enter my information in the form and hit submit, my information won't disappear. But, when I take all of the php out that Ben seems to use to keep my information from disappearing, I get the same result: my information stays there. Am I missing something? I have deleted temporarily all of the php echoes in the input tags in form.php (e.g. I deleted <?php echo $error['name'] ?> ). After I saved the page, I then refreshed the web
  9. https://developers.google.com/fonts/faq - found that. It says "The page load time indicator, located in the upper-right of the selection drawer, shows an estimation of how your selection will affect the overall load time (ex: slow, moderate, fast) of your page based on the number of families, styles, and scripts you’ve chosen in the “Customize” tab." It all sounds great, until I look for it. I've clicked on everything I can think of in the top right, and no mention of the page load time indicator is to be found. Best, Andrew
  10. In the video there is a page which has a page load indicator, with colors of green, yellow, and red (It sort of looks like a clock). If I remember, the colors indicate how fast the font will load. I cannot find the webpage on Google Fonts with that indicator, nor anything else having to do with the page load speed of any of the Google Fonts.
  11. Hello Stefan, I've been looking for the past 15 minutes for the page load indicator in Google Fonts. I can't find anything on Stack Overflow about the page load indicator in Google Fonts. I also haven't found anything in Google Font's FAQ on this. Any idea what is going on? It seems like font speed is important. Thank you for your assistance -Andrew
  12. Hello, I recently purchased the Complete Freelancer Videos, but all I found were mp3s. Pretty sure I followed the email instructions correctly. Any idea what is going on? -Drew
  • Create New...