[英]PHP Referal Error
我正在嘗試制作一個php refferall系統,下面是我目前的一些代碼。 但是當我轉到url時說找不到頁面? 有辦法避免這種情況。
<?php
if (substr($_GET['page'], 0, 9) === 'referall/')
{
//Heres where it says page not found
$ref = substr( $url, strrpos( $_GET['page'], '/' )+1 );
//So i go to say http://example.com/referall/Me and it says not found
//The get ['page'] is the / of the website like http://example.com/index
}
switch ($_GET['page'])
{
case "login": { //Index page }
}
?>
如果要實現此目標,則不能以以下方式使用URL:
example.com/referall/Me
因為GET參數沒有傳遞到您的代碼,而是使用以下URL:
example.com?page=referall&person=Me
它應該工作。
如果您仍然想以您想像的方式進行操作,請考慮使用一些可以使您更輕松地完成工作的框架,其中有很多,我個人建議使用Codeigniter
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.