Webmaster Forum
Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 05-03-2007, 04:50 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default

OK, time to create a script that will add our posts to the database.
For now, we'll call it administration.php
And this is the source:
PHP Code:
<?php

include ("config.php");
if (
$HTTP_POST_VARS['add']) {
  
$title=$HTTP_POST_VARS['title'];
  
$text=$HTTP_POST_VARS['text'];
  
$sql ="INSERT INTO blog (title, text) VALUES ('$title', '$text')";
  
$result=mysql_query($sql);
  if (
$result) echo "<b>New post added!</b>";
  else echo 
"<b>Could not post!</b>";
  }
?>

<HTML>
    <HEAD>
        <TITLE><?php echo $sitename?> Admin CP</TITLE>
    </HEAD>
    <BODY>
        <H1>Add a new post</H1>
        <form method="POST" action="administration.php">
        <b>Title:</b><br>
        <input type="text" name="title"><br>
        <b>Entry:</b><br>
        <textarea cols="60" rows="6" name="text"></textarea><br>
        <input type="submit" name="add" value="Add">
        </form>
    </BODY>
</HTML>

<?php

mysql_close
();

?>
Again, this is a very simple piece of code. It features a submit form and a small script to add posts.
In the first part we include the config.php file again. And then we tell the script that if the form has been submitted it should get the title and the text that was submitted and we insert it into the database.
If it's OK we output a success message and if something went wrong we print out an error message.
The rest is simple HTML (with a dynamic title according to the config.php file) and a form that submits the title and the text of the post.
At the end we close the connection to the database.
That's it! Note that your "Admin CP" isn't protected at all at this stage so anyone who knows the URL to it can add data. But we aren't concerned about this at this stage. We'll mess with security later.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #12 (permalink)  
Old 05-03-2007, 05:12 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default

Well, now that the phase 1 of designing our own blog is finished here's the live demo:

This is the blog itself:
http://forums.ukwebmasterworld.com/b...l/01/index.php

And this is the Admin CP (it has been disabled to prevent spam but you can at least see what it looks like):
http://forums.ukwebmasterworld.com/b...nistration.php

I know it's nothing fancy but why kill ourselves designing something that isn't finished?

Next lesson will include some CSS (so your retinas don't burn from looking at this site) and we'll be adding some new functions. Expect it in a couple of days (maybe even tomorrow).

Oh, almost forgot. Here's the link so you can download the source code we've created so far:
Download!
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #13 (permalink)  
Old 05-13-2007, 02:11 PM
Bisje's Avatar
Senior Member
 
Join Date: Feb 2007
Posts: 216
iTrader: 0 / 0%
Thanks: 1
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Bisje has a spectacular aura aboutBisje has a spectacular aura aboutBisje has a spectacular aura about
Default

Hi Melkior,

Don't want to put pressure on you, far from that, but I was wondering if you intend to continue this tutorial.

I found it simple and clear (just what I need ) until now and I surely hope you will continue with it.

Thanks for the job so far :armada34:
__________________
Take a look at Eric's Books Site to know what I read or at Eric's Boeken Site for the Dutch talking.
Add your book-related site to my Books Directory...
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #14 (permalink)  
Old 05-14-2007, 07:49 PM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default

I'm glad you like it Eric!

Yes, I'll continue with this tutorial, tomorrow. I had some issues that detained me in continuing this tutorial.

Now that I'm free again I will continue and speed up the pace a little bit.

Thanks for your patience!
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #15 (permalink)  
Old 05-14-2007, 08:08 PM
Bisje's Avatar
Senior Member
 
Join Date: Feb 2007
Posts: 216
iTrader: 0 / 0%
Thanks: 1
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Bisje has a spectacular aura aboutBisje has a spectacular aura aboutBisje has a spectacular aura about
Default

Great, I'm looking forward reading you
__________________
Take a look at Eric's Books Site to know what I read or at Eric's Boeken Site for the Dutch talking.
Add your book-related site to my Books Directory...
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #16 (permalink)  
Old 05-16-2007, 08:40 PM
Senior Member
 
Join Date: Feb 2007
Posts: 148
iTrader: 0 / 0%
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
lala is on a distinguished road
Default

Melkior,

Cannot wait for you next post. Thank you for your valuable contributions. If we would not have nice chaps like you we really would be lost in the dark;-)

lala
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #17 (permalink)  
Old 05-17-2007, 02:47 PM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default

Well, as you know we're working on a competition called POSTFest and it's tomorrow so just a little more patience and after the POSTFest is finished and the winner is announced I'll continue this tutorial.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #18 (permalink)  
Old 05-17-2007, 11:29 PM
Senior Member
 
Join Date: Feb 2007
Posts: 148
iTrader: 0 / 0%
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
lala is on a distinguished road
Default

Can you tell me your secret how you manage to do all this? It is amazing how much you contribute to the UKWebmasterWorld and and and. Wish I would have the same skills... Well done!!!!!!

lala
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks

Webmaster Resources
UK WW SEO Tools
Find UK Hosts
 
The Forum Rules
Forum Rules - MUST READ
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
a75-s229 laptop ac adapter apple ipod nano 4gb brand new cellphone digital camera dj mixer domains drupal earphones ecommerce edible oil electronics estdomains events in india for webmasters free web space google analytical tool hosting hosting offer low cost iphone iphone 3g 16gb iphones laptops mdj's mobile phones motorola rokr e6 newbie new pioneercdj's nokia oil phones phpld plasma tv poineer prepaid phone card prepaid phone cards promo proxy renew social web hosting telecom links template design transfer usb cable web hosting

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating and running a discussion forum temi Webmaster Tips and Tricks 39 06-19-2008 07:20 AM
Tips for creating better website temi Webmaster Tips and Tricks 11 03-21-2008 01:25 AM
Creating a custom page in vBulletin melkior_inactive Forum Software 3 01-18-2008 10:14 AM
PR4 Real Estate - blog posts for sale - one year old blog stock_post Other Advertisements (Ads spaces such as banner, blogs and articles) 1 08-23-2007 08:44 AM
Creating Banners gkd_uk General Webmaster Talk 1 05-26-2007 11:36 AM


All times are GMT. The time now is 04:28 AM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151