Hi.. =)
I am trying to learn some php but i have run into a problem..
All the pages on my site should include a topmenu.php and a leftmenu.php. The topmenu.php always have the same links, so no problem there, but my leftmenu.php needs to have a special amount of links(also different links for each site), and a special amount of rows for each site..
Can anybody point me in the right direction? =)
Dynamic links in table
Page 1 of 17 Replies - 2194 Views - Last Post: 04 November 2010 - 04:22 PM
Replies To: Dynamic links in table
#2
Re: Dynamic links in table
Posted 03 November 2010 - 05:50 PM
Your first and biggest problem is that you think your html pages are made up of php "pages." There is no such thing as a php page, only a file. The file or files are executed on the server and the server sends html, some or all of which is generated by php, to the browser. Stop thinking that php and html are the same!
#3
Re: Dynamic links in table
Posted 04 November 2010 - 12:27 PM
CTphpnwb, on 03 November 2010 - 04:50 PM, said:
Your first and biggest problem is that you think your html pages are made up of php "pages." There is no such thing as a php page, only a file. The file or files are executed on the server and the server sends html, some or all of which is generated by php, to the browser. Stop thinking that php and html are the same!
I have a topMenu.php looking like this, no php code, just .php file
<table id="topMenu"><tr><td><a href="/default.php">Home</a></td> <td><a href="/link1.php">Tutorials</a></td> <td><a href="/link2.php">References</a></td> <td><a href="/link3.php">Examples</a> </td> <td><a href="/link4.php">About Us</a> </td> <td><a href="/link5.php">Contact Us</a></td></table>
But i am not really sure what you are meaning?´I know php and html aren't the same?
#4
Re: Dynamic links in table
Posted 04 November 2010 - 01:25 PM
Don't mind him too much. He gets a little cranky every now and again. 
If I understand your question correctly, you'll want some php code in that file and link it up to a database or other input file in order to dynamically generate the menu and links.
Your links might look a little like this:
If I understand your question correctly, you'll want some php code in that file and link it up to a database or other input file in order to dynamically generate the menu and links.
Your links might look a little like this:
<a href='<?php echo $link; ?>'><?php echo $link_name; ?></a>
This post has been edited by BenignDesign: 04 November 2010 - 01:27 PM
#5
Re: Dynamic links in table
Posted 04 November 2010 - 01:28 PM
BenignDesign, on 04 November 2010 - 12:25 PM, said:
Don't mind him too much. He gets a little cranky every now and again. 
If I understand your question correctly, you'll want some php code in that file and link it up to a database or other input file in order to dynamically generate the menu and links.
If I understand your question correctly, you'll want some php code in that file and link it up to a database or other input file in order to dynamically generate the menu and links.
Not exactly.. I want to write something like
<?php
include("topmenu.php");
include("leftmenu.php");
?>...
on my "real" sites, so that they get a top menu and a left menu and the leftmenu.php got dynamic links. =)
#6
Re: Dynamic links in table
Posted 04 November 2010 - 03:47 PM
That makes no sense. What is topmenu.php? It should be php code, which has nothing to do with any menu position.
You should be doing:
Those files should contain html elements that will be positioned by your css file.
You should be doing:
<?php
include("topmenu.html");
include("leftmenu.html");
?>
Those files should contain html elements that will be positioned by your css file.
#7
Re: Dynamic links in table
Posted 04 November 2010 - 04:19 PM
CTphpnwb, on 04 November 2010 - 02:47 PM, said:
That makes no sense. What is topmenu.php? It should be php code, which has nothing to do with any menu position.
You should be doing:
Those files should contain html elements that will be positioned by your css file.
You should be doing:
<?php
include("topmenu.html");
include("leftmenu.html");
?>
Those files should contain html elements that will be positioned by your css file.
I asked on another forum(some time ago now) about including html files, and they told me that it was only possible to include .php.. i guess i should have dobbelt checked back there..
Okay.. i will change topmenu and leftmenu to .html, but can anybody help me with the links?
#8
Re: Dynamic links in table
Posted 04 November 2010 - 04:22 PM
You've got the links in a table. I'd put the table (if I was sure I needed it) in a div and give the div a class name or maybe an id. Then it's just a matter of positioning the div correctly with css.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote







|