Jump to content

Recommended Posts

<?PHP
$username=$_POST['username'];
$activate=$_POST['activate'];

require('../inc/config.php'); 
$linkid = @mysql_connect("$db_host", "$db_uname", "$db_pass");
mysql_select_db("$db_name", $linkid);


$query = "SELECT * FROM nxg_tempmbr WHERE username='$username'";
$result = mysql_query($query) or die("$query does not make any sence;<br>" . mysql_error());
$name_exists = mysql_num_rows($result);
echo $result['activate']."1";
echo $activate;
if ($name_exists == 0) 
{
echo "No such user exists.";
}
else
{
if ($activate == $result['activate'])
{
echo "Correct Code!";
}
else
{
echo "Incorrect activation code.";
}



}



?>

 

The code is rather simple right now.  Check the username, if its it there then it gets the code and checks to see if the code is valid.  It gets past the username part no problem, that works fine, checked if it passes or fails it works.  It echos the variables from the previous form no problem, it checks against the database no problem, but when i try to echo or match up with from the database mainly the activate code it doesn't work and the spelling is all correct.  Any ideas?

Try this

 

<?php
$username=$_POST['username'];
$activate=$_POST['activate'];

require('../inc/config.php'); 
$linkid = @mysql_connect("$db_host", "$db_uname", "$db_pass");
mysql_select_db("$db_name", $linkid);

$result=mysql_query("SELECT activate FROM nxg_tempmbr WHERE username='$username'") or die("$query does not make any sence;<br>" . mysql_error());
if (mysql_num_rows($result)==0){ 
echo "No such user exists.";
}
else{
$result=mysql_fetch_array($result);
if ($activate == $result[0]){
	echo "Correct Code!";
}
else{
	echo 'ERROR--Does '.$result[0].' = '.$activate.'?<br>';
}
}
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.