Web Design and Programming Pt 2 PHP & HTML




I show you how to retrieve data sent from HTML forms using PHP. Also cover the if statement, switch statement and more. Code is here

source

48 thoughts on “Web Design and Programming Pt 2 PHP & HTML”

  1. Later in this tutorial I show how to scrap websites. The only part that is missing is the link following part which would be easy to do

  2. Great videos.
    But I am stuck.
    I see how you create the first page to allow the users to enter detail but how does the 2nd lot of code know to reference the first html page for the input?
    Thanks.

  3. Yes, I have set up xammpp and am running apache.
    When you say 'save' I am not sure what you mean. I saved the 1st file as .html' on my c: drive then pasted the address into my browser (file://C:/temp/php1.html). It works fine.
    But obviously I am missing something because the second file doesn't know which web page to get the data from.

  4. You have to save the PHP files in the folder C:Program FilesApache GroupApache"YOUR VERSION HERE"htdocs The PHP files have to be in that folder because they have to be interpreted by the web server before they will show up right. Tell me if this didn't work

  5. I put the html file and php file in
    C:Program FilesApache GroupApache2.4.3htdocs
    The result is the same – the php file does not run.
    What is it in the submit button code that tells the browser to run the php file? If I had two buttons on the form wouldn't I need two php files (one for each button)? How does the browser determine which code executes for a particular button – there seems to be no reference to the php file in the html code.

  6. Figured it out. Sorry to hassle. Must have taken an extra dose of 'dumbo' this morning.
    The html and php in my case go in the xampphtdocsphp folder.
    The 'form action' clause in the html identifies the php to call when submit is clicked.
    But this leaves me curious as to how the html will call the correct php when there are two buttons.

  7. I'm glad you figured it out. You can link to call many php files, or have php files call other ones. You'll learn more as you continue

  8. I love your tutorials.. Thank you so much for taking the time and working on these. I am having trouble understanding when to use dots(.) and commas (,) when combining strings (I think thats what they are for). I think more than 1 video per day is just too overwhelming for me :).. Sorry for my english.

  9. Thank you very much 🙂 with echo you can use either, but with print you must use the period. There isn't much difference aside from that speed wise. The period is what you are technically supposed to combine strings

  10. You use name for form controls. You use id to identify a particular HTML element. Most html tags / elements are identified with id so you can do things with them like get values, or store values, etc. Does that help?

  11. Derek,
    I have been watching your videos and you have multiple php files you refer to in the first 2 videos. My problem is when I try to use the "$_POST['name']" (that is a reference to the 'name' on a different php file, like you were doing with your form) nothing happens on my end. Is there some code that actually links the files together? Does it need to be defined like other programming programs?

  12. I have a link to all the code in the description under the video. Sorry it was so confusing. I also have all of the code from the whole tutorial series in own zipped archive here newthinktank. com/videos/web-programming/php-mysql/

  13. Here it is with links to other required info newthinktank. com/2011/01/web-design-and-programming-pt-21-secure-login-script

  14. You can't get the clients time using PHP, but you can with javascript. Here is the code you need stackoverflow. com/questions/2705067/how-can-i-get-the-users-local-time-instead-of-the-servers-time

  15. Hey Derek Banas! You have awesome style of teaching and they are pretty helping and absolutely to-the-point as well! well, I wanted to request you to make tutorial about e-commerece website development as to show combined effect of all languages i.e. html5(structure), css(PRESENTATION), js(CLIENT-SIDE INTERACTION), php (SERVER-SIDE INTERACTION), mysql(DATABASE-MANGAMENT), etc. I know its too demanding but still i would ask because your teaching-style is very handy. cheers!

  16. Very well spoken and efficient time management in these vids. You found the perfect learning speed for programming students. Thank you.

  17. I was wondering how you are changing code and having it appear so quickly in the browser on the right side? I downloaded textWrangler thinking everything on the left would look like yours, but this is not the case. Oh yeah, and thank you thank you thank you. These tutorials are amazing!

  18. Quick Question: I was referred to your videos by a friend (which are great btw) but I was wondering if how much of the content is still relevant, only asking since these videos are now 5 years old.

  19. Hi +Derek Banas
    I have one quesrion about $_POST, $_GET and $_REQUEST
    I cannot get the value from $_POST which is the empty value , but I can get the value from $_GET and $_REQUEST.
    Could you know what the problem is ?

    Thank you

  20. 30 seconds into your clip you show the results of the embedded "Hello" which when tested shows nothing in the browser. Although I completely agree with you, you have also forgotten to put the ; at the end of the statement which would also have been an error. Just a thought.

    Absolutely loving your tutorials. Best teacher I have ever had. Thank you so much.
    Nick_P

  21. Sorry Derek. My msg below re the ; not being at the end of the line would have caused an error. I just tested it and it runs fine even if you leave the ; out, which surprises me a bit. I thought all statements had to end in an error. Apols.

  22. How do these tutorials differ from your other single-language tutorials? Are these still relevant in 2016? Thank you for your awesome work 😀

  23. i am learning html css javascript and php.
    basically i am good in other stuff like html css and javascript . i even learnt jquery easily. but i am having trouble when learning php.
    obviously i have watched your tutorials on php and learnt alot from them.but even if you tells everything in a simple way they seems like a pro tutorial that fresher couldn't understand.
    i am also learning php by reading the plain text explanation on different websites like w3schools.com, tutorialspoint.com etc, but video tutorials are just like learning somthing in school class in front of teachers.
    so i just request you to make a video tutorial series on php like 10 min each ranging from basic things like how to install and run php to the advanced topic like oop tutorials.

    i have referred your channel to most of my friends who are spending lots of money to learn web designing and programming because you just speak clearly and to the point.
    but that series will be highly appreciated from all of us who are self learner and wants to be like you.

    thanks ,
    regards…raj kumar

  24. How did you learn code, and how would recommend a starter to learn it? I'm not expecting to learn it in 1 day

  25. When I try to run phptest1.php; I am getting these errors in the browser…

    Notice: Undefined index: name in C:xampphtdocsphptest1.php on line 10

    Notice: Undefined index: address in C:xampphtdocsphptest1.php on line 11

    Notice: Undefined index: city in C:xampphtdocsphptest1.php on line 11

    Notice: Undefined index: state in C:xampphtdocsphptest1.php on line 11

    I'm trying to follow your videos; but, it's not going well… starting from knowing nothing about PHP.

Leave a Reply