|
#1
|
|||
|
|||
|
help with php gui
Hello all
I thing this is going to be very complex. I have a Some PHP and HTML files I would like to put together but, there is things that need to happen. I forgot the MySQL database set up. I will first post the script and code for the PHP and HTML. PHP Script PHP Code:
Code:
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <title>Untitled Document</title>
6
7 <style type="text/css">
8
9 body {
10 behavior:url("csshover.htc");
11 }
12
13 * {
14 font-family:arial,tahoma,verdana,helvetica;
15 font-size:12px;
16 }
17
18 /* the menu */
19
20 ul,li,a {
21 display:block;
22 margin:0;
23 padding:0;
24 border:0;
25 }
26
27 ul {
28 width:250px;
29 border:1px solid #9d9da1;
30 background:white;
31 list-style:none;
32 }
33
34 li {
35 position:relative;
36 padding:1px;
37 z-index:9;
38 }
39 li.folder ul {
40 position:absolute;
41 width: 160px;
42 left:250px; /* IE */
43 top:5px;
44 }
45 div#descrip
46 {
47 left:
48 }
49 li.folder>ul { left:250px; } /* others */
50
51 a {
52 padding:2px;
53 border:1px solid white;
54 text-decoration:none;
55 color:gray;
56 font-weight:bold;
57 width:100%; /* IE */
58 }
59 li>a { width:auto; } /* others */
60
61 /* regular hovers */
62
63 a:hover {
64 border-color:gray;
65 background-color:#bbb7c7;
66 color:black;
67 }
68 li.folder a:hover {
69 background-color:#bbb7c7;
70 }
71
72 /* hovers with specificity */
73
74 li.folder:hover { z-index:10; }
75
76 ul ul, li:hover ul ul {
77 display:none;
78 }
79
80 li:hover ul, li:hover li:hover ul {
81 display:block;
82 }
83
84 </style>
85
86 </head>
87
88 <body>
89 <ul id="menu">
90 <li class="folder">
91 <a href="#" class="submenu"></a></li>
92 <ul>
93 <li class="folder"> See: </li>
94 <li class="folder">
95 Paper: <br /> See Reference</li>
96 <li class="folder">
97 Paper: <br /> See Reference</li>
98 <li class="folder">
99 <a href="">Online catalogue</a></li>
100 <li class="folder">
101 <a href="">Full text – Online - Infotrac</a></li>
102 <li class="folder">
103 <a href="">Full text – Online - CBCA</a></li>
104 <li class="folder"> Absorbed: <br /> See Reference</li>
105 <li class="folder"> ISSN: </li>
106 </ul>
107 </li>
108 </ul>
109
110 </body>
111 </html>
What I would like to do is turn the HTML into PHP without changing the layout. I think I know a little about it where it says (on line 38 in the PHP script) $row["heading"]); I would change heading with Title and where I see $row [""]); I would put the right column name. Here is going the be the hard part I would the script to search the different records and put the right formatting in place from the HTML code. EX: If the script search and finds See then it will only show that in the submenu or if the script find page2 online catalogue then it would only display page 2 format and online catalogue. |
|
#2
|
|||
|
|||
|
The best way to do this would be to use a template engine, such as Smarty. Smarty allows you to have one file with HTML and simple placeholders where you want your dynamic information to go. You simply write your PHP code as you normally would, then you call Smarty and tell it to map the values to your HTML file.
http://smarty.php.net/ Have a look - there's plenty of documentation and help on the Smarty website to get you started and it'll help you with any future projects.
__________________
Get free web design and development help! |
![]() |
| Bookmarks |
«
Previous Topic
|
Next Topic
»
| Topic Tools | |
|
|
All times are GMT +1. The time now is 03:12 PM.
[
RSS ]








