Grow your CSS skills. Land your dream job.

PHP Header

  • # March 24, 2009 at 6:32 pm

    What I have:
    header(‘Location: index.php’);

    Where its taking me:
    http://localhost/sm/system/forms/index.php
    results in a page not found cause index php is located at http://localhost/sm

    So I’m looking for something like header(‘Location: ../index.php’) to get back to the main directory. Any ideas?

    # March 24, 2009 at 6:44 pm

    Does ../index.php not work?

    # March 24, 2009 at 6:53 pm

    Nope, does make it any difference at all…its still looking in http://localhost/sm/system/index.php

    # March 24, 2009 at 7:00 pm

    Figured it out…I needed one more ../ so I ended up with:
    header(‘Location: ../../index.php’);

    so use one ../ for each directory you want to go back. I could of sworn you only needed one ../ to get back to the main dir, guess not.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".