Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42326

php question

$
0
0
Hey,

was wondering if anyone can help me please.

I'm trying to get my table to update but it keeps saying Your username and password are invalid

I cant see where the problem is.?

PHP Code:

<?php $title "MBAPPZ.com - Activate Your account"?>

<?php require("styles/top.php"); ?>
   
    <div id='full'>
    <?php
    
    $getcode 
$_GET['code'];
    
    
$form "<form action='activate.php' method='post'>
    <table>
    <tr>
        <td>Activate Code:</td>
        <td><input type='text' name='code' value='
$getcode' size='35'></td>
    </tr>
    <tr>
        <td>Username:</td>
        <td><input type='text' name='username' size='35'></td>
    </tr>
    <tr>
        <td>Password:</td>
        <td><input type='password' name='password'size='35'></td>
    </tr>
    <tr>
        <td></td>
        <td><input type='submit' name='submitbtn' value='Activate' class='button'></td>
    </tr>
    </table>
    </form>"
;

    if (
$_POST['submitbtn']){
        
$code strip_tags($_POST['code']);
        
$username strip_tags($_POST['username']);
        
$password strip_tags($_POST['password']);
        
        if (
$code && $username && $password){
            if (
strlen($code) == 25) {
                
                
$pass md5(md5($password));
                require(
"scripts/connect.php");
                
$query mysql_query("SELECT * FROM users WHERE username='$username' And password='$pass'");
                
$numrows mysql_num_rows($query);
                if (
$numrows == ) {
                    
                    
$row mysql_fetch_assoc($query);
                    
$dbcode $row['code'];
                    
                    if (
$code == $dbcode){
                        
mysql_query("UPDATE users SET active='1' WHERE username='$username'");
                        
                        echo 
"Your account has been activated.  You may now login. <a href='login.php'> Click here to login</a>.  ";
                    }
                    else
                        echo 
"Your activation code was incorrect. $form";    
                }
                else
                    echo 
"Your username and password are invalid. $form";
            }
            else
                echo 
"You have not supplied a valid code. $form";
        }
        else
            echo 
"You did not fill in the entire form. $form";
                
    }
    else
        echo 
"$form";
    
    
    
?>
    </div>
    
<?php require("styles/bottom.php"); ?>


Viewing all articles
Browse latest Browse all 42326


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>