You are here: Re: put contents of linked file into section of document « All PHP « IT news, forums, messages
Re: put contents of linked file into section of document

Posted by Christina on 05/08/06 16:40

Thank you, that makes more sense to me. A couple more questions: What is
the purpose/function of inserting the ".php" into the file exists code?
Does that mean all called/inserted pages will have to be .php? What is
the $linkid variable attached to? I like to understand each part in order
to be able to alter if needed.

Thanks again,

Chris

"MS" <nospamplaesegr8t_ukuk@yahoo.co.uk> wrote in message
news:WKGdndoCFbeU3MLZRVnyhw@bt.com...
> Your basic index.php would be something like the following.
>
> <?php
> require_once "header.php";
>
> // Set Default Page ($pageid)
> if(!isset($pageid) || !file_exists($pageid.".php")) $pageid= "default";
>
>
> if(file_exists($pageid.".php")){
> include $pageid.".php";
> }
>
> require_once "footer.php";
> ?>
>
> where pageid can be "words" or "numbers"
>
> links are created by ....
>
> echo "<a href='?pageid=".$linkid.">Link</a>";
>
> --
> ----------------------------------------------------------------------------
> http://www.myclubweb.co.uk - The Home of Club Websites
> ----------------------------------------------------------------------------
>
>
> "Christina" <designer@centurytel.net> wrote in message
> news:2KydnQNgXqP7LMPZRVn-rQ@centurytel.net...
>> Thank you Rene...would the if/else go in the content section?
>>
>> I guess I'm not clear on how to generate the linking text into propogated
>> menu either. Can you clarify the use of &amp; for me? Is it there to tell
>> the browser that it's an html ampersand? Wouldn't it need to use a
>> variable? (id=$pageid). The links table in the database will have the
>> pageID, pagename, pagetitle, category, subcategory, etc.
>>
>> Thanks again,
>>
>> Chris
>>
>> "Rene Pot" <renepot@chello.nl> wrote in message
>> news:1ab9d$445e83e4$3ec2ab98$8322@news.chello.nl...
>> > 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&amp;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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация