Home arrow Site Administration arrow Page 4 - Talk To Me!

Mole In A Hole - Administration

You've seen how many Web sites (including this one) allow you topost comments and opinions on the material they publish. If you've everwished you had this capability on your Web site, or are simply curious asto how this is accomplished, read on.

TABLE OF CONTENTS:
  1. Talk To Me!
  2. The Job
  3. Building The Foundation
  4. Mole In A Hole
  5. Speak Now, Or Forever Hold Your Peace
  6. Of Trees And Branches
  7. Closing The Loop
  8. The Last Word
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 1
March 12, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
With the table designed as per requirements, it's time to actually start writing some code. The first thing to do is to add links to the main article display page, allowing users to read and post comments.

Let's take a look at a stripped-down version of this page, called "start.php".

<? // important information to identify this article $section = 3; $article = 99; ?> <html> <head> </head> <body> <!-- snip! --> <font face="Verdana, Arial" size="4" color="#66CC00"> <!-- getArticleTitle($section,$article) --> Mole In A Hole </font> <p> <font face="Verdana, Arial" size="2" color="Black"> <!-- getArticleAbstract($section,$article) --> Some things just don't change - at thirty, Adrian Mole is still the whining, unfulfilled loser we first encountered at age 13. He's still writing to the BBC, he's still madly in love with Pandora, now a high-profile politician in Blair's New Britannia, his family is still as dysfunctional as ever. More in our exclusive review of the new Sue Townsend novel. </font> <!-- snip! --> </body> </html>

Under normal circumstances, this page would receive the section and article numbers via the URL GET method, and then display the appropriate content. For example, the article entitled "Where Are We Going?" in the politics section (7) could be obtained at the URL

start.php?section=7&article=32

while a feature on Moscow in December could be obtained from the travel section (11) at

start.php?section=11&article=7

For explanatory purposes, I'll assume that the article number is 99 and the section number is 3 (entertainment, for those of you who care), and so I've hard-coded these values at the top of the page. I've also replaced a couple of function calls with their return values, again to make it easier to see what's going on.

Now, let's add those links.

<? // start.php // important information to identify this article $section = 3; $article = 99; ?> <html> <head> </head> <body> <!-- snip! --> <font face="Verdana, Arial" size="4" color="#66CC00"> <!-- getArticleTitle($section,$article) --> Mole In A Hole </font> <p> <font face="Verdana, Arial" size="2" color="Black"> <!-- getArticleAbstract($section,$article) --> Some things just don't change - at thirty, Adrian Mole is still the whining, unfulfilled loser we first encountered at age 13. He's still writing to the BBC, he's still madly in love with Pandora, now a high-profile politician in Blair's New Britannia, his family is still as dysfunctional as ever. More in our exclusive review of the new Sue Townsend novel. <p> <!-- snip! --> <a href="post.php?section=<? echo $section; ?>&article=<? echo $article; ?>">Comment</a> on this article, or <a href="list.php?section=<? echo $section; ?>&article=<? echo $article; ?>">view other people's comments</a> </font> </body> </html>

As you can see, both "post.php" and "list.php" will now receive the section and article numbers via the URL GET method.

Here's what the page looks like:



Shameless plug - you can find a copy of the book review above at http://www.melonfire.com/, together with lots of other cool stuff. Knock yourself out!

This article copyright Melonfire 2001. All rights reserved.

 
 
>>> More Site Administration Articles          >>> More By Vikram Vaswani, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: