如何使用get方法在我的用户cp中使用编辑模式

So i have a get method to retrieve info from the url like so

$editmode = $_GET['edit'];

This is where i am having the issues with proper redirects based on variations of these urls

.../usercp.php --> keeps redirecting me then my browser says theres a redirect problem

.../usercp.php?edit= --> does the same as mentioned above

if(!isset($editmode)){
    header('Location: home.php');
}elseif($editmode != 1){
    header('Location: home.php');
}else{
   //Page Content
}

the code is in usercp.php

Try

<?php
$editmode = $_GET['edit'];
if (isset($editmode)===false) {
    header('Location: home.php');
}else if ($editmode != 1){
    header('Location: home.php');
}else{
   //Page Content
}
?>