Page 1 of 1

Making dynamic or active web pages..

Posted: Thu Jul 12, 2007 1:49 am
by Dr3am3rz
Hope that anyone out there can help me with this. I have never use a php language to programme before and I have to do this using php. I really need urgent help. Thanks in advance.

My situation is like this:
In my office, there's a server rack with a paper paste beside the server rack. The paper was drawn by hand to show the connection ports of all the routers and switches inside the rack by drawing a line indicating which port is connected to which port. I was told to do the same thing of what the paper has shown in a web page, some sort like a dynamic page or maybe an active page. The only way I can do is to maybe draw a box on the web page or draw a box and show in on the webpage as an image so the user will only need to hover the mouse over to the box and some sort like a light up if it is connected. I use boxes is to represent the ports of the routers and switches so I will say boxes in the rest of my question rather than ports. Router has 24 ports so I will need to display 24 boxes on the webpage. Let's say that if port 1 is connected to port 24, when the user hovers to box 1, both box 1 and box 24 will light up with green color and if the user hovers to box 24, box 1 and box 24 will also be light up, which in another words, any box is connected to any one of the boxes, both box will be light up.

After that, I will include 3 buttons where it is use to "Add Connection", "Edit Connection" and "Remove Connection". It will either add a new port connection or edit or remove away the existing connections. I was told that I need to use a database to store the data where I need to add, edit or remove the connection. Example will be if the existing connection is from port 1 to port 24 and I change from port 1 to port 10, after the data has been stored to the database, it will be able to light up 2 boxes when hovers to box 1 or box 10 instead of box 1 to box 24.

I hope I put it very clear. I can explain again if it's not clear enough.

I have been stuck for quite long and do not know how to start this thing. Hope you guys out there can help me or guide me along to start off with it. Thanks again.

Posted: Thu Jul 12, 2007 10:47 am
by RobertGonzalez
Most of what you are doing is client side (meaning XHTML, CSS and Javascript/AJAX). The only part of what you are doing that might involve PHP is the part that handles what the buttons describe.

What have you got so far?

Posted: Thu Jul 12, 2007 10:16 pm
by Dr3am3rz
What have I got so far? I'm not sure too because I don't have any idea how am I going to do it or even don't know how to start it. Now I have use the MSPAINT to draw a small box and save as image to represent the ports of those routers and switches and display the boxes in my main page. This will become some sort of like a swap image thing if those ports are connected but I don't know how to make it work if the data will be taken from the database. The database I was thinking of making 2 columns, "Port names for those boxes in the webpage" and the other is "Status, 1 for connected and will show light up with green color and 0 for disconnected and will show red". I have to do a boolean to make the boxes in the webpage to light up accordingly to the database right?

This webpage will be host in the server. You do understand what I am trying to say for my question? Hope you can guide me to start this thing. Many thanks.

Posted: Fri Jul 13, 2007 10:43 am
by RobertGonzalez
I understand what you are doing. You are creating a dashboard application that shows the status of your router(s) and ports on the router.

Before you get into this you really need to visit the HTML part of it. Knowing PHP and how to make it work for your situation will do nothing for you if you cannot get the results to the screen. Learn how to write markup, then move into PHP.

Posted: Sun Jul 15, 2007 8:24 pm
by Dr3am3rz
Nono, I am not going to monitor the status of the routers. It's just a display of the current connection of those routers and if there's any connection changes, the user will need to manually change by themselves.

Posted: Sun Jul 15, 2007 10:12 pm
by RobertGonzalez
Right, but this is not in itself a PHP thing, it is a 'How do I write the markup that will show this?' thing.