Results 1 to 3 of 3

Thread: How to write this...

  1. #1
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default How to write this...

    I have a code that checks variables and such and it works great. The problem is I have changed it from the first attempts, and there are some left over bits here and there that I want to remove.

    Currently everything makes sense to me and I have changed most of them. I am stuck on one part though, and I am hoping there is a solution.

    I have this line:

    PHP Code:
    header('Location: http://' $_SERVER['HTTP_HOST'] . $p[$_POST['id']][1] . '?var=' $_POST['var']); 
    Where it does a self check and if everything is good, it goes back to the page it came from.

    The problem is, though that there is no longer a $_GET on the referer page, so I don't need the ?var='.$_POST['var'] part anymore.

    I would like for it NOT to show up in the URL after the page name, but all my attempts to remove this line from the header function have failed.

    How do I write that header so everything is there except the var part?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    um...if I understand you correctly, this should work:

    Code:
     header('Location: http://' . $_SERVER['HTTP_HOST'] . $p[$_POST['id']][1]);
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    I swear I tried that... must have left something in there.. that was it! Thanks!
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •