Results 1 to 7 of 7

Thread: Header() Problem - Help Needed

  1. #1

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Header() Problem - Help Needed

    don't know what i'm doing wrong take a look at this code:
    Code:
    <? 
    Header("Location: http://google.com"); 
    ?>
    instead of going to google as stated in the code, it gave me "The Page cannot be displayed" error

    What should i do?
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Header() Problem - Help Needed

    Could be a number fo things, first check that the heaers have not been sent it can sometimes cause problems like this

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  3. #3
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Header() Problem - Help Needed

    I had a problem with something like this a while ago. Try sticking \n \r at the end. Make sure there is a space between them, don't know why but it would only wokr if there was a space between them

    PHP Code:
    <? 
    Header("Location: http://google.com\n \r"); 
    ?>

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Header() Problem - Help Needed

    Quote Originally Posted by john tindell
    I had a problem with something like this a while ago. Try sticking \n \r at the end. Make sure there is a space between them, don't know why but it would only wokr if there was a space between them

    PHP Code:
    <? 
    Header("Location: http://google.com\n \r"); 
    ?>
    Hmm, I never knew you could do that - that should mean you can send multiple statements at once right?


    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  5. #5
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Header() Problem - Help Needed

    But you can call the header function as many times as you need to. Just as long as nothing has been sent to the browser already.

  6. #6
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Header() Problem - Help Needed

    Quote Originally Posted by john tindell
    But you can call the header function as many times as you need to. Just as long as nothing has been sent to the browser already.
    Yes I know but what I mean is I can now use that to finish the headerBuild function I have been working on - I like everything in one place

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Header() Problem - Help Needed

    First, try viewing the page in a nother browser. To see the real error message provided by the web server, turn off friendly HTTP errors messages in the advanced section of Internet Properties.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width