SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My browser gives the error Expecting ENDIF on line 26 with the PHP script below. I have been staring at this code for half an hour now... as far as I can see all if clauses are closed at the end. Maybe someone with a fresh perspective will see the problem? Thanks in advance!

    <HTML>
    <HEAD>
    <TITLE>Administration Area - Users - New user</TITLE>
    </HEAD>
    <BODY>
    <h1>Users Admin: delete user</h1>
    <?
    require("../includes/includes.inc");

    if ($submit):
    $sql = mysql_query("DELETE FROM users WHERE userID='$userID'");
    if ($sql) {
    echo("<P>User deleted.");
    } else {
    echo("<p>Houston, we have a problem. Error: " . mysql_error() );
    }

    else:
    $result = mysql_query("SELECT * FROM users WHERE userID = '$userID'");
    if (!$result) {
    echo("<p>Houston, we have a problem. Error: " . mysql_error() . "</P>");
    exit();
    }
    $row = mysql_fetch_array($result);

    <FORM ACTION="<? echo($PHP_SELF); ?>" METHOD=POST>
    <P>Are you sure you want to delete user <? echo ($row["fname"] . " " . $row["lname"]); ?> ?
    <p>
    <? // <INPUT TYPE=HIDDEN NAME="userID" VALUE="echo $row["userID"]"> ?>
    <INPUT TYPE=SUBMIT NAME="submit" VALUE="YES">
    </FORM>

    <p><A href="usersadmin.php">Back to users admin</a>

    </BODY>
    </HTML>
    <? endif; ?>

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It appears after your $orw = mysql_fetch_array($result); line you start to use regular html without ever closing your ?> end php tag.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EEK!


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
  •