Verify[Help]

Posted on Friday 20th July 2007 at 09:09 AM
gbt91
gbt91's Avatar
I made this code for users who havent been verified...but isn't working...i mean it doesnt send the email.
PHP Code
  1. <?PHP
  2. include('config.php');
  3. /*
  4. Forgot Password script
  5. */
  6. if ($_POST['Submit']) //Proceed if the submit button was pressed.
  7. {
  8. $Username = htmlspecialchars($_POST['username']); //Variable that contains the posted username.
  9. $user=mysql_query("SELECT * FROM `verification` WHERE `username` = '$Username'");
  10. $email = "SELECT `email` FROM `members` WHERE `username` = '$Username'";
  11. $code = "SELECT `code` FROM `verification` WHERE `username` = '$Username'";
  12. //counts the number of rows
  13. $user = mysql_num_rows($user);
  14. if (empty($Username)) //If the username field was left empty exit the script(with reason).
  15. {
  16. die("Insert Username");
  17. }
  18. if ($user == 0)
  19. {
  20. die("Already Done!");
  21. }
  22. $link = "https://$host$self?verify&code=$code";
  23. mail($destinatari, $oggetto, $messaggio, $intestazioni);
  24. //message sent now lets tell them to check there email
  25. echo "Sent";
  26. } else {
  27. //Display the form(HTML)
  28. ?>
That's Just The Drill
Posted on Friday 20th July 2007 at 09:10 AM
gbt91
gbt91's Avatar
lool why it doesnt display my username?
That's Just The Drill
Posted on Friday 20th July 2007 at 09:32 AM
gbt91
gbt91's Avatar
i tried to send it to the server but same error..
it gives me back as result resource id
That's Just The Drill
Posted on Friday 20th July 2007 at 03:14 PM
ShadowMage
ShadowMage's Avatar
did you put the form in to submit it?
failure i sense
Posted on Friday 20th July 2007 at 09:17 PM
SkillMaster
SkillMaster's Avatar
Do you have the variables defined?
Posted on Saturday 21st July 2007 at 12:22 PM
gbt91
gbt91's Avatar
i put mysql_query( before $email= & $code and it gives me as result :
resource #
lool
That's Just The Drill
Posted on Wednesday 25th July 2007 at 09:10 PM
SkillMaster
SkillMaster's Avatar
Code
<?PHP
include('config.php');
/*
Forgot Password script
*/
if ($_POST['Submit']) //Proceed if the submit button was pressed.
{
$Username = htmlspecialchars($_POST['username']); //Variable that contains the posted username.
$user = mysql_query("SELECT * FROM `verification` WHERE `username` = '$Username'");
$email = mysql_query("SELECT `email` FROM `members` WHERE `username` = '$Username'");
$code = mysql_query("SELECT `code` FROM `verification` WHERE `username` = '$Username'");
//counts the number of rows
$user = mysql_num_rows($user);
if (empty($Username)) //If the username field was left empty exit the script(with reason).
{
die("Insert Username");
}
if ($user == 0)
{
die("Already Done!");
}
$link = "https://$host$self?verify&code=$code";
mail($destinatari, $oggetto, $messaggio, $intestazioni);
//message sent now lets tell them to check there email
echo "Sent";
} else {
//Display the form(HTML)
?>

you didn't put mysql_query(""); after $email and $code
Posted on Friday 27th July 2007 at 08:54 PM
SkillMaster
SkillMaster's Avatar
Did it work?
Login or register to respond to this forum topic.