|
Posted by Rene Pot on 05/08/06 02:34
Christina wrote:
> I'm pretty new to using PHP, so please bear with me.
>
> This subject has probably been covered a hundred times, but I can't find a
> clear answer on the web or in a newsgroup. I have a 650 page intranet site
> that I am working on with categories and subcategories (each in their own
> subsequent folders) and I am using PHP (4.1+) and MySQL for populating
> links. There will be a dynamically populated menu from the database. The
> users will be uploading files whose links will be added to the database
> through a form.
>
> I have the header, navigation, and footer sections in their own PHP/HTML
> files to be included on page with the <?PHP include
> ("includes/filename.html"); ?>. This part is easy, but I have to create a
> whole new page for each and every web page that includes this code. What I
> need to do is have the basic .html page show up in the content section of
> the current page when a person clicks a link in the navigation menu or
> current page. Essentially I would want it to work like a framed page (<a
> href: "linkedpage.html" target="content">, but I don't want to use frames or
> iframes.
>
> I would also like to have the page that was inserted be reflected as a URL
> in the browser location for bookmarking, as well as have the page title be
> automatically assigned. In my search on the web I find a lot of reference to
> combining PHP and Javascript. I believe I've seen it done with Javascript
> using the GetElementByID method, but it's been a while since I've written
> Javascript.
>
> I'm sure there is a simple basic way to format each link itself in just PHP.
> Should I assign a variable to hold the value of the link? I assume it
> includes having a <div id="content">. Should I format the link or the
> content section with HTTP_REFERRER or use File_Include_Path or does this
> have to do with fopen_wrapper? There are so many different things I've
> seen, but nothing conclusive, that my head is spinning.
>
> Thanks,
>
> Chris
>
>
>
If each page has his own ID/name, then you can use the get "script":
<?
if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
$id = 0;
}
?>
If you use this code, you need to link to a page like: <a
href="?page&id=20">Link</a>
If you want the title to change, just use <title><? echo (&id) ?> That
makes the title change into the ID
The same with link's ;)
Navigation:
[Reply to this message]
|