PHP Code Problem?

Posted on Tuesday 8th May 2007 at 08:37 PM
Diablosblizz
Diablosblizz's Avatar
Hey, I am trying to get the email from the member system I got from here. Heres the code that I am trying (everything up to this works):

PHP Code
  1. case 'send':
  2. $checkuser = $logged[username];
  3. $email = mysql_query("SELECT email FROM members WHERE username = '$checkuser' ORDER BY id DESC") or die (mysql_error());
  4. echo "$email";
  5. break;


I login and everything and I get this:

Resource id #5

Does anybody know what that means?

Thanks!
Posted on Wednesday 9th May 2007 at 03:36 PM
Dean
Dean's Avatar
case send;
$checkuser = $logged[username];
$email = mysql_query("SELECT email FROM members WHERE username = '$checkuser' ORDER BY id DESC") or die (mysql_error());
echo "$email";
break;
Posted on Wednesday 9th May 2007 at 07:20 PM
Diablosblizz
Diablosblizz's Avatar
I got it working thanks to Frihost. But now I have a new error:

https://www.frihost.com/forums/vt-72507.html

Please help :(.
Posted on Wednesday 9th May 2007 at 09:55 PM
DanielXP
DanielXP's Avatar
Are you trying to send a email to every one in the database or just 1?
Posted on Thursday 10th May 2007 at 07:47 PM
Diablosblizz
Diablosblizz's Avatar
Just one, go to the link for current status, Frome is trying to help me.. Its weird.
Posted on Thursday 10th May 2007 at 09:00 PM
SkillMaster
SkillMaster's Avatar
post code up please? might be able to help.
Posted on Thursday 10th May 2007 at 09:09 PM
SkillMaster
SkillMaster's Avatar
Code
case send;
$username = "$_GET[username]";

$fetch = mysql_query("SELECT * FROM members WHERE username = '$username'") or die (mysql_error());
$users = mysql_fetch_array($fetch);

$email = "$users[email]";
$subject = "put subject here";
$emailbody = "WHATEVER YOU WANT TO SEND";
$from = "From: no-reply@YOURSITE.com";

mail("$email", "$subject", "$emailbody", "$from");
echo ("email has been sent.");
break;


Try that. Sorry for double post.
Posted on Thursday 10th May 2007 at 09:16 PM
SkillMaster
SkillMaster's Avatar
Also if you wanted to send their pin it would add:
this-
Code
$email = "$users[email]";
$subject = "Pin Reminder";
$emailbody = "
Username: $username
Email Address: $email
Your Pincode: $pincode n
Your new pincode. n
Thanks, Diablosblizz.
";
$from = "From: no-reply@YOURSITE.com";

to
Code
$email = "$users[email]";
$pincode = "$users[pincode]";
$subject = "Pin Reminder";
$emailbody = "
Username: $username
Email Address: $email
Your Pincode: $pincode n
Your new pincode. n
Thanks, Diablosblizz.
";
$from = "From: no-reply@YOURSITE.com";
Posted on Friday 11th May 2007 at 10:10 PM
Diablosblizz
Diablosblizz's Avatar
I fixed it. Thanks anyways.
Posted on Saturday 12th May 2007 at 02:12 PM
ShadowMage
ShadowMage's Avatar
Issue has been resolved, Thread Locked.
failure i sense
Topic is locked