Whats wrong with this?

Discussion in 'PHP' started by warsome, May 5, 2008.

  1. #1
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Delete Member</title>
    </head>
    <body>
    
    <?php
    include 'config.php';
    echo'
    <form name="delete" method="post" action="deleteprofile.php">
    Username:<br />
    <input type="text" name="Username" value="Username"/><br />
    </post>
    ';
    $do = mysql_query("DELETE FROM Users WHERE Username = '{$_POST['Username']}' LIMIT 1") or die(mysql_error());
    if($do){
    
    echo '<script>alert("Account Deleted.");</script>';
    echo '<script>location.replace("deleteprofile.php");</script>';
    
    exit;
    
    } else {
    
    echo '<script>alert("The account has NOT been closed, there was an error in the processing of this script, you will now be redirected back, please try again.");</script>';
    echo '<script>location.replace("deleteprofile.php");</script>';
    
    ?>
    </body>
    </html>
    PHP:
    I'm getting this error:
    error: syntax error, unexpected $end in /home/sacredwa/public_html/myphp/membershipsystem/deleteprofile.php on line 30
    Code (markup):
    Line 30 is where it says ?>

    What am I doing wrong? :S
     
    warsome, May 5, 2008 IP
  2. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You're missing a bracket for your last else statement?
     
    Altari, May 5, 2008 IP
  3. warsome

    warsome Guest

    Messages:
    500
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh, lol. I never notice when I make those mistakes. Thanks!~
     
    warsome, May 5, 2008 IP