Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5946807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:52:29+00:00 2026-05-22T16:52:29+00:00

I am building a blog engine for practice. The design is supposed to be

  • 0

I am building a blog engine for practice. The design is supposed to be fairly simple I guess..Here is how i want it to work:

  1. I have index.html, a CSS sheet, some javascript, and one PHP file i named pullContent.php.
  2. Index.html is the main page where you see the blog posts. pullContent.php interfaces with MySQL database table containing my posts.
  3. inside the body of index.html i have a div with id=”blog_entries” containing the blog posts. Inside that div i will have a bunch of divs with classes=”post” that will make up the set of my blog posts. Each post will be pulled from a row on MySQL table, displayed on index.html and then after that be styled by CSS. This dirty work is done in pullContent.php

As you can see, I will have to insert each of my blog entry into the database table and the content inserted should be in the form of HTML markup (since some parts of the post probably needs to be styled using CSS and thus needs some class/id identifier). Now In the case where I want to put some code snippet on my blog, isn’t it going to be such a hassle? is there any workaround using some other technology i did not mention?

any comments/suggestions would be appreciated. thx.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:52:30+00:00Added an answer on May 22, 2026 at 4:52 pm

    First of all you should make sure to properly sanitise your data when passing it to the database.

    When you want to display code, just put everything in a pre-block (just like you would here on SO)

    
    <pre>
    /* your code */
    </pre>
    
    

    This way your post will be displayed with all the spaces, newlines, as it was passed to you originally.

    On the other hand you still have to make sure to escape certain characters: eg. instead of <, > or & you should put &lt;, &gt; and &amp;

    If you want your code to look good, then check out google-code-prettify (some extra js & CSS and your code will look aweseome!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a blog using RoR. I have the index.html.erb page for the posts
Hey guys. I'm building a simple blog and have my data returning from my
Here's my question for today. I'm building (for fun) a simple templating engine. The
I'm building a recipe-finder for a new food blog. The design I have basically
http://dl.dropbox.com/u/921159/desktopography/index.html I'm building a wallpaper blog and trying to use jquery to show/hide a
Here I have pasted link for code: http://blog.asolutions.com/2010/09/building-custom-map-annotation-callouts-part-1/ In this code I have just
I’m building a blog engine in C# Webforms and I have the following code
For illustration purposes let us say I'm building a simple blog application and have
So I'm building a blog engine which has /articles/then-the-article-permalink as it's URL structure. I
I am building a blog type page, and I want to load items into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.