Closed Thread
Results 1 to 4 of 4




  

Thread: php redirect stops sql

      
  1. #1
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default php redirect stops sql

    hey guys, for some weird reason the SQL command isn't updating the table, but if I put an echo after the query so it stops the header from running it updates any ideas??

    nothing wrong with the SQL query as if i add echo "." just before the header redirect it updates the table


    PHP Code:
        if ($_POST['action'] == 'accept'){
            
    ## accepting the terms
            
    if ($_POST['accepted'] == "1"){
                
    sqlconnect();
                
    ## accepted the terms update the database and the session
                
    $query "UPDATE admin_users SET terms = '1' WHERE userid = ".quote_smart($_SESSION['admin_userid']);
                
    $sql mysql_query($query) or sqlerrorhandler("(".mysql_errno().") ".mysql_error(), $query$_SERVER['PHP_SELF'], __LINE__);
    //            echo $query;
    //            echo ".";
                
    $_SESSION['admin_terms'] = '1';
                if (
    $sql){ 
                    
    header("Location: ".ADMINURL."adminFrame.php");
                }
                
    //            $redirect = "true";
            
    }
        } 

    doing my head in now
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  2. #2
    Grand Masters Colleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond repute Colleen's Avatar
    Join Date
    September 22, 2006
    Location
    Canada
    Posts
    11,144
    Rep Power
    26
    Feedback Score
    0

    Default

    Did you figure it out yet?

  3. #3
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default

    kind of, rewrote it several times each time it was doing something different, eventuall figured out i was using a !== on the session to check it instead of != lol stupid php bits
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  4. #4
    I'm New! Izzmo is on a distinguished road
    Join Date
    March 12, 2008
    Location
    Kansas City
    Posts
    21
    Rep Power
    5
    Feedback Score
    0

    Default

    Well, what is your output buffering set to?

    If you have your output buffering to release it as it loads, then that's most likely your culprit.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 7
    Last Post: Mar 18th, 2008, 8:21 am
  2. 301 Redirect, how many is to many?
    By JHalstead in forum Programming
    Replies: 3
    Last Post: Feb 7th, 2008, 8:31 pm
  3. redirect in wordpress issue
    By Kaos in forum Blogging
    Replies: 2
    Last Post: Oct 22nd, 2007, 9:27 am
  4. Does redirect affect pagerank?
    By Ohiosweetheart in forum PageRank
    Replies: 22
    Last Post: Jan 25th, 2007, 8:47 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
WebTalkForums
WebTalkForums
Recent Forum Threads