[advanced search]
Results from the most recent live auction are here.
20 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 04-16-2006, 10:17 PM   · #1
mcaricofe
NamePros Member
 
Trader Rating: (15)
Join Date: Dec 2005
Posts: 149
NP$: 0.00 (Donate)
mcaricofe has a spectacular aura aboutmcaricofe has a spectacular aura about
Is there a simpler way to do this that I'm missing?

Here's what I want to do:

I have this mini-site that I'm building, and it's just articles all linked from the home page. When I add a new article, I'd also like to add the link to it to the navbar on the left of all the pages. The way I built the site, the navbar is hard-coded on each page. I'm thinking if I put the articles into a MySQL database, then I could build the navbar on the fly.

Is there a simple way to do this?

Here's the site, so you can see what I've done so far.

Thanks for any help, in advance.

(Please don't laugh. I'm really new at web programming.)


Please register or log-in into NamePros to hide ads
__________________
Just a busy busy domainer!
mcaricofe is offline   Reply With Quote
Old 04-16-2006, 10:26 PM   · #2
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (244)
Join Date: Dec 2005
Posts: 21,398
NP$: 21635.83 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
why not get an article script to do the work for you automatically and it's a membership site as well that other members can submit their articles to your site sort of helping you out.
pm me if you want to see my url where I done it.
possible free article script I have in mind is articlebeach.com
or articledashboard.com
__________________
★★★ ESTIBOT.COM Free Domain Appraisal, Keyword Tools, Available Domains ★★★
PHP Link Directory Script phpLD Templates Category Dump
♥♥Clean Toolbar♥♥
I DNKitchen.com and Chef Patrick ---> Domain News

weblord is offline  
  Reply With Quote
Old 04-16-2006, 11:08 PM   · #3
BillyConnite
 
BillyConnite's Avatar
 
Name: Rhett
Location: Coffs H, Australia
Trader Rating: (77)
Join Date: Jul 2005
Posts: 3,106
NP$: 47.00 (Donate)
BillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant future
Wildlife Parkinson's Disease Parkinson's Disease
Originally Posted by mcaricofe
Here's what I want to do:

I have this mini-site that I'm building, and it's just articles all linked from the home page. When I add a new article, I'd also like to add the link to it to the navbar on the left of all the pages. The way I built the site, the navbar is hard-coded on each page. I'm thinking if I put the articles into a MySQL database, then I could build the navbar on the fly.

Is there a simple way to do this?

Here's the site, so you can see what I've done so far.

Thanks for any help, in advance.

(Please don't laugh. I'm really new at web programming.)


Hey mcaricofe,

If you are familiar with php, what you can do, is rename all your files to .php instead of .html, then where the navbar links are supposed to be, put the code:
Code:
<? include("links.php"); ?>

Then create the links.php page, and in it put all the link you would like to show on each page, so that you only have to edit it once each time you add an article.

OR

If you'd rather the link add itself instead of you doing it manually, the best thing to do would be use a php-sql based article CMS as webloard suggested, there's heaps out there, just google "php article script" and I'm sure you'll find something.

All the best,
Rhett.
__________________
<?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?>
BillyConnite is offline   Reply With Quote
Old 04-17-2006, 08:25 AM   · #4
Shorty
Senior Member
 
Shorty's Avatar
 
Name: Thomas White
Location: England
Trader Rating: (15)
Join Date: Sep 2005
Posts: 1,033
NP$: 31.15 (Donate)
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
What I would suggest is use BillyConnite's suggestion of including the links.php page.

But also use a database to pull the links from. Whenever you add an article, add a new row to the database with the following information: LinkID, ArticleURL, LinkText.

Then you can easily write the PHP to fetch that info and generate the navbar from this data, in fact i'll do it for you..:
Code:
<?php require_once ('connect.php'); // connect to the database $query = "SELECT LinkID, ArticleURL, LinkText FROM Links ORDER BY LinkID"; // Query to get the data $result = @mysql_query ($query); $num = mysql_num_rows ($result); // Get the amount of links the query found if ($num > 0) { // If you got a result from your query while ($row = mysql_fetch_array($result)) { // For each result you found, do the following echo "<a href="$row[1]">$row[2]</a><br>"; // row[1] contains the ArticleURL, row[2] contains the LinkText } // Ends function for while } else { // If there were no links found in the database echo "No links found."; } // Ends else mysql_close(); // Close the database ?>
Shorty is offline   Reply With Quote
Old 04-17-2006, 03:05 PM   · #5
mcaricofe
NamePros Member
 
Trader Rating: (15)
Join Date: Dec 2005
Posts: 149
NP$: 0.00 (Donate)
mcaricofe has a spectacular aura aboutmcaricofe has a spectacular aura about
Thank you all for your replies -- I'll probably try them all, over time, to see which works best/easiest for me.
__________________
Just a busy busy domainer!
mcaricofe is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Website Header Design Buy Flash Arcade Game Script EscrowDNS
Advertise your business at NamePros
All times are GMT -7. The time now is 09:53 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0