Tuesday, October 29, 2013

How We Feel About PHP


After today I came to this conclusion, PHP is my arch nemeses! Well, for the time being that is. While my confidence for programming grows each day, I know that once I master PHP other languages will be easier for me. I spent most of Sunday re-learning and watching the basic PHP video tutorials so that I can have a better grasp and understanding of the language at hand. Today however, I really hit the ground running trying to finish up the advanced section, it's truly amazing how a little relaxing music and coffee can increase your performance. I spent almost 8 hours today working on a form in which a user can input their email address and gets a response if the email is valid or invalid. It was way more complicated than I first imagined. First, I had to create a form placed within index.php, then send that to the page process.php. When it is sent to process.php I had to come up with the function that would check whether or not the email was valid and if it was valid the user would be directed to another page called success.php. I took the liberty of posting an example of what I had to create since it may sound confusing, I will also be posting the code too. The hardest part about this assignment was the second part, which was figuring out how to link it to the MySQL database, by using the code bellow in the success.php page. 
                                          


                           session_start();
==>                   include("connection.php");
                          echo $_SESSION['success'];
                         $emails = fetch_all("SELECT emails.email, emails.created_at FROM emails");



In other news, during lecture today we went through all the steps of steps of how to setup Git and Github (which pretty much is a version control system for our code). Soon enough I will be posting all my code on Github, so you can find me there! It was a rough day for most people today, PHP really knows how to suck the life out of you, so a few of us, including myself decided to take a power nap, which studies show anywhere from 10 to 15 minutes is enough to restore wakefulness and promote performance and learning. It was a rough day for us all... PHP - 1    Abe  - 0




success.php

process.php

connection.php

assignment


How we feel about PHP....

PHP's wrath....

No comments:

Post a Comment