Jump to content

Cant get confirmation script to work!


MrKaraokeSteve

Recommended Posts

Hi, I am having issues with this script..  When a user registered on my site they are sent an email with the following:

 

http://www.sitename.com/user_activate.php?ConfirmNumber=1234567890123456789 (20 digit random #)

 

I am trying to do several differnt things with the script

1. check to make sure username and password are entered

2. check to make sure username and password are correct

3. check to make sure the "ConfirmNumber" matches the "ConfirmNumber" that is in the users db

4. check to make sure account is not already activated

 

 

 

<?php
include ('top.php');
if(isset($_POST['submit']))
{
        $user = $_POST['user'];
        $pass = base64_encode($_POST['pass']);
        if((!$_POST['user']) || (!$_POST['pass']))
        {
                 echo "Sorry you didnt enter an username or password, please got back and try again";
        }
        else
        {
                $jap_data = mysql_query("SELECT pass, active, ConfirmNumber FROM users WHERE addicted_id='$user'") or die(mysql_error());
                $jap_output = mysql_fetch_array($jap_data);
                if($pass != $jap_output['pass'])
                {
                        echo "The password you entered was incorrect, please go back and try again";
                }
                else
                {
                        if($jap_output['active'] != 0)
                        {
                                echo "It appears that you have already confirmed your account!";
                        }
                        else
                        {
                                if($ConfirmNumber != $jap_output['ConfirmNumber'])
                                {
                                        echo "Check your username and make sure you are entering the correct username";
                                }
                                else
                                {
                                        $Venue_ID = $_GET['Venue_ID'];
                                        mysql_query("UPDATE users SET Active='1' WHERE ConfirmNumber='$ConfirmNumber'") or die(mysql_error());
                                        echo 'Your Account has been confirmed!';
                                }
                        }
                }
        }
} else {
?>

<p><center>Please enter your username and password that you just signed up for to confirm your account </center></p>
<form action="user_activate.php?ConfirmNumber=<?php echo $_GET['ConfirmNumber']; ?>" method="POST">  
<table cellpadding="2" cellspacing="2" width="69%" style="font-size: 12px; ">       
<tr>
<td colspan="3" class="h"><div align="center"><strong>Username and Password </strong></div></td>
</tr>
<tr>
<td class="h"><a href="" onMouseOver="return escape(' This is the hint ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td>        
<td class="h"><div align="left">UserName</div></td>      
<td><input name="user" type="text" /></td>       
</tr>       
<tr>     
    <td class="h"><a href="" onMouseOver="return escape(' This is the hint ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td>    <td class="h"><div align="left">Password</div></td>     
    <td><input name="pass" type="password" /></td>       
</tr>       
<tr>          
  <td>   </td>      
  <td><center><input type="submit" name="submit" value="Confirm"> </center></td>         
   <td>   </td>       
</tr>
</table>
</form>

<?php
}
include("bottom.php"); 
?>

Link to comment
https://forums.phpfreaks.com/topic/61214-cant-get-confirmation-script-to-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.