Hi,
I am building a site that runs from a MySQL database, via PHP. This is my first PHP project, so please bear with me.
I have several pages, home, profile, studio etc. When I click on a link to home, the link reads "index.php?page=home", or for profile page I link to "index.php?page=profile". Simple enough.
Now I have a function that reads what page we are on, and hopefully returns the data for that page. It works fine for home, but no other pages... I can't figure it out.
function get_Page_Data ($page) {
$page_img_details=get_Page_Img_Details($page_img);
switch ($page) {
case "home":$page_data[0]=$page_img_details["page_title"];
$page_data[1]=$page_img_details["page_title_img"];
$page_data[2]=$page_img_details["page_img_filename01"];
$page_data[3]=$page_img_details["page_text_title01"];
$page_data[4]=$page_img_details["page_text01"];
break;
case "profile":$page_data[0]=$page_img_details["page_title"];
$page_data[1]=$page_img_details["page_title_img"];
$page_data[2]=$page_img_details["page_img_filename01"];
$page_data[3]=$page_img_details["page_text_title01"];
$page_data[4]=$page_img_details["page_text01"];
break;
}
return $page_data;
} // End function get_Page_Data
So, why does it only display data for Home and not for Profile etc? The PHP I am using to read this info in the index.php file is:
<? echo $page_data[3]; ?>
Can anyone help me please?
Thanks,