PHP。 $ _GET并切换案例以将URL从一个页面导航到另一个页面

时间:2015-10-24 08:44:31

标签: php

我正在开发一个php基础在线论坛真诚地说我从codecanyon购买了脚本我仍然是php的新手,索引页面包含$ _GET nd switch case,这将有助于导航到其他页面,但其工作继续显示页面没找到。我已经尝试了所有我能帮助我需要你的帮助而不是......

`<?php   
include("includes/db_config.php");    
include("includes/google_config.php");    
include("includes/functions.php");   
include("includes/loaders.php");    

//get web settings    
$web = mysql_fetch_array(mysql_query("SELECT * FROM settings ORDER BY id           
DESC LIMIT 1"));    

//update user online time    
if($_SESSION['usern']) {    
$user_id = userinfo($_SESSION['usern'],"id");    
$online_time = time();    
$update = mysql_query("UPDATE users SET online_time='$online_time' WHERE                     
id='$user_id'");    
}    

//update forum visits    
update_visits();    

load_header();    
$page = protect($_GET['page']);    

}    

switch($page) {    
case "set_password": include("pages/set_password.php"); break;    
case "chat_content": include("pages/chat_content.php"); break;    
case "chat": include("pages/chat.php"); break;   
case "tag": include("pages/tag.php"); break;     
case "forum_sign_in": include("pages/sign_in.php"); break;    
case "forum_sign_up": include("pages/sign_up.php"); break;    
case "forum_lostpassword": include("pages/lostpassword.php"); break;    
case "forum_profile": include("pages/profile.php"); break;     
case "forum_messages": include("pages/messages.php"); break;
case "forum_online_users": include("pages/online_users.php"); break;    
case "forum_adpanel": include("pages/adpanel.php"); break;    
case "view_forum": include("pages/view_forum.php"); break;    
case "view_thread": include("pages/view_thread.php"); break;    
case "post_thread": include("pages/post_thread.php"); break;   
case "post_replie": include("pages/post_replie.php"); break;   
case "post_edit": include("pages/post_edit.php"); break;   
case "post_delete": include("pages/post_delete.php"); break;   
case "post_quote": include("pages/post_quote.php"); break;   
case "post_report": include("pages/post_report.php"); break;    
case "userinfo": include("pages/userinfo.php"); break;     
case "search": include("pages/search.php"); break;    
case "read_message": include("pages/read_message.php"); break;    
case "send_message": include("pages/send_message.php"); break;    
case "reply_message": include("pages/reply_message.php"); break;    
case "delete_message": include("pages/delete_message.php"); break;    
case "panel": include("pages/panel.php"); break;    
case "adpanel_func": include("pages/adpanel_func.php"); break;    
case "forum_logout":     
    unset($_SESSION['usern']);     
    session_destroy();    
    session_unset();    
    $redir = $web['forum_url']."sign_in/";    
    header("Location: $redir");     
    break;    
    default: include("pages/home.php");     
    }    
   load_footer();    
   ?>    

1 个答案:

答案 0 :(得分:0)

首先,您必须使用以下内容调试$ page变量中的内容:

var_dump($page);

并查看当您点击该链接时的值。

注意: 我看到一个支撑&#34;`&#34;在php标签开启之前,删除它