标头不工作PHP

时间:2013-07-17 18:08:01

标签: php

嘿家伙需要帮助id不明白什么问题。 我做重定向,它不工作。并且脚本看起来很好:

<?php
require_once 'php/db_connect.php';//DB connect
require_once 'php/functions.php';// function

if(!isset($_GET['pid'])){//Getting page id to return to that page
    $page_id = 1;
}

else{
    $page_id = preg_replace('#[^0-9]#i', '', $_GET['pid']);
}

$user = $_POST['user_reg'];
$password = $_POST['pass_reg'];

$result = add_user($user , $password);

if(!$result){
    return false;
}

else{
    header('location:index.php?pid='.$page_id.'');
    die();
}
?>

1 个答案:

答案 0 :(得分:3)

尝试大写Location

http://www.php.net/manual/en/function.header.php#79028

  

标题的第一个元素(即“位置”)区分大小写,具体取决于浏览器。