FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

How to code a simple blog using PHP

 


tingkagol
Hello.

After several years I've finally decided that I should learn how to code a simple blog using PHP. I just want the most basic things: REGISTER, POST, DISPLAY, ARCHIVE (and probably COMMENT).

Can anyone help me?

Thanks.
sonam
I am not sure you can code "SIMPLE" blog because you need lot of things. Maybe is better solution to use some finished free blog.

Sonam
joostvane
You can't learn to code a simple Blog. You can learn to code something simple. A blog asks a lot of coding. I recommend that you start by coding something like an address book first or something, thats what I did first.
rvec
a blog like that is simple, but if you don't know where to start you should probably start by making more simple stuff.

I'd recommend starting with a form where you submit data and put that in a mysql database (the blogging). Then learn how to do logins with sessions (other ways are possible but this is the best for a blog in most cases). If you can do those two things you can combine them and you already have your blog (almost).

When you got that you can start with sanitizing data and other security stuff. Then do the comments, and put the blog online (not before you learn how to use mysql_real_escape and escape html tags).
tingkagol
Thanks for the replies.

@joostvane: What's an address book? Or did you mean guest book? Can you show me / point me to the direction of tutorials? Thanks.

rvec wrote:
I'd recommend starting with a form where you submit data and put that in a mysql database (the blogging).

I especially want to start with this. I want to submit data to the database, and retreive it / display it on a page. Can you point me to a good tutorial? Thank you.
rvec
if you don't know where to start on this, I'd suggest starting with the basics of php.
You can find some tutorials here:
http://www.frihost.com/forums/vt-92218.html

After that it should be easy to make a form and use mysql connections.
Raidation
I can help you.
Basically, first, you make a basic template for a blog post. This should be obvious. then, where the content is supposed to go, you insert: <?php $content ?>

Now, in your body, write where the blog posts are supposed to be:
Code:
<?php
$array=Array("Post1","Post2","Post3");
for(i=0;i<=$numberofposts-1;i+=1) {
$content=$array[i];
include("blogpostfile.php");
}
?>
rvec
rofl
that's a bad way to do that, and you should use code tags when posting code.

I'd suggest using themes only when you know how to work with sessions, know some basics about design (not graphical but architectural) and have seen how other do it. The way radiation handles themes they have minimum added value.
babarus
http://www.w3schools.com/ is a good tutorial .
If you want to make a blog is no so dificult using a open-source code but to code a blog is a hard work.
Related topics

[tutor] How to protect images without htaccess using PHP
Using PHP code from a Database
Open, Write to and Close a txt file using php
I am trying to build a contact form using php and flash
Communicating between web pages

Checking server status (ports) using PHP
Using PHP "OR" Logical Operator
Access Java 1.6 Web service using php client
Ip Banning Using Php
Using PHP

Includ Images using PHP.
Sending mail with flash using PHP
How to start using PHP? Help!
Website Designing using PHP
how can i setup a page break for printer on html using php ?

Asp or PHP ??
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.