Question : Add boxes to homepage using PHP & MySQL

I have set up a site and CMS system using PHP and MySQL.

If you view this homepage here:

http://www.diura.info/index.php

You'll see that the homepage currently displays 'news' and 'video'. Though the info is dynamic the actual boxes are static. There are two tables on the page one which reads info from news and the other from video.

I want to setup a function which allows my clients to say what 'boxes' should appear. When a live date comes for example up he'll want to add a 'live' box showing info from the live section. He may also want to remove 'news' if nothing has been updated for a while.

Any ideas how this can be done?

Can i set up separate page that hold a box for one section ie a page with the music box, another page with the video box etc. Then add that box to the homepage with php script?

Answer : Add boxes to homepage using PHP & MySQL

Yeah you are on the right track for sure... here may be a more logical way to do it
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
<?PHP
$query ="select * from user_settings where user_id ='10'";
$result = mysql_query($query);
$row = mysql_fetch_array($result,MYSQL_ASSOC);

if($row['box1'] == 1){
     include "news_box.php";
}
if($row['box2'] == 2){
    include "video_box.php";
}
if($row['box3'] == 3){
    include "music_box.php";
}
if($row['box4'] == 4){
    include "live_box.php";
}
?>
Random Solutions  
 
programming4us programming4us