3 questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Blondy
Forum Commoner
Posts: 32
Joined: Thu Mar 06, 2008 5:55 pm

3 questions

Post by Blondy »

hi guys
I'm new to this forum and I was looking for One to solve my problems on coding
I have 4 questions any help will be regarded

1.I have a mysql db and I have some news on it with (id INT NOT NULL AUTO_INCREMENT,) I want to show headlines on a page limited, I mean for example 20 headlines per page how I can do this?
(I used limit 1,30 command on mysql query but it just give 2 headlines!?!)

2.how I can open a small window while clicking on a page I tried many but they all give me another maximized page

3.Is the below code secure?

Code: Select all

require("sec.php"); //including user pass
if(!$PHP_AUTH_USER || !$PHP_AUTH_PW){
    header("WWW-Authenticate: Basic Realm=\"news Admin\"");
    header("HTTP/1.0 401 Unauthorized");
    $title = "Authorization Required";
    include("header.php");
    echo "      Authorization is required.";
    include("footer.php");
    exit;
}
else{
    if($PHP_AUTH_USER != $admin && $PHP_AUTH_PW != $pass){ # Set your username and password here
        $title = "Incorrect Login";
        include("header.php");
        echo "      Incorrect Login.";
        include("footer.php");
        exit;
    }
}
On each page to be secured I require or include this code.
with thanks
Sarah
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: 3 questions

Post by Christopher »

1. Use the "LIMIT 20" syntax in SQL.

2. Look into Javascript window.open()

3. Don't know
(#10850)
Post Reply