Page 1 of 1

Posted: Thu Jul 12, 2007 2:27 am
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;
    }

Posted: Thu Jul 12, 2007 6:47 am
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.