Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Error help

  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    43
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Error help

    I'm getting

    Parse error: syntax error, unexpected T_ECHO in /home/sbdthru/public_html/addgroup.php on line 10
    Really dunno why.
    Any help is appreciated.

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    if(
    $logged[username] && $logged[level] == Admin
    {
    $user mysql_query("SELECT * from stake where username = '$_GET[stake]'"); 
    $user mysql_fetch_array($stake). 
    //these lines get the user's information and put it in an array. 
    //we will display the information in the html form 
    echo("<div align='center'><form method='POST'> 
    <table width='100%'> 

    <tr> 
    <td align='right' width='25%'> 
    <font type='verdana' size='2'>Add New Limit 
    </td> 
    <td align='left'> 
    <input type='text' size='25' maxlength='25' name='stake' 
    value=''></td> 
    </tr> 
    <tr> 
    <td align='center'> 
    </td> 

    <td align='left'> 
    <input type='submit' name='update' value='Submit'></td> 
    </tr> 
    </table> 
    </form> 
    </div>"
    ); 
    //displays the html form 
    }
    else 

    $stake htmlspecialchars($_POST[stake]); 
    // the above lines get rid of all html. 
    echo ("<meta http-equiv='REFRESH' content='1;url=mysite.com/admincp.php'>$_GET[user]'s profile has been updated."); 
    $update mysql_query("location = 'stake = '$stake'"); 
    // updates the information in the database. 
    }
    ?>
    Last edited by SBDTHRU; 03-04-2010 at 01:49 AM.

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    301
    Thanks
    7
    Thanked 2 Times in 2 Posts
    PHP Code:
    $user mysql_fetch_array($stake). 
    Could you have meant?
    PHP Code:
    $user mysql_fetch_array($stake); 
    Matt
    Last edited by MattyUK; 03-04-2010 at 01:40 AM.

  • Users who have thanked MattyUK for this post:

    SBDTHRU (03-04-2010)

  • #3
    Regular Coder
    Join Date
    Jun 2009
    Posts
    278
    Thanks
    78
    Thanked 2 Times in 2 Posts
    PHP Code:
    echo ("<meta http-equiv='REFRESH' content='1;url=http://gator44.hostgator.com/~sbdthru/admincp.php'>$_GET[user]'s profile has been updated.");  
    $update mysql_query("location = 'stake = '$stake'"); 
    For the first line, try this:

    PHP Code:
    echo "<meta http-equiv='REFRESH' content='1;url=http://gator44.hostgator.com/~sbdthru/admincp.php'>$_GET[user]'s profile has been updated."
    and for the second line, I have no idea what your even trying to do there

  • Users who have thanked Ndogg for this post:

    SBDTHRU (03-04-2010)

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Here use this one.

    PHP Code:
    <? 
    ob_start
    (); 
    include(
    "config.php"); 
    if ((
    $logged['username']) && $logged['level'] == 'Admin'
    {
    $user mysql_query("SELECT * from stake where username = '".$_GET['stake']."'"); 
    $user2 mysql_fetch_array($stake); 
    //these lines get the user's information and put it in an array. 
    //we will display the information in the html form 
    echo "<div align='center'><form method='POST'> 
    <table width='100%'> 

    <tr> 
    <td align='right' width='25%'> 
    <font type='verdana' size='2'>Add New Limit 
    </td> 
    <td align='left'> 
    <input type='text' size='25' maxlength='25' name='stake' 
    value=''></td> 
    </tr> 
    <tr> 
    <td align='center'> 
    </td> 

    <td align='left'> 
    <input type='submit' name='update' value='Submit'></td> 
    </tr> 
    </table> 
    </form> 
    </div>"

    //displays the html form 
    }
    else 

    $stake htmlspecialchars($_POST['stake']); 
    // the above lines get rid of all html. 
    echo "<meta http-equiv='REFRESH' content='1;url=mysite.com/admincp.php'>".$_GET['user']."'s profile has been updated."
    $update mysql_query("location = 'stake = '$stake'"); 
    // updates the information in the database. 
    }
    ?>
    But I have no clue what you are trying to do here
    PHP Code:
    $update mysql_query("location = 'stake = '$stake'"); 
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #5
    Regular Coder
    Join Date
    Jun 2009
    Posts
    278
    Thanks
    78
    Thanked 2 Times in 2 Posts
    Lol, You just practically did the same thing I said, except I missed one thing.

  • #6
    New Coder
    Join Date
    Feb 2010
    Posts
    43
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I knew that the last part was wrong. I am trying to get the form to submit the information to the db.


  •  

    Posting Permissions

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