location??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wj

    location??

    Hi all,

    I want to use 'location' to redirect to link to another page:

    <?php
    header("Locatio n: http://localhost");

    ?>


    works fine, but when i introduce start_session, all i get is a blank page:

    <?php

    session_start() ;

    header("Locatio n: http://localhost");

    ?>

    Can anyone give me a hint, do I need to change my php.ini-file or something
    like that?? I use apache and php 4.3.1, local installed.

    Thanx!!

    WJ



  • Roland Roberts

    #2
    Re: location??

    -----BEGIN PGP SIGNED MESSAGE-----
    [color=blue][color=green][color=darkred]
    >>>>> "wj" == wj <ww@nl.nl> writes:[/color][/color][/color]

    wj> Can anyone give me a hint, do I need to change my php.ini-file
    wj> or something like that?? I use apache and php 4.3.1, local
    wj> installed.

    Your first hint is to look at the HTML source of the blank page.
    session_start() is most likely spitting out _something_.

    Your second hint is to avoid session_start() until as late as you
    possibly can. If you still have to call it before you know whether or
    not you have to redirect, then...

    Your third hint is to look at the ob_* functions (output buffering).
    In particular, you may find ob_start() and ob_end_clean() of use in
    throwing away output...

    regards,

    roland
    - --
    PGP Key ID: 66 BC 3B CD
    Roland B. Roberts, PhD RL Enterprises
    roland@rlenter. com 6818 Madeline Court
    roland@astrofot o.org Brooklyn, NY 11220

    -----BEGIN PGP SIGNATURE-----
    Version: 2.6.3ia
    Charset: noconv
    Comment: Processed by Mailcrypt 3.5.4, an Emacs/PGP interface

    iQCVAwUBPwHl8uo W38lmvDvNAQE2pw P8DSb+LuJgQJiWS qssdQakDrCxlKtH 6Ef8
    Fr3ARlnM3rNmzBv 3lYYTpLB9EKhDYI FtPgGAjcrArCPoo q5rt2qQGlM4UnyB E7IC
    xg0EXn6eUXCtnal ypNQXdRAcLZVXh8 ZrGIVTFLkL3agNt rBLXR5eiDId1BBF PhCx
    9l5kljiA+E0=
    =AB4A
    -----END PGP SIGNATURE-----

    Comment

    Working...