Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 210
0 Users 7 Guests Online
Forum Index » PHP + MySQL » Verify[Help]
Posted on Friday 20th July 2007 at 09:09 AM
gbt91
templates/default/images/noavatar.png's Avatar
Junior Member
I made this code for users who havent been verified...but isn't working...i mean it doesnt send the email.
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?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 "SELECT `email` FROM `members` WHERE `username` = '$Username'";
$code "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 "http://$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)
?>
Posted on Friday 20th July 2007 at 09:10 AM
gbt91
templates/default/images/noavatar.png's Avatar
Junior Member
lool why it doesnt display my username?
Posted on Friday 20th July 2007 at 09:32 AM
gbt91
templates/default/images/noavatar.png's Avatar
Junior Member
i tried to send it to the server but same error..
it gives me back as result resource id
Posted on Friday 20th July 2007 at 03:14 PM
ShadowMage
templates/default/images/noavatar.png's Avatar
Senior Member
did you put the form in to submit it?
Posted on Friday 20th July 2007 at 09:17 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
Do you have the variables defined?
Posted on Saturday 21st July 2007 at 12:22 PM
gbt91
templates/default/images/noavatar.png's Avatar
Junior Member
i put mysql_query( before $email= & $code and it gives me as result :
resource #
lool
Posted on Wednesday 25th July 2007 at 09:10 PM
SkillMaster
templates/default/images/noavatar.png's Avatar
Senior Member
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 = "http://$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
templates/default/images/noavatar.png's Avatar
Senior Member
Did it work?