Rename your thread wasir

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
wasir
Forum Commoner
Posts: 49
Joined: Sun Jul 08, 2007 11:28 pm

Post by wasir »

I am new to PHP (so I might be wrong). I am using a trick... I am using html form with 'page name' option, which is added to users table.

Please let me know anyone if thats not the correct way.

Code: Select all

if (!$result = @mysqli_query($link, 'SELECT * FROM users WHERE `username`=\'' . $user . '\' AND `password`=sha1(\'' . $pass . '\')')) {
        echo getHeader();
        echo '<div id=centreall><p>Error: ' . mysqli_error($link) . '.</p></div>';
        echo getFooter();
        exit;
    } 

    $row_cnt = mysqli_num_rows($result);

    if ($row_cnt >0) {
        while ($row = mysqli_fetch_assoc($result)) {
            $link=$row['link']; 
        }
        $_SESSION['valid_user'] = $user;
        $_SESSION['group'] = $link;
        header ('location:' . $link . '.php5');
        exit;
    }
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

This thread has been split from here. We're not fond of thread hijacking.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2.1. When asking a question, be as specific as you can be, provide the relevant code and any other information that is helpful in a concise and coherent manner. If you are not sure how to do that, read these guidelines.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Post Reply