Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Who's responsible?? 3

Status
Not open for further replies.

muchAppreciated

Programmer
Oct 6, 2002
8
US
Hi, I know that the answer is most probably me, the web designer but I just thought I'd get some opinions:

I designed a site for a client with quite a few pages. On several of the pages there is an admission price for his program.... He told me oned day that the price changed and to change the price on page x. The next day, he says that on page y, it still says the old price and I should change it. the following week he says that page z still has the old price and that should be changed and that I should please check the site for any more errors! Is it my responsibility to remember every place on the site where he has this price and change them or is it his responsibility to tell me that he wants the price changed on pages x, y, and z...

I guess it's probably me but I wanted to check b/c it is hard to memorize every page of every site you've ever done..

 
I wouldn't say that it is your responsibility. But I'd also say that I'd have stored the price of all the programs in a database so that it would only have to be changed in one place to reflect throughout the whole site.

Rick
 
I've never used a database before. Can you tell me how I would do that?
 
First of all, you will need a database you can use and a language to interact with the database. I use MySQL an PHP:
1. because they are both free
2. because they are easy to use and fast

If you goto and you should find the download links plus tutorials for both the languages. webmonkey also has a good php + mysql tutorial.

Rick
 
Hi Guys,

A more simple way to do it would be to use something like SSI and just set the variable price, then echo it throughout the places needed.

A database seems a bit much for a few prices.

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Hi mate,

Server Side Includes (SSI) simply allows you to do quite a few things in an HTML page that you cannot do with static HTML.

To do what you require above, you could do the following:

At the top of each page where the price appears, add the follwing:

<!--#include virtual=&quot;/price.shtml&quot;-->

Then create a file named price.shtml In this file, include only the following code.

<!--#set var=&quot;price1&quot; value=&quot;34.99&quot; -->
<!--#set var=&quot;price2&quot; value=&quot;49.99&quot; -->
<!--#set var=&quot;price3&quot; value=&quot;99.99&quot; -->

Now, where you want the price to appear, add the following:

The price of item 1 is £<!--#echo var=&quot;price1&quot; -->
The price of item 2 is £<!--#echo var=&quot;price2&quot; -->
The price of item 3 is £<!--#echo var=&quot;price3&quot; -->

Doing it this way, you edit price.shtml and change the prices, all pages reflect the change.

To use SSI your server needs to support it, but that is the same with any server side language.

You would also need to rename the files to .shtml rather than .html, but again you would have to do this with php or perl anyway.

If you only have one price to update, you could simple put the price in a text file and include it with the first code above.

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
thanks a bunch. that really does help! Just a couple questions:

only the file with the pricing needs to be names shtml, not all my pages, right?

also, what do you mean by:
If you only have one price to update, you could simple put the price in a text file and include it with the first code above.
thanks.
 
Hi mate,

ALL of the files need to be named shtml. Whatever way you decide to do this you will need to rename the files.

The part about the one price was as follows:

At the place where you want the price to appear, put the following:

The price is £<!--#include virtual=&quot;/price.txt&quot;-->

Now, in price.txt, just simply add the price, nothing else. So the contents of that file would be something like:

34.99

Everytime the pages are called, that price will be included where the code is.

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
does every single page in the site have to be shtml or only the pages that will be calling the price file? Meaning if the homepage doesnt have the price on it, does it still need to be changed to shtml?
 
Hi mate,

Only the pages involved need to be renamed.

If you choose the first method above, then even the page to be included needs to be shtml, otherwise it may be a txt file.

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
wullie, you get a star from me also...you inadvertently helped me also...to which I am much obliged...:) I have not failed; I have merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top