Grow your CSS skills. Land your dream job.

PHP Article Template

  • # September 3, 2012 at 1:40 am

    Anyone have a template of a static page design in PHP were certain divs get thier data from a variable given by the user?
    Get it? :/ No WP!

    # September 3, 2012 at 9:49 am

    I’m trying to create an article system without any WordPress or that kind of stuff but I really just don’t know where to begin. I’m thinking like, in the document the user sees there’s this code:

    < !doctype html>








    iPhone 5 Thoughts




    < ?php echo $aH ?> - < ?php echo $aW ?>



    < ?php echo $aC ?>






    But the thing is, how do I make these articles and actually send them into this template which then creates a file with the specific data?

    Please help..

    # September 3, 2012 at 3:36 pm

    Help please? :(

    # September 4, 2012 at 11:37 am

    Seriously, anyone?? Either no one has seen this post or you don’t understand my question.. :/

    # September 4, 2012 at 11:43 am

    I’m not that knowledgeable in PHP but it sounds to me like you’d be creating a ton of variables to echo out each article.

    # September 4, 2012 at 5:34 pm

    Well that doesn’t really help me.. But I guess you’re quite right.

    # September 4, 2012 at 5:35 pm

    Although it may not be ideal, you could just use WordPress for a blog only and have the rest of your site the way it is now.

    # September 4, 2012 at 5:43 pm

    I know, except that I really want to try this by my own. I actually think it’s quite easy the way I’m thinking of it, just that I don’t really know HOW to write it in PHP.

    # September 4, 2012 at 5:49 pm

    It sounds easy but it doesn’t seem to be. How are you going to get different articles with the same “$aC” variable? The way I see it you would have to create a different one for each article.

    # September 4, 2012 at 5:52 pm

    If there isn’t too much content:

    In your database create a “content” table (call it what you like) with columns for id (name/number reference) and then each bit of data — title, subtitle, content, etc. User input (GET request?) should be sanity checked and then used to retrieve the relevant items as variables.

    You can then develop a separate interface for adding articles.

    For a more comprehensive look at a PHP design that does what you are describing, look at the source code for Kroc Camen’s site, camendesign.com.

    http://camendesign.com/.system/

    # September 4, 2012 at 6:00 pm

    Well, I’m thinking like that every article has it’s own page ‘article-title.php’ and on the front page there’s just a couple iframes? Simple as that, that database suggestion is good.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".