How to Create a Website Template Using PHP

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • Full source code available at: www.johnmorriso...
    In this lesson, you'll learn how to create a website template using PHP.
    ~-~~-~~~-~~-~
    Please watch: "Ryan Carson: How to Get an IT Job WITHOUT a College Degree"
    • Ryan Carson: How to Ge...
    ~-~~-~~~-~~-~
    #php #webdev

КОМЕНТАРІ • 56

  • @mathykrishna
    @mathykrishna 8 років тому +3

    Simple and crisp. Great tutorial for beginners.

    • @john.morris
      @john.morris  8 років тому

      +Manickam Krishnamoorthy thank you!

    • @MaxXFalcon
      @MaxXFalcon 8 років тому +1

      yes, i haven't found anything better on youtube. Thank you very much. U are the best:)

    • @john.morris
      @john.morris  8 років тому

      MaxXFalcon thanks!

  • @dsulvadarius
    @dsulvadarius 10 років тому

    the best php template tutorial I've come across.

  • @madmodders
    @madmodders 5 років тому

    I thought this was a really good idea, until I got to the content where there's php code in it. Then it of course just outputs the code in the content. I can't echo a string there... After a thoughtful minute I concluded this is still a good idea. I just split the template in two at the point where the content should be. Then in the content files I include the first template half before the content, and then the other half after the content. Works like a charm! 👍

  • @EricMihelcich
    @EricMihelcich 10 років тому +1

    Hey John, I like your teaching style in this video! It is very easy to follow. I'm a new fan of this particular template system. Thanks!

  • @timhill85
    @timhill85 10 років тому +1

    Thanks, John! Your tutorials have been a great help.

  • @CaptainBaksmak1
    @CaptainBaksmak1 10 років тому

    Awesome man! Keep up the good work. Plus I appreciate all the great emails you send out!

  • @editeurcode
    @editeurcode 9 років тому

    Thanks for the great guide on a basic template!

  • @john.morris
    @john.morris  11 років тому +7

    How to create #website template using #php #html and #css

  • @tmacka88
    @tmacka88 9 років тому +1

    Hey John, nice quick tute covering it all. Just wondering if there was a way to have the content HTML that is in a variable e.g. $main_content = 'homepage content';
    to be displayed in a another file e.g home-content.php without the varible around it so you get html syntax highlighting and code completion? Also when using the html content within the variable I always need to use \ in front of ' e.g. "today's" > "today\'s" so php renders it. Is there a way around both of these?

  • @webleydevelopment
    @webleydevelopment 8 років тому

    Loving your tutorials John! Do you have anything more indepth regarding how and why you create methods this way? I get it all . I think I need to understand design concepts within development now. Just getting into OOP. Great stuff!

  • @jayb2325
    @jayb2325 5 років тому +1

    Do you still have the source code on your website when I clicked the link it wouldn't pop up?

  • @alistergray6773
    @alistergray6773 10 років тому

    Hi John. Great video. I have a question. Currently we are storing the URL's that the navigation menu items link to in the array. What happens if the path to the location of the folder is different. If you use the same navigation on each page then won't you run into problems when your using the menu on pages stored in subfolders? Is there a way around this?
    Thanks

  • @thought2007
    @thought2007 11 років тому

    no, when you navigate to index.php for example, the user on the other end only sees the output, not the functions or php code

  • @CSteinberg03
    @CSteinberg03 2 роки тому

    I just came across this video. Its great as I am just starting trying PHP. I noticed the link does not work anymore for the files you are using and I would love to play with them. Any chance they are still available somewhere?

  • @mohammadshoaib6327
    @mohammadshoaib6327 10 років тому

    Thanks Jhon, God bless you and keeping you going .
    I am beginner . Please explain the difference between the videos as follows:
    (1) How to Create a Website Template using PHP. ------ Published on 28 Apr 2013
    (2) How to Create a Web Site Template From Start to Finish (HowtoMakeMyWebsite-- the monkey logo)-----Published on 21 May 2013
    (3) How to Create a Web Site ----- Published on 21 May 2013
    Which Vedio Should I watch First. Please guide

  • @jalorda6316
    @jalorda6316 Рік тому

    Hi, first of all thanks for the content, Im a php beginner and this is very useful. I have some trouble, what if i want to put php inside the string? I tried and works almost fine, but when i try to run sql queries I dont receive any rows. Is there another way to do if the string is code?

  • @Patrickzulu1
    @Patrickzulu1 10 років тому +1

    cool stuff Man keep up the good work.

  • @magangdang
    @magangdang 10 років тому

    It is very interesting. However, may I request if you can kindly show tutorial building up the full website template using php step by step. please.

  • @crazyproideas
    @crazyproideas 5 років тому

    i got the source codes... Thanks a lot.

  • @TylerHidrogo
    @TylerHidrogo 9 років тому

    How would you add an active class to each page when you are on it? For example moving from home to about would show a different background indicating you are on this page....

    • @john.morris
      @john.morris  9 років тому

      +Tyler Hidrogo I'd say add a different class to for each based on the URL you sniff with this code and then style the proper background based on that.

  • @PikleB
    @PikleB 9 років тому +1

    The header, footer and single files are all purely used as a template, so why separate them? Why not have a template.php which calls the functions, css etc and is called by the content page?

    • @john.morris
      @john.morris  9 років тому

      You definitely could. Have built a few WordPress themes in a similar fashion. You'll see a lot built this way though, too.

  • @zyriik
    @zyriik 9 років тому

    Hello John, I greatly appreciate this tutorial and will be looking through many more however, is there a chance that we can get a copy of the style.css document used within this tutorial? we went through a brief comment and view of the typed data and I understand we can make our own, though it would be helpful to have a copy on the side if possible.

    • @john.morris
      @john.morris  9 років тому

      +Zyriik Vacirca pretty sure that's available in the source code that goes with this. Link is in the description.

  • @bk-video-pleszew
    @bk-video-pleszew 5 років тому

    To jest, za proste ten Template jako: "PHP: "Linked"", bo w internecie są ostre te wirusy, i możesz stracić pliku na tym serwerze albo może ci i twoim zablokować dostęmp do tej strony internetowej.. Najlepiej ten Template użyj: "PHP: "Query"; "Flixsed"; "Tempere" i: "Ambere"", i uratujesz swój serwer i twoją stronę internetowa. A serwer trochę będzie kombinował sobie ale twoje bezpieczeństwo jest Ważniejsze niż strata zaufaności lub plików.

  • @HeyItsMeAshley
    @HeyItsMeAshley 9 років тому

    do you have the style sheet code anywhere? thats the part that throws me off the most and is creating a lot of trouble in my code

    • @john.morris
      @john.morris  9 років тому

      +Ashley Bladen I believe it comes with the source code available for this tutorial. Link is in the description.

  • @Windows10wallpaperNet
    @Windows10wallpaperNet 9 років тому

    Cool, really awesome. Gonna learn something from u, great man (y)

  • @john.morris
    @john.morris  10 років тому

    Alister Gray Potentially. The best way to handle this is to create a config.php file with a constant that defines the install URL. So something like define('HOME_URL', 'www.yourdomain.com/path-to-install'); Then you can use that constant to prefix your URLs and get the right to URL no matter where you install your application.

    • @alistergray6773
      @alistergray6773 10 років тому

      Thanks John. I understand the concept of using the config file, but not the exact implementation. Doesn't seem overly complicated so I'll have a dig into it and see what I come up with.

  • @ChazTeenGaming
    @ChazTeenGaming 9 років тому

    John Morris Man when i try and open the website it comes up with the code not the website design. why is it doing this? please help.

    • @thebankclan2657
      @thebankclan2657 9 років тому

      Most likely because you do not have a CSS file on your website/ in the
      For example:
      my website
      WEBSITE CONTENT

  • @CarlPotak
    @CarlPotak 10 років тому

    What if one was to use a custom CMS with a template system? How would it differ?

    • @thebankclan2657
      @thebankclan2657 9 років тому

      The CMS system with visual editors etc, such as WordPress would make your site load way slower as it require more files for every function (and php is a server side script meaning your server would have to do calculations every time the page is loaded).
      Tho, WordPress is one of the best website frameworks, it operate around 15% of the internet... Just very slow. if you don´t need complicated plugins i´d say just doing this (or hire someone to do it) would be the best solution.

  • @AtacamaHumanoid
    @AtacamaHumanoid 7 років тому

    Does your course cover Wordpress at all?

  • @RushLoftis
    @RushLoftis 9 років тому

    Thanks!

  • @dsulvadarius
    @dsulvadarius 10 років тому

    just curious. Did you take tips form WordPress?

  • @rohitkirpa
    @rohitkirpa 6 років тому

    Hi John m new in PHP can you tell me how to build of edit this PHP code and make website in PHP and how can I edit the PHP website via FTP( FileZilla)
    Plz reply as soon as possible ☺️

  • @trulsopstad4149
    @trulsopstad4149 10 років тому

    Hi John. How do you save this?

  • @j.sleeka6459
    @j.sleeka6459 9 років тому

    This looks like an Wordpress organization, correct me if I am wrong.

  • @prateekraina1605
    @prateekraina1605 9 років тому

    Hi John, hope you are doing well, I am getting an error and I am unable to find the solution on the internet or maybe I am just not able to understand whatever is there, can you please help me out whenever you are free.
    Here is the error "Fatal error: Call to a member function navigation() on a non-object in C:\wamp\www\SimpleWebsite\functions.php on line 14"
    Thank you for these amazing videos. :)

    • @john.morris
      @john.morris  9 років тому

      +prateek raina I answered this question here: ua-cam.com/video/8qrslJBAsjQ/v-deo.html

  • @kasalwebwalya3017
    @kasalwebwalya3017 8 років тому

    can't open the link for your source code please paste it here

  • @crazyproideas
    @crazyproideas 5 років тому

    No Source Code available on your site... fake link

  • @mohammedhussein8130
    @mohammedhussein8130 10 років тому +1

    John I Am Mohammed And I Don't Have Any Idea Whats Are Want From Me