View Full Version : PHP URL's [urgent]
Danny
February 16th, 2005, 23:27
Hey,
On this (http://dannyweb.net/devs/mmia/members.php) page we have loads of company names on the left...we want it so when you click the name of company you want, the contact details etc come up in the centre.
now if i make a new page for each company, this would take ages.
is there a way of making a link that simply changes the php include in the centre column?
I was recommended to have something similar to page.php?id=9 where '9' is the ID of the link, is this correct and if so how would I go about doing this?
All feedback appreciated...
sonicgroup
February 16th, 2005, 23:30
That's essentially the idea. How do you have the company information stored? In a database? If so, it would be easy enough to simply pull the record for that company based on an ID in the URL and insert it into the page. I wouldn't use includes or separate pages for any of this. If the information is not in a database, I would strongly recommend putting it in one. It will simplify matters down the road if you decide to do anything more complicated with the data.
Danny
February 16th, 2005, 23:34
i would normally ask Tjobbe to do this as he has coded the rest of my design very well.
but i need this section online first thing in the morning, and Tjobbe is having a much deserved rest!
At the moment the company information is not online at all and is sitting idle as an excel file on my computer.
Can you tell me what i need to do to retieve the information from the database, i.e how i link them up and also is it possible for me to have each companies logo on their page? Maybe an external link?
Thanks.
sonicgroup
February 16th, 2005, 23:50
Well, that's a lot more than I could reasonably cover in a post here. If you've never done this before, I'd suggest either reading a tutorial (http://webmonkey.wired.com/webmonkey/programming/php/tutorials/tutorial4.html) about using PHP with databases or waiting for Tjobbe to fix you up.
Danny
February 16th, 2005, 23:52
Cheers, ill check out the tutorial, and as i was saying to Jamie, ill probably just setup one page manually and show the client how it will look (draft) then get Tjobbe to give me a hand.
Thanks again for the advice and link.
the_pm
February 17th, 2005, 00:02
On an aside, can a DB connection be made to a spreadsheet??
In the past I've always set up an import function, so clients hellbent on maintaining Excel documents could synch up to Access easily.
RCMV
February 17th, 2005, 02:44
Hey Danny, you asked for feedback so here it is:
1. I would recommend that you let the original developer make the changes to maintain good code.
2. Check your code when adding information to the site to make sure you are not messing up the code. After viewing the code for the page you listed in your original post, it has some errors in it which need to corrected. Following is the code that needs attention:
<div id="middle">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<p>Please choose a company from the list on the right, please note this section is still under development and content taken from this site will <strong>not</strong> be accurate. <br>
</p>
</body>
</html>
</div>
It seems someone has started another HTML file inside the existing file.
Danny
February 17th, 2005, 04:28
I have noticed that i am putting more errors in that taking them out, so i have left the site for Tjobbe, the sites developer, thanks for the feedback though!
Much Apreciated!
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.