Web Design And Programming Pt 1 PHP

Web Design and ProgrammingI have received tons of requests for tutorials. So, I’ve decided to create a massive tutorial that answers them all. In this tutorial I’ll focus on Web Design and Programming using all of the tools required. You should check out my Learn HTML Tutorial if you haven’t ahead of time.

I’ll continue this tutorial, with your input, until you can do pretty much anything in Web Design and Programming. Leave questions and comments below, because you are going to totally control everything I cover here.

I’ll start off with the basics of PHP and move on from there with tons of examples. Of course, all of the code used will follow the video.

All the Code from the Video

<title><?php echo “Website Title”;?></title>

// You can use short tags but it is not recommended doesn’t work in 6
# You can also comment code like this
/* Here is a
multiline comment
echo “<p>Random Text</p>”;
print(“<p>You can print with braces</p>”);
print “<p>or without

$randVar = “Cats”;
echo “<p>”, $randVar, ” are funny</p>”;

printf(“<p>My name is %s I’m %d years old and
pi is equal to %.2f</p>”, ‘Derek’, 35, 3.14);

// Variables must start with a $ then letter or _ and then numbers
// Variables are case sensitive & don’t require definition before use

$boolEx1 = false; // 0 or false equals false
$boolEx2 = 1; // true equals any number but 0

$intEx1 = -234; // Max size normally 2^31 or 2^63

$floatEx1 = 3534.14;

echo “<p>Cost: $”,number_format($floatEx1,2), “</p>”;

// Arithmetic Operators: + – * / % ++ —

$firstName = “Doctor”;
$lastName = “Who”;

$wholeName = $firstName . ‘ ‘ . $lastName;
printf(“<p>His name is %s</p>”,$wholeName);

define(‘ACONSTANTVAR’, 2345);

echo “A constant is equal to ” . ACONSTANTVAR . “<br />”;

echo “How do quotes differ $wholeName<br />”;
echo ‘How do quotes differ $wholeName<br />’;

/* Escaped Characters in double quotes \” \’ \\ \n \r \t \$ */

$float2Int = (int) $floatEx1;
echo $float2Int, “<br />”;


$strNum = “28”;
echo $strNum * $floatEx1, “<br />”;

echo gettype($strNum), “<br />”;
echo is_string($strNum), “<br />”;

/* is_array() is_bool() is_float() is_integer() is_null() is_object()


36 Responses to “Web Design And Programming Pt 1 PHP”

  1. heisamit says:

    Just stumbled on your videos accidentaly…but have to admit that you’ve really got some great stuff going on in these videos..Thanks for the posts

    • admin says:

      Thanks 🙂 Yes I’ve been building a lot more traffic lately. This whole thing started as a little hobby. I’m glad so many people enjoy it.

  2. bla says:

    i agree, just watched the first vid and now i’m gonna watch the rest 😀 i like it how you go through all of it very quickly instead of the boring slow talk like most of the tutorials 🙂

    • admin says:

      Thanks for taking the time to show your appreciation 😀 I definitely have a pretty original style. Some people like it while others don’t. I’m glad it works for you

  3. Amal says:

    First, I’d like to say your tutorials are great. They’ve helped so much. The format is great too. I was wondering if there was anyway I could download all of the video tutorials for a given section.


  4. Bobby Gerez says:

    Hi Sir Derek I didn’t find your regular expression article only a video to where this one suppose to be posted.

    I just want to ask how to limit 9 numbers in regular expressions but I expect that it must contain at least a number so I come up with this but it doesn’t work that way. Thanks

    if (preg_match(“%[0-9]{1,9}%”, $searchid)){
    //execute codes
    else {
    //execute codes

  5. Kaustubh says:

    This a great stuff! What I like best is that videos are fast paced. Keep it up!

    Suggestion – Include navigation aids on the page to allow users to browse easily from one video of series to another.

  6. karan says:

    Hi,Really your videos looks great..I am very much inspired by yours and want to create website (programming in PHP) and started creating..but i was stuck in coding php for image slideshow for my website.Hoping help from you.
    Thanks in advance!
    once again, your videos are very much helpful..thanks for the posts..:)

  7. Anonymous says:

    your tutorials save me always. Thanks a lot!

    can you zip all your exercise file sir derkbanas so that we can easily it to download..

  8. maha says:

    great tutorial.can you please tell me in which tutorial you teach how to retrieve data from database .

  9. sarrarov says:

    Hello Admin
    I would like to ask you about what SQL program do you use?

  10. Alex says:

    Thanks. But the videos have no download links.
    How can one download the videos and watch offline?
    Thank u for your good works.
    I will certainly donate to this project soon.

    I am actually learning web design right now in India.
    I was searching for any youtube video tutorials on javascript, and I eventually stumbled on your site. You actually have some great resources. Pls well done.

    • Derek Banas says:

      Thank you very much 🙂 I’m glad you enjoy the videos. I can’t make the videos available for download directly because I can’t do that with the hosting account I have. I can’t afford a dedicated server.

      Please don’t feel obligated to donate. I am very happy that people find my videos useful. That is all I ask for

  11. Sayed Ali Raza says:

    i am from Pakistan and i always want to become a programmer i was wandering on net for tutorials but never got something which can help me..
    and now i hit you web and guess what??
    i got what i was looking for.. i just saw 5 vids of php and i am gonna watch all.
    keep it up hope you will let them watch us free for ever..
    may Allah bless you..

    • Derek Banas says:

      Thank you very much 🙂 I’m very happy to be able to help people all over the world. It is very gratifying for me. Feel free to ask questions and I’ll always try to help. May God bless you and your family as well

  12. Dan says:


    Thanks so much for the video! It’s a very simple and clear implementation of PHP. Unfortunately, I’m still a serious webdev newbie. Just wondering then, how do I launch my website on localhost? Or in other words, I have the file “phptest1.php”, but how do I make it accessible on my browser??


  13. Fernando says:

    Hi Derek,
    First of all I wanna say I really enjoy your tutorials. I’ve been learning a lot from them.
    I’m trying to learn a bit more about php web design programming this time.
    I use coffecup html editor and when I add php coding into it and test it with the browser, it doesnt publishes as I expect. For example if I write:
    <?php echo "Hello”;?>
    What I get when I refresh the webpage is:
    I’ve tried to google this problem but haven’t got any solution.
    Do you know what could be the problem?
    I appreciate if you could help with this one 🙂

    • Derek Banas says:

      Hi, Thank you 🙂 I’m glad you like them. I think maybe the double quotes aren’t normal double quotes? See how they bend to the right rather then going straight up and down? That may just be happening because of the comment field on my site, but check that out.

      • Fernando says:

        Hi there again,
        I checked your tip about the double quotes and it’s not the problem. It’s definetly the comment field on your site.
        Any other guess?

        • Derek Banas says:

          Maybe there is an open tag some place? Also very often php bugs occur if you are using the php inside of a page that is also using it. In WordPress for example if you have any trailing whitespace before or after a php tag you’ll get errors.

Leave a Reply

Your email address will not be published.