Reply to Re: Populating Web Pages from Spreadsheet

Your name:

Reply:


Posted by Beauregard T. Shagnasty on 12/05/06 19:42

payperclick.brandon@gmail.com wrote:

> Thanks for the reply's so far. I am still not any closer to
> accomplishing what I want to do. let me try and simplify what I am
> asking and see if someone can give me code snippets to accomplish the
> task.

Code snippets ... first anyone would need to know what server-side
language you wish to use.

> Assume I have a CSV or Excel or Txt file called sample.csv(or .xls or
> .txt - whatever works easiest - really trying to avoid using a
> database - but if that is tons easier I am open to learning) with the
> following data.

My recommendation, for 7,000 parts, would be to use a database. I
personally think it is easier (but then I've been an RDBMS guy for 25
years or so).

> partno partname description price
> 1 AAA Product text in a variable-sized field 123.45
> 2 BBB Product text ... 99.95
> 3 CCC Product text ... 2855.99

I also tend to use non-English words for field names, which removes the
chance that you would use a programming "key word". I would use:

npart cname mdesc yprice

...with the first letter indicating the type of field, n=numeric,
c=character, m=memo, y=currency

I would also want to add some kind of grouping and maybe sub-grouping
codes to this table. You don't want to display a listing of 7,000 items
and expect visitors to pick from something that reaches from here to ..
(we always said) China.

Group by major type, minor type
cmajor cminor
Fireplace Andirons
Fireplace Fake logs
Tools Screwdrivers
Tools Hammers ... you get the idea

(This is not correct 3rd Normal Form as shown here. There would be
another table that lists "Fireplace" once, and "Tools" once, and you tie
them together with Primary and Foreign Key fields ... but this is not a
post about proper relational database theory.)

You would then have pages with a major listing, visitor selects one, new
page appears with all the minor parts, with description, clicks link,
goes to new page with all the info including the picture. Called
"drill-down."

> Now I want to create a URL that has the ID in the URL -
> Example.com/id=1
>
> 2 questions -
>
> 1. What is the proper formatting of that URL? (I am pretty sure I need
> a ? somewhere in the URL.) (example.com/index.html?id=1 would that
> work?)

http://example.com/product.php?npart=1234

> 2. If all I wanted to do was have the page say? Thanks for visiting
> our %Name% page. How would I tell the browser to go to the file,
> lookup th id provided in the URL and then dynamically populate the
> %Name% field?

You would open the database, seek the record with an SQL "SELECT"
statement, then write out the code using the found result, and close the
connection to the database.

SELECT * FROM parts WHERE npart = 1234

It has been a long time since I taught anyone basic programming ... I'm
not sure I can do it here in a couple of Usenet posts. Google produces
lots of links, including:

<http://www.webmonkey.com/webmonkey/99/21/index2a.html>
<http://www.amazon.com/PHP-MySQL-Programming-Absolute-Beginner/dp/1931841322>

An option for you to explore would be to hire someone well-versed in
back-end web site/database programming.

I maintain a few sites mostly as a hobby (I'm retired), and they all use
databases. In this one, anything that *looks* like a table *is* a table,
and I wrote a custom CMS for the owner to enter/delete his own stock,
events, new model descriptions, etc, even the pictures in the 'gallery'.
Re the bike photos, I taught him how to take and resize digital
pictures, and FTP them to the site, using the stock number as the file
name.
http://countryrode.com/sales/preowned.php

My son-in-law just bought Stock Nr. 2257. <g>

--
-bts
-Motorcycles defy gravity; cars just suck

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация