mssql_fetch_row odbc equivalent?

Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    Pee Aitch Pee Dave is offline
    MemberRank
    Mar 2011 Join Date
    The NetherlandsLocation
    722Posts

    Re: mssql_fetch_row odbc equivalent?

    That's because the redirect function probably contains the header function?
    The header function will only work if there's absolutely no (HTML) output yet.
    Last edited by Dave; 12-08-13 at 04:54 PM.

  2. #17
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: mssql_fetch_row odbc equivalent?

    Quote Originally Posted by Dave View Post
    That's because the redirect function probably contains the header function?
    The header function will only work if there's absolutely no (HTML) output yet.
    Unfortunately, no.
    PHP Code:
        //Alert
        
    function alert($msg){
            echo 
    '<script language="javascript">alert("'.$msg.'");</script>';
        }
        
    //Redirect
        
    function redirect($url){
            echo 
    "<body><script>document.location = '$url'</script></body>";
        } 
    Unless that is the HTML that you're talking about =P

    EDIT: Hmm, using the redirect function instead of the header function redirects me back to the index page, but it doesnt save the sessions.

    There is however HTML in the functions.php since they're part of some of the functions.

    EDIT 2: Hmm, using the same thing in the test pages, I use the header function to redirect me back to testing.php, but no sessions are saved.
    The test.php page shows the correct sessions, but after it redirects, the sessions have not been saved, like they're not even there.

    test.php:
    Array ( [UGradeID] => 255 [user] => wesman2232 )
    testing.php after redirect with header function:
    Array ( [AID] => [PageTitle] => )
    Last edited by wesman2232; 12-08-13 at 05:10 PM.

  3. #18
    Pee Aitch Pee Dave is offline
    MemberRank
    Mar 2011 Join Date
    The NetherlandsLocation
    722Posts

    Re: mssql_fetch_row odbc equivalent?

    I see the header function after the last else.
    And before you call that function, you output HTML.

  4. #19
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: mssql_fetch_row odbc equivalent?

    Quote Originally Posted by Dave View Post
    I see the header function after the last else.
    And before you call that function, you output HTML.
    Alright, I see what you're saying.
    Now I'm not sure if you noticed my edits, but I tried the header function with my test pages.

    Using the same thing in the test pages, I use the header function to redirect me back to testing.php, but no sessions are saved.
    The test.php page shows the correct sessions, but after it redirects, the sessions have not been saved, like they're not even there.

    test.php:
    Array ( [UGradeID] => 255 [user] => wesman2232 )
    testing.php after redirect with header function:
    Array ( [AID] => [PageTitle] => )

  5. #20
    Pee Aitch Pee Dave is offline
    MemberRank
    Mar 2011 Join Date
    The NetherlandsLocation
    722Posts

    Re: mssql_fetch_row odbc equivalent?

    I assume all pages have session_start(); on top? (Before you include other files or call functions.)

  6. #21
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: mssql_fetch_row odbc equivalent?

    Quote Originally Posted by Dave View Post
    I assume all pages have session_start(); on top? (Before you include other files or call functions.)
    Correct. The actual website just includes all the other files which they inherit that session_start();

    On the test pages, I just put session_start(); on top of test.php (the login function) and now it worked when redirected. (Probably cause it wasn't included, but actually called)

    But I can't get this to work on the actual website to save my life.
    Last edited by wesman2232; 12-08-13 at 06:52 PM.

  7. #22
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: mssql_fetch_row odbc equivalent?

    Drop me a PM with Skype or Steam if you want. I can probably debug this in under a minute over TeamViewer while it would take days to do it over the forums.

  8. #23
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: mssql_fetch_row odbc equivalent?

    Quote Originally Posted by Solaire View Post
    Drop me a PM with Skype or Steam if you want. I can probably debug this in under a minute over TeamViewer while it would take days to do it over the forums.
    Would be very appreciated if you could.
    I didnt think it would be so complicated.

    EDIT: Solaire got on my computer using TeamViewer and debugged and cleaned my code in record time, like a minute. It was god damned beautiful.
    Last edited by wesman2232; 12-08-13 at 08:06 PM.



Page 2 of 2 FirstFirst 12

Advertisement