Professional Web Applications Themes

Header won't redirect - PHP Development

This is code that I have in my index that check whether or not SSL is being used when accessing certain pages and if not then it redirects to the same address but with SSL. if ($pagename=="login" || $pagename=="signup" || $pagename=="checkout") { if (!$HTTPS) { //header("Location: https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?pagename=$pagename"); exit; } } This used to work before I upgraded my PHP. Now when I click on a link that matches my SSL checker it just hangs: [url]http://www.routerbitworld.com/index.php?pagename=checkout[/url] If I change the header to redirect to a location without any variable directive like this [url]http://www.routerbitworld.com/index.php[/url] ....works fine. Why can't I send a variable ...

  1. #1

    Default Header won't redirect

    This is code that I have in my index that check whether or not SSL is being
    used when accessing certain pages and if not then it redirects to the same
    address but with SSL.

    if ($pagename=="login" || $pagename=="signup" || $pagename=="checkout") {
    if (!$HTTPS) {
    //header("Location:
    https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?pagename=$pagename");
    exit;
    }
    }

    This used to work before I upgraded my PHP. Now when I click on a link that
    matches my SSL checker it just hangs:

    [url]http://www.routerbitworld.com/index.php?pagename=checkout[/url]

    If I change the header to redirect to a location without any variable
    directive like this

    [url]http://www.routerbitworld.com/index.php[/url]

    ....works fine. Why can't I send a variable this way?

    Thanks,
    Jonathan Duncan
    Jonathan Duncan Guest

  2. #2

    Default Re: Header won't redirect

    Jay, good guess, but wrong! While register_globals does equal off, I am
    using $_GET['pagename'] to assign the value to $pagename before the snippet
    of code that I sent. Sorry I didn't mention that earlier. I tried putting
    the _GET in my header redirection directly, but that didn't help. Any other
    ideas? Anyone else have an idea?

    Thanks,
    Jonathan Duncan


    "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    news:C8F323573C030A448F3E5A2B6FE2070B01AFA83Cneme sis...
    [snip]
    This used to work before I upgraded my PHP.

    [/snip]

    Let me guess, you upgraded without actually reading the README or update
    notes. I am going to guess that register_globals = off in php.ini. You
    can either fix the variables $_GET['pagename'] or turn RG back on.

    Jay Blanchard


    "Jonathan Duncan" <jonathannacnud.com> wrote in message
    news:20030919131219.28954.qmailpb1.pair.com...
    > This is code that I have in my index that check whether or not SSL is
    being
    > used when accessing certain pages and if not then it redirects to the same
    > address but with SSL.
    >
    > if ($pagename=="login" || $pagename=="signup" || $pagename=="checkout") {
    > if (!$HTTPS) {
    > //header("Location:
    >
    https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?pagename=$pagename");
    > exit;
    > }
    > }
    >
    > This used to work before I upgraded my PHP. Now when I click on a link
    that
    > matches my SSL checker it just hangs:
    >
    > [url]http://www.routerbitworld.com/index.php?pagename=checkout[/url]
    >
    > If I change the header to redirect to a location without any variable
    > directive like this
    >
    > [url]http://www.routerbitworld.com/index.php[/url]
    >
    > ...works fine. Why can't I send a variable this way?
    >
    > Thanks,
    > Jonathan Duncan
    Php Guest

  3. #3

    Default Re: [PHP] Re: Header won't redirect

    And what about $_SERVER["HTTPS"], are you using it?

    PHP wrote:
    > Jay, good guess, but wrong! While register_globals does equal off, I am
    > using $_GET['pagename'] to assign the value to $pagename before the snippet
    > of code that I sent. Sorry I didn't mention that earlier. I tried putting
    > the _GET in my header redirection directly, but that didn't help. Any other
    > ideas? Anyone else have an idea?
    >
    > Thanks,
    > Jonathan Duncan
    >
    >
    > "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    > news:C8F323573C030A448F3E5A2B6FE2070B01AFA83Cneme sis...
    > [snip]
    > This used to work before I upgraded my PHP.
    >
    > [/snip]
    >
    > Let me guess, you upgraded without actually reading the README or update
    > notes. I am going to guess that register_globals = off in php.ini. You
    > can either fix the variables $_GET['pagename'] or turn RG back on.
    >
    > Jay Blanchard
    >
    >
    > "Jonathan Duncan" <jonathannacnud.com> wrote in message
    > news:20030919131219.28954.qmailpb1.pair.com...
    >
    >>This is code that I have in my index that check whether or not SSL is
    >
    > being
    >
    >>used when accessing certain pages and if not then it redirects to the same
    >>address but with SSL.
    >>
    >>if ($pagename=="login" || $pagename=="signup" || $pagename=="checkout") {
    >> if (!$HTTPS) {
    >> //header("Location:
    >>
    >
    > https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?pagename=$pagename");
    >
    >> exit;
    >> }
    >> }
    >>
    >>This used to work before I upgraded my PHP. Now when I click on a link
    >
    > that
    >
    >>matches my SSL checker it just hangs:
    >>
    >>[url]http://www.routerbitworld.com/index.php?pagename=checkout[/url]
    >>
    >>If I change the header to redirect to a location without any variable
    >>directive like this
    >>
    >>[url]http://www.routerbitworld.com/index.php[/url]
    >>
    >>...works fine. Why can't I send a variable this way?
    >>
    >>Thanks,
    >>Jonathan Duncan
    >
    >
    Marek Kilimajer Guest

  4. #4

    Default Re: [PHP] Re: Header won't redirect

    Here's an idea... echo each of the values and see what they actually
    contain. While you grab $pagename from $_GET, where are you getting
    $HTTPS? Is it a superglobal too? Maybe it's $_SERVER['HTTPS']

    Cheers,
    Rob.

    On Fri, 2003-09-19 at 10:57, PHP wrote:
    > Jay, good guess, but wrong! While register_globals does equal off, I am
    > using $_GET['pagename'] to assign the value to $pagename before the snippet
    > of code that I sent. Sorry I didn't mention that earlier. I tried putting
    > the _GET in my header redirection directly, but that didn't help. Any other
    > ideas? Anyone else have an idea?
    >
    > Thanks,
    > Jonathan Duncan
    >
    >
    > "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    > news:C8F323573C030A448F3E5A2B6FE2070B01AFA83Cneme sis...
    > [snip]
    > This used to work before I upgraded my PHP.
    >
    > [/snip]
    >
    > Let me guess, you upgraded without actually reading the README or update
    > notes. I am going to guess that register_globals = off in php.ini. You
    > can either fix the variables $_GET['pagename'] or turn RG back on.
    >
    > Jay Blanchard
    >
    >
    > "Jonathan Duncan" <jonathannacnud.com> wrote in message
    > news:20030919131219.28954.qmailpb1.pair.com...
    > > This is code that I have in my index that check whether or not SSL is
    > being
    > > used when accessing certain pages and if not then it redirects to the same
    > > address but with SSL.
    > >
    > > if ($pagename=="login" || $pagename=="signup" || $pagename=="checkout") {
    > > if (!$HTTPS) {
    > > //header("Location:
    > >
    > https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?pagename=$pagename");
    > > exit;
    > > }
    > > }
    > >
    > > This used to work before I upgraded my PHP. Now when I click on a link
    > that
    > > matches my SSL checker it just hangs:
    > >
    > > [url]http://www.routerbitworld.com/index.php?pagename=checkout[/url]
    > >
    > > If I change the header to redirect to a location without any variable
    > > directive like this
    > >
    > > [url]http://www.routerbitworld.com/index.php[/url]
    > >
    > > ...works fine. Why can't I send a variable this way?
    > >
    > > Thanks,
    > > Jonathan Duncan
    >
    > --
    > PHP General Mailing List ([url]http://www.php.net/[/url])
    > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    >
    >
    --
    ..------------------------------------------------------------.
    | InterJinn Application Framework - [url]http://www.interjinn.com[/url] |
    :------------------------------------------------------------:
    | An application and templating framework for PHP. Boasting |
    | a powerful, scalable system for accessing system services |
    | such as forms, properties, sessions, and caches. InterJinn |
    | also provides an extremely flexible architecture for |
    | creating re-usable components quickly and easily. |
    `------------------------------------------------------------'
    Robert Cummings Guest

  5. #5

    Default Re: [PHP] Re: Header won't redirect

    Marek and Rob,

    Doh! That was it. I am still finding things that I used to assign
    globally. It is a good thing, but it makes for a bit of work. Thanks to
    Jay too. I appreciate everyone's help.

    Have a good one,
    Jonathan Duncan



    "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
    news:3F6B1FC7.70805webglobe.sk...
    > And what about $_SERVER["HTTPS"], are you using it?
    >
    > PHP wrote:
    >
    > > Jay, good guess, but wrong! While register_globals does equal off, I am
    > > using $_GET['pagename'] to assign the value to $pagename before the
    snippet
    > > of code that I sent. Sorry I didn't mention that earlier. I tried
    putting
    > > the _GET in my header redirection directly, but that didn't help. Any
    other
    > > ideas? Anyone else have an idea?
    > >
    > > Thanks,
    > > Jonathan Duncan
    > >
    > >
    > > "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
    > > news:C8F323573C030A448F3E5A2B6FE2070B01AFA83Cneme sis...
    > > [snip]
    > > This used to work before I upgraded my PHP.
    > >
    > > [/snip]
    > >
    > > Let me guess, you upgraded without actually reading the README or update
    > > notes. I am going to guess that register_globals = off in php.ini. You
    > > can either fix the variables $_GET['pagename'] or turn RG back on.
    > >
    > > Jay Blanchard
    > >
    > >
    > > "Jonathan Duncan" <jonathannacnud.com> wrote in message
    > > news:20030919131219.28954.qmailpb1.pair.com...
    > >
    > >>This is code that I have in my index that check whether or not SSL is
    > >
    > > being
    > >
    > >>used when accessing certain pages and if not then it redirects to the
    same
    > >>address but with SSL.
    > >>
    > >>if ($pagename=="login" || $pagename=="signup" || $pagename=="checkout")
    {
    > >> if (!$HTTPS) {
    > >> //header("Location:
    > >>
    > >
    > >
    https://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?pagename=$pagename");
    > >
    > >> exit;
    > >> }
    > >> }
    > >>
    > >>This used to work before I upgraded my PHP. Now when I click on a link
    > >
    > > that
    > >
    > >>matches my SSL checker it just hangs:
    > >>
    > >>[url]http://www.routerbitworld.com/index.php?pagename=checkout[/url]
    > >>
    > >>If I change the header to redirect to a location without any variable
    > >>directive like this
    > >>
    > >>[url]http://www.routerbitworld.com/index.php[/url]
    > >>
    > >>...works fine. Why can't I send a variable this way?
    > >>
    > >>Thanks,
    > >>Jonathan Duncan
    > >
    > >
    Jonathan Duncan Guest

Similar Threads

  1. Location header - slow redirect
    By Admin in forum PHP Development
    Replies: 3
    Last Post: July 13th, 03:47 PM
  2. Cannot verify connection - PHP header redirect
    By soetes in forum Macromedia Contribute Connection Administrtion
    Replies: 1
    Last Post: December 15th, 01:42 PM
  3. [PHP] Header won't redirect
    By Jay Blanchard in forum PHP Development
    Replies: 3
    Last Post: September 19th, 08:26 PM
  4. [PHP] Header won't redirect
    By Jay Blanchard in forum PHP Development
    Replies: 3
    Last Post: September 19th, 05:08 PM
  5. [PHP] Header won't redirect
    By Jay Blanchard in forum PHP Development
    Replies: 0
    Last Post: September 19th, 01:17 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139