Guest Zim Posted August 27, 2003 Report Posted August 27, 2003 hey guys i have this problem i am doing a website and i have loads of products that need to have there name/features/specifications and all deisplayed when u click on their relevent info button! how would i go about doing this? i started using xml, and having one template, wthat works but i stil have to create seperte pages for each product! how could i just have one template and have all the specific information for the product called up form the database/xml file?allow me to create less webpages? and make it quicker? any idea's? how to's? or scripts would be a great help! thanx "Z"
Guest ashley.flynn Posted August 27, 2003 Report Posted August 27, 2003 ok heres the basics, i have never used xml, normally illl combine PHP or ASP with an access database or similiar. This will set you up with a site which lists available product and then just one page which displays all the products information.(dynamically depending on product chosen) In Access, create a table called 'products' give it field names of 'prodid' type=autonumber 'prodname' type = text 'prodDescription' type = memo now add data to the table for example, prodid=1 prodName=Orange SPV ProdDescription=Quite possibley the greatest phone ever made! prodid=2 prodname=All Nokia's Prodescription=not good, not good at all! Now you have to connect that information with a web page. create 2 files, 1 called page1.aspx and one called page.aspx once you have chosen a language essentially you want to connect to a database (see the links provided at bottom) and get all the information from the table using an SQL Statement like so, SELECT * FROM products this will return a recordset, link through the recordset outputting the prodName field. Whta would be listed is something like this; Orange SPV All Nokia's now the clever bit, we want to get it so that these are hyperlinks to page2.aspx but we also need to let page2 know which item has been clicked. we attach that prodid field to url by doing something like this when we link through the recordset <%= prodName %> This creates the hyperlink and adds that productid field to the url. This means that if you hold mouse over the created links you would see something like this; for SPV page2.aspx?id=1 for Nokia page2.aspx?id=2 Now when we load page2 we can request this information using something like myprod = request.querystring("id"). once we have got that we need to connect to our database again and use this kind of SQL statement; "SELECT * FROM products WHERE prodid=" & myprod This will only return the row of information for the product you desire and you can format out the information any way you like in the page. Phew!!!! i said the basics but you have good grounds there to make a shopping cart. I'd be surprised if you could follow all that but essentially that is the way it works. Because i do not know you knowledge on things like SQL i may have got through things too fast. I have tried to find some examples of shopping cart tutorials. What you are most interested in displaying a list of stock and when you click it, displaying the stock details. The first thing you need to decide is what language and information store you are going to use and tutorials are much easier to find. Im a .net man myself so check some of these out. ; http://www.dmxzone.com/ShowDetail.asp?NewsId=4700 'notice the newsid=4700?? thats how it know which news article to return to you http://samples.gotdotnet.com/quickstart/as...oc/default.aspx http://www.wellho.net/forum/0326818201.html hope all this can help you in some way!! www.asp.net, gives you 'web matrix' which comes with a webserver emulator so you can test all your code. There are loads of tutorials etc downside: you have to have a web host that supports .net
Guest Zim Posted August 27, 2003 Report Posted August 27, 2003 Cheers mate :) ;) :D will give it a go in abit and let you know how it comes along! seems quite straight forward! well kinda! will let ya know! thanks alot mate "Z"
Guest ashley.flynn Posted August 29, 2003 Report Posted August 29, 2003 if per-chance you decided to use .net, as long as it is not a big project, i could probably help/write the code for you and send it to you. Ive been in the US for 2 months visiting my mother, but shes not here all day and i got two more weeks to look forward to the same :roll:. so if you need any help just drop me an email
Guest Zim Posted August 29, 2003 Report Posted August 29, 2003 well its for myself, and a company, its an assesment, i wanna do so i can improve on the company's site. and if they like it i get a job! and get my marks at uni! :) "Z"
Guest ashley.flynn Posted August 29, 2003 Report Posted August 29, 2003 ok a have made a very simple web application to do what you asked, in order for you to be able to run it you will need the following things; .net Framework (23mb!) http://download.microsoft.com/download/a/a...06/dotnetfx.exe ASP.net web matrix (need to give them your email) http://www.asp.net/webmatrix/download.aspx?tabindex=4 One these are both installed download the attached files and unzip them to the same directory. Start web matrix and open up the file called 'index.aspx'. Click the play button near the top of the program and youll get a dialogue box (starting a webserver) just click ok and it should run without any problems. youll see something like the images i have attached to explain what some of it is. This is very basic. Just add html to the html section to get some kind of design going.Image2.jpgImage1.jpgZim.zip
Guest ashley.flynn Posted August 29, 2003 Report Posted August 29, 2003 goddamn it i hit submit instead of attach!!! sorry about that. Lets try again ok a have made a very simple web application to do what you asked, in order for you to be able to run it you will need the following things; .net Framework (23mb!) http://download.microsoft.com/download/a/a...06/dotnetfx.exe ASP.net web matrix (need to give them your email) http://www.asp.net/webmatrix/download.aspx?tabindex=4 One these are both installed download the attached files and unzip them to the same directory. Start web matrix and open up the file called 'index.aspx'. Click the play button near the top of the program and youll get a dialogue box (starting a webserver) just click ok and it should run without any problems. youll see something like the images i have attached to explain what some of it is. This is very basic. Just add html to the html section to get some kind of design going. if you want to put it up online www.brinkster.com allow free accounts which should work fine with something like this Hope this helps yaZim.zipImage4.jpgImage3.jpgImage2.jpgImage1.jpg
Guest Zim Posted August 30, 2003 Report Posted August 30, 2003 Damn, u sure know your stuff! thanks alot will try it out this weekend! and will let you know how it goes! ;) you the MAN! thanks! hopefully i camn get it work! remind me to buy u drink sometime :) thanks again! "Z"
Guest Zim Posted September 2, 2003 Report Posted September 2, 2003 Hey thanks again for the help, kinda getting the hang on it! learning loads! thanks to the push in the right direction! just one question i wanna have pictures referenced in my db and then called up and shown through the aspx script. kinda got half it working declared a new column as an ole object and done the required code in the asp page but still no pic showing up? any ideas "Z"
Guest Zim Posted September 2, 2003 Report Posted September 2, 2003 Now i got it working! well everything except the pictures though. but working on that one! just one question, i have these datagrids i have created now how would i go about placing then in my html pages? of do i have to create all aspx pages for everything in the site? any ideas? "Z"
Guest ashley.flynn Posted September 2, 2003 Report Posted September 2, 2003 anything with dynamic content needs to be named aspx im afraid. Ill look into the images now
Guest ashley.flynn Posted September 2, 2003 Report Posted September 2, 2003 ok i have rewritten it to have a picture, if you are already doing you own version you must add a column to the database called 'images' and enter the url of the image. Look at the html part where the new template column has been added. this is the code to show the image hope this helpsImage2.gifImage1.gifZim.zip
Guest Zim Posted September 3, 2003 Report Posted September 3, 2003 Aaahh thats how you do it! was looking it up on the net all day yest and well didnt quite work! thanks mate you a genius! :) gonna try it out now! oh yeah so there aint anywway i can use the datagrid in my normal html file? or do i have to rename it as a aspx file and place the datagrid within that? "Z"
Guest Zim Posted September 3, 2003 Report Posted September 3, 2003 hey i cant seem to get it working i keep getting up with a Parser Error dont know wrong, just running your code andaint showing up. here is the errorerror.JPG
Guest Zim Posted September 3, 2003 Report Posted September 3, 2003 Solved it! yey! reallly getting into this stuff now! this is the line that bothered me changed it to this "> from "> done the trick! :wink: back to work! :) "Z" oh yeha let me know if i gots to chnge my html page to aspx pages to gert the satagrid to work
Guest Zim Posted September 3, 2003 Report Posted September 3, 2003 Is it posssible to not show the the images column, ie the one that holds the addess for the image? (/image/123.jpg) "Z"
Guest Zim Posted September 3, 2003 Report Posted September 3, 2003 sorry if i am bothereing ya, let me know if ya busy or anything! another quick question can i do something like this thanx again "Z"is it possible.JPG
Guest ashley.flynn Posted September 3, 2003 Report Posted September 3, 2003 cool looks like your getting on well. with regards to the html/aspx page thing. Basically to the end user it makes no difference to them what it is called, all that will be returned to them is standard HTML. But the webserver needs to know which pages have code to process and which ones dont it does this but checking the extension of the file. So you could copy the html that makes the datagrid and it will work no problem but if you need to have anything with the <% TAGS %> or anything in that page_load function it has to be named aspx so the server knows theres things to be done whoops! didnt realise it went on to the second page, i kinda feared you ask those questions. Itspossible and pretty easy but requires much more code, ill get something knocked up later today
Guest Zim Posted September 3, 2003 Report Posted September 3, 2003 Well i gots a great teacher! :) its coming along all good now i have a few pages of .aspx mainly the ones getting information form the database. kinda working making the out put for my product description like the pic. my goal is to make it similar or there baouts like so http://www.dabs.com/products/prod-info3-in...&quicklinx=2N92 if its possible then cool! if not will have to re think my approach! 2pages yeah getting to quite a busy topic! lol even if its just two people contributing to it! :lo: thanx a lot mate. "Z"
Guest ashley.flynn Posted September 8, 2003 Report Posted September 8, 2003 sorry about the late reply. it was my sisters wedding on saturday and it has all been a bit hectic attached is the files for what you need you should get something like the attached image. Note, the code and html in the showproduct.aspx page have changedZim.zipImage1.jpg
Guest Zim Posted September 8, 2003 Report Posted September 8, 2003 Gee thanx man! well hope your sisters wedding went all as planned! all that partying and that! lol thanks again. will have a look at the code and will let ya know what happens! :) thanx again man! "Z"
Guest Zim Posted September 16, 2003 Report Posted September 16, 2003 Hi there mate. been a longime been getting on pretty much well. just a few things i need your help on. 1) i got a top bar on the show product window, when i click on the links on top it will open up the page which the details on it. ie. click on specification and the description will go away and and the specifications list will come on, this will be on the same page? is that possible 2) hosting the webpage do i neeed sucurity and all? how would it connect to the page and database? basically how do i host and sucure it 3) would i be able to adjust it to e-commerce and have usernames and passwords and all? thanx "Z"
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now