Hello
Please be indulgent - I am an old-school RPG and COBOL programmer and newly "recycled" in modern programming.
I am setting up a website to sell tickets with prices varying according to:
- destination
- arrival point
- type of transport (shuttle, private, VIP)
I was surprised to see that in all of the websites I viewed and in the tutorials I have been using to help me out, the values on drop-down boxes are hard-coded in the html file. I expected them to coming from an external database. Is hard-coding in html now considered best practice? Does it matter?
Apart from the fact it looks ugly, I was just thinking that if in the future the company wants to apply a 10% increase, it would be easier to do in an external database and retreive via SQL than going to change every price manually in the html.
It could be you're mistaken about what's going on. If you are viewing the *output* of these web sites, by something like "view source" in your browser, then you are unlikely to be seeing the actual code of the web site. Such a site may very likely be querying a database to collect navigation structure, lists of flights, prices, etc, and then formatting and outputting the html to the browser.
I.e. you're looking at a printout on green and white striped paper and asking why someone is bothering to manually type that page up each time
Bookmarks