problem in session redirecting - IE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjayis
    New Member
    • Mar 2008
    • 134

    problem in session redirecting - IE

    Hi

    I have created a loginpage in which the user enters their username and password.,
    the page gets loaded and validates the input and then it is redirectesd to the seeeion page using html code.,[code=php]correct code tags usage<?
    if(username and password is correct)
    {
    ?>
    <meta http-equiv="refresh" content="0,url= session.php?use r=<? echo $user;?>" >
    <?
    }
    ?>
    [/code]
    ., this is my code and once again in session page i am redirecting the datas in to another page using the same code.,

    the code works well with firefox but not in IE.

    In IE the same page itself gets loaded again and again.
    the page was not redirected..

    And i had tried even by php redirectin
    [code=php]
    header( 'Location: session.php?use r='.$user ) ;
    [/code]

    but i am responded with the error.,
    "Headers already sent".

    and tried even by giving the full path.,which results in the same errors.


    can anyone help me??


    regards
    vijay
    Last edited by ronverdonk; Apr 12 '08, 11:05 PM. Reason: correct code tags usage
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    the time to reload and url are seperated by a semi colon
    Code:
    content="5; url=somepage.php"

    Comment

    • vjayis
      New Member
      • Mar 2008
      • 134

      #3
      Originally posted by markusn00b
      the time to reload and url are seperated by a semi colon
      Code:
      content="5; url=somepage.php"



      Hi

      thanks for ur help.,
      works well in IE.,

      regards
      vijay

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by vjayis
        Hi

        thanks for ur help.,
        works well in IE.,

        regards
        vijay
        Sweet!

        And, in all honesty, this isn't a php problem - (php runs serverside and has nothing to do with the browser) - so consider this next time 'is my post more relevant to the html forum?'.

        Regards,
        markusn00b.

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by vjayis
          Hi

          I have created a loginpage in which the user enters their username and password.,
          the page gets loaded and validates the input and then it is redirectesd to the seeeion page using html code.,[code=php]correct code tags usage<?
          if(username and password is correct)
          {
          ?>
          <meta http-equiv="refresh" content="0,url= session.php?use r=<? echo $user;?>" >
          <?
          }
          ?>
          [/code]
          ., this is my code and once again in session page i am redirecting the datas in to another page using the same code.,

          the code works well with firefox but not in IE.

          In IE the same page itself gets loaded again and again.
          the page was not redirected..

          And i had tried even by php redirectin
          [code=php]
          header( 'Location: session.php?use r='.$user ) ;
          [/code]

          but i am responded with the error.,
          "Headers already sent".

          and tried even by giving the full path.,which results in the same errors.


          can anyone help me??


          regards
          vijay
          i suggest you use the later redirect (the server side with header("Locatio n: ..."); )

          It is safer.

          The reasion you're getting that code is you're posting something to the page before the line is reach.

          Put that line near the type of the page and make sure the file starts with <?php before anything else.

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by dlite922
            i suggest you use the later redirect (the server side with header("Locatio n: ..."); )

            It is safer.

            The reasion you're getting that code is you're posting something to the page before the line is reach.

            Put that line near the type of the page and make sure the file starts with <?php before anything else.
            I don't believe there's anything safer about either of the approaches.

            A problem with the meta redirects is that the browser may have them disabled - if this is the case you should provide a link stating 'click here if your browser (doesnt support meta redirects | doesnt redirect within 5 seconds)

            A problem with header redirects is you have to be very, very specific with there placement, as dlite said.

            Regards.

            Comment

            • vjayis
              New Member
              • Mar 2008
              • 134

              #7
              Originally posted by markusn00b
              I don't believe there's anything safer about either of the approaches.

              A problem with the meta redirects is that the browser may have them disabled - if this is the case you should provide a link stating 'click here if your browser (doesnt support meta redirects | doesnt redirect within 5 seconds)

              A problem with header redirects is you have to be very, very specific with there placement, as dlite said.

              Regards.


              Hi

              thanks for ur suggestion for both of u.,
              regards

              Comment

              • Markus
                Recognized Expert Expert
                • Jun 2007
                • 6092

                #8
                Originally posted by vjayis
                Hi

                thanks for ur suggestion for both of u.,
                regards
                See you around!

                kind regards

                Comment

                Working...