Drop Down boxes and Databases ??

gmloki

Part of the furniture
Joined
Dec 22, 2003
Messages
634
I need some help developing a web page. Basically it is an online pricing page. Basically I want to have a few drop down boxes and the user can chose from a variety of different options in each box. They then click submit and it will calculate the different costs at the bottom of the page.

I can code a basic web site with nothing too fancy but I am guessing this will require some kind of database to store the information and fetch that to the page. I know nothing about this so I maybe barking up the wrong tree here. Any suggestions would be most appreciated or if you can point me in the direction of any reasonable on line guides then I would be more than happy. Also if I have missed anything out then let me know

Many Thanks
 

JingleBells

FH is my second home
Joined
Mar 25, 2004
Messages
2,224
You will probabaly need:
Web server software - I recommend Apache 2 Web Server, much nicer than IIS
A server side scripting language - Something like PHP, you could use ASP (microsoft) or JSP(java) or even Perl(if you're insane). This is needed to output data from the:
Database Software - I use MySQL, PostreSQL is popular also

Installing these is relatively easy, just follow the documentation on their websites.

Once all that is installed, there are many websites detailing using php and mysql. Google produces a long list. The PHP manual is an invaluable resource too.

If you have any problems just ask here, I'm sure Jonty will be able to add more also :)
 

mookie

One of Freddy's beloved
Joined
Dec 23, 2003
Messages
251
if you just want to have a play around with things locally, its probably best to install xampp or phpdev on your computer and see what you can knockup there, it can make the hosting selection easier when you know exactly what you need
 

Chilly

Balls of steel
Joined
Dec 22, 2003
Messages
9,046
I have a knackered out old pc in the cupbored running linux with apache, php, perl, mysql and a whole load of other shit i enjoy playing with. It means I can prototype all my code before I upload etc.
As for databases and querying them, I'd get a book or find a decent online guide to SQL - THE database query language. Coding this kind of webpage is 100% text editing, there is very little to no wysiwyg component to it. But by the end you will be profficient at php, sql and perhaps regular expressions, JScript or whatever else you use.

I would reccoment the php/mysql pair, since they are by far the most common rear end engines for websites. As your website becomes bigger and it attracts hundreds of hits a second then you need to start using beefier stuff, probably custom programs run as CGI written in C or perl or whatever - since these run faster than PHP if coded properly although they are much hardder to roll out, whereas PHP is a toddle.

For most purposes mysql/php is fine, though.

Good luck :)
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
This reminds me, I was going to have a look at the shopping kart installation in the control panel of one of my sites, just to see how it works - this might be an easy way to do this, I'll let you know. :)
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
Hi Ash

Just a flying visit. As said above, PHP and MySQL is probably the easiest way to go, and there are plenty of support sites out there with great tutorials (PHP Builder, Site Point etc.). Both languages can seem daunting at first but I'm sure you'll soon get used to them.

It's possible to run Apache, PHP and MySQL as Windows services if you want to develop on your machine, or you can just upload to your web host. The benefits of having such a setup means you can customise the development environment to your needs (error messages on, for example, which most hosts won't have by default), and it also saves time uploading files just to check how they work. The downside, however, is that it can be a little daunting to setup properly, and may be a little overkill if it's only a small project you're doing.

Anyway, whatever you decide I'm sure the people here will help you with the coding side of things.

Kind Regards
 

gmloki

Part of the furniture
Joined
Dec 22, 2003
Messages
634
Thanks very much for all the helpfull feedback I am sure it will come in useful. No doubt I will have a few scratchy head moments along with WTF does that mean so expect me back with more questions

Once again many thanks
 

MKJ

Fledgling Freddie
Joined
Jun 5, 2004
Messages
1,196
Sounds like you might be jumping in at the deep end. Why not go to a script site and look for something that is already up and running?

Try this one:

Good Script Site

If you want to experiment on your own pc by installing a server then go here and download the package. Installs all you need in one click.

Server package.
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
Script sites are all very well, but by the time you've found one that truly suits you (and produces good code) you could've learned to some reusable programming skills, I guess it depends on your ambition.

MySQL is excellent for small scale work like this and MySQL AB have started producing some genuinely excellent tools for use with it, namely the MySQL Administrator and Query Browser. One word of advice, although the setup routine for MySQL 4.1 is outstandingly good (no longer requiring any manual editing of config files) there are compatibility issues with some software and on the majority of affordable web hosts, you'll still only get MySQL 4.0. It's always wise to use the same version as your host!

Scripting language, PHP is the way to go for something like this. Again, it's available on most web hosts (unlike ASP.NET* or JSP) and learning either ASP.NET or JSP is probably overkill (more like programming full applications than web pages). Getting either of the latter to produce standards compliant code is also less than intuitive.

The server package that MKJ links to will do the job nicely for getting kitted out with the above more quickly. That kind of thing is very useful indeed.

*Footnote: People often refer to "ASP" and "ASP.NET". They're actually very different. ASP is a dead language quite similar to PHP that Microsoft used to peddle, but has been discontinued for a number of years in favour of ASP.NET, which is a .NET 1.0/1.1/2.0 technology where you use an XML-like language to template your pages and the immensely powerful C# language for the backend. Like I say, t'is overkill for this.
 

phlash

Fledgling Freddie
Joined
Dec 24, 2003
Messages
195
Apologies in advance but I have to do this..

<pedant mode>
ASP was/is not a language in itself, it's a framework and syntax for embedding server-side code in a web page (the same is true for JSP - infact they are almost identical). The code can be written in JScript, VB, or anything else supported by the windows scripting host (cf: for JSP it must be Java).

ASP.NET is of course the same idea reimplemented with a .NET back end (instead of wscript.exe), and your server-side code can now be written in any supported .NET language (typically C#, but can still use VB!).
</pedant mode>

..there. I feel better now :)
 

Ning

Fledgling Freddie
Joined
Jan 2, 2004
Messages
489
I'm developping with ASP.NET and it's absolutly perfect. Basically, you make a webpage just as if you were coding a windows software. It's completly object oriented, you can code with any object oriented language supported by the .NET framework (c++, c#, visual basic.net (nothing to do with VB BTW), etc). You can use the same classes for a windows software and for a website.

You can dw the beta express editions for free for the moment.
http://lab.msdn.microsoft.com/express/vwd/default.aspx

The only drawback is that it's a microsoft product and you have to use IIS as webserver :mad:
There is a similar open source project running with Apache (www.mono-project.com) but I haven't found the time to test it yet (but I heard it worked fine).
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
ASP.NET is, on the whole, quite excellent. However, using .NET 1.1 producing anything that resembles standards compliant code is something of a tedious joke. It can be done, but it disallows you from using most of the out-of-box WebForms controls. I believe that some 3rd party efforts were made to have webparts that produced standards compliant code, but XHTML is a pipe-dream (since every time you view your page in the WYSIWYG editor, it will strip all the XML closing '/>' in collapsed tags).

.NET 2.0 (and Visual Studio 2005/Express) are a grand improvement (though out-of-box the code is still shit). You can customise the code templates for the provided controls though, which at least means the grotesque quantity of excess tags can be kept under control.

Ultimately, ASP.NET has substantial, harmful elements which appeal to the Frontpage generation. However, the power of using C# in the backend can make up for the manual effort required to keep the generated code in check.

Oh, and as I understand it the Express editions will remain free even when finished.

So, yeah, that went off topic. Sorry!
 

Users who are viewing this thread

Top Bottom