SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not much to tell, I've the script below and I get the parse error. Obviously it's looking for something, but doesn't find it. Suggestions are welcome...
    Code:
    <?php
    
    $rightmenu = "noselection.inc";
    
    require("page_header.php");
    
    // Check to see if $PHP_AUTH_USER already contains info 
    if (!isset($PHP_AUTH_USER)) { 
    
    // If empty, send header causing dialog box to appear 
    header('WWW-Authenticate: Basic realm="Authorized Personal Only"'); 
    header('HTTP/1.0 401 Unauthorized'); 
    echo 'Authorization Required.'; 
    exit; 
    } 
    else if (isset($PHP_AUTH_USER)) {
    if (($PHP_AUTH_USER != "admin") || ($PHP_AUTH_PW != "pass")) { 
    header('WWW-Authenticate: Basic realm="Authorized Personal Only"'); 
    header('HTTP/1.0 401 Unauthorized'); 
    echo ("Authorization Required.");
    exit; 
    } 
    else {
    
    include("includes/connect.php");
    
    //if user wants to delete a news article, this code will be executed
    if (isset($delete)) {
    
    $sql = "DELETE FROM news WHERE ID=" . $delete;
    
    if (mysql_query($sql)) {
    echo("<p>The news article has been deleted</p>");
    }
    else {
    echo("<p>Error while attempting to delete the news article: " . mysql_error() . "</p>");
    }
    
    }
    else if (!isset($delete))  {
    
    //let the user return to the news page
    echo("<p>You didn't select an article to delete. Click <a href=\"news.php\">here to go back to the news page</a></p>");
    }
    }
    require("page_footer.php")
    
    ?>
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you are missing a closing parenthesis..

    else if (!isset($delete)) {

    //let the user return to the news page
    echo("<p>You didn't select an article to delete. Click <a href=\"news.php\">here to go back to the news page</a></p>");
    }
    }
    }

    require("page_footer.php")

    ?>

  3. #3
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, it worked

    Thanks for your help, Peter!

    BTW you were only joking when you asked me to give you Karma for this, weren't you?

    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.


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
  •