You are here: Re: Loading a division problem « PHP Language « IT news, forums, messages
Re: Loading a division problem

Posted by Olaf Schinkel on 01/06/08 13:05

richard schrieb:
> On Sat, 05 Jan 2008 14:11:39 +0100, Olaf Schinkel
> <blablabla@bluxxxxxxxx.de> wrote:
>
>> richard schrieb:
>>> http://oldies.littleworldofours.com/home.html
>>>
>>> I was thinking that I might be able to work on a simple script perhaps
>>> with "select case" so that I could load the center division when a
>>> link is clicked on.
>>>
>>> Would that be feasible? Any examples out there?
>> Two ways.
>> First:
>> Reloading the page
>> Second:
>> Javascript
>>
>> To First:
>> Every link looks like that:
>> index.php?item={number of id in database}
>> then fill the DIV in the middle with the result of the database content.
>>
>> To second:
>> a) You load all possible pages in JS Arrays an the item has an ONCLICK
>> handler.
>> This handler changes the content of the DIV
>> b) You make an XHTMLREQUEST (ajax) and request the data and than change
>> the content of the DIV.
>>
>>
>> Olaf
>
> Ok got a website that would show the scripts?
No.
I can programm that without an example :-)


Which method do you prefer?
First is good, when you don´t trust JS on the client.


So that: (the name of the fiel is index.php)


if (isset($_POST['item'])
{
// DO THE SQL STUFF an put it into $result
}
else
{
$result = "Empty page";
// or get the startpage from the database
}


// output your menu here like
// <a href="index.php?item=1">menuitemname</a>
// etc

// output your content here
echo "<div class="mycontent">$result</div>";


Thats all

Olaf

 

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

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