SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry PHP header(location:...) error

    Ok, I know other people have had this problem before but I cannot find the solution anywhere.

    I have a simple line:
    Code:
    header("Location:h t t p://" . $_SERVER['SERVER_NAME'] . "/" . index.php);
    (Where h t t p doesn't really have spaces in it, this forum just won't let me post it without the spaces....)

    Works fine in Firefox on Mac and PC but will not work in IE7.

    What am I missing? There must be a way to get this working!

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    header("Location: http://".$_SERVER['SERVER_NAME']."/index.php"); 
    my mobile portal
    ghiris.ro

  3. #3
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I posted the wrong code. The actual code is:


    Code:
    header("Location:h t t p://" . $_SERVER['SERVER_NAME'] . "/" . $_POST['next']);
    And it definitely doesn't work!

  4. #4
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    PHP Code:
    ini_set("display_errors"1);
    error_reporting(E_ALL);

    if ( isset(
    $_POST['submit']))
    header("Location: http://" $_SERVER['SERVER_NAME'] . "/" $_POST['next']);
    exit; 
    my mobile portal
    ghiris.ro


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •