| | |
ok what have i done wrong :(
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2007
Posts: 4
Reputation:
Solved Threads: 0
Just wondered if anyone could help me, what am i doing wrong here im trying to cant seem to get $email, $betakey or $userid to show any data i know im missing something but for teh life of me cant think tried everything i could think of fetch etc but to no avail please help
and the email i recieve (when i add my own email addy in $sendto) looks like this:
Congratulations testbeta, You have been selected to beta test GAME NAME.
Click To Activate Your Beta Account: http://www.gameurl.com/betaactivate.php?id=&code=
Beta Information:
Username: testbeta
Beta Key:
Hope You Enjoy
GAME NAME Staff.
This is an automated response, please do not reply!
php Syntax (Toggle Plain Text)
<? session_start(); include "includes/db_connect.php"; $accepted=$_POST['accepted']; { mysql_query("UPDATE users SET accepted='yes' WHERE username='$accepted'"); mysql_query("SELECT * FROM users WHERE username='$accepted' AND betakey='$betakey' AND id='$userid' AND email='$email'"); $sendto = "$email"; $subject = "You've Been Accepted"; $message = "Congratulations $accepted, You have been selected to beta test GAME NAME. Click To Activate Your Beta Account: http://www.gameurl.com/betaactivate.php?id=$userid&code=$betakey Beta Information: Username: $accepted Beta Key: $betakey Hope You Enjoy GAME NAME Staff. This is an automated response, please do not reply!"; mail($sendto, $subject, $message, "From: GAME NAME<admin@gamename.com>"); print "You made $accepted a beta tester "; } ?>
and the email i recieve (when i add my own email addy in $sendto) looks like this:
Congratulations testbeta, You have been selected to beta test GAME NAME.
Click To Activate Your Beta Account: http://www.gameurl.com/betaactivate.php?id=&code=
Beta Information:
Username: testbeta
Beta Key:
Hope You Enjoy
GAME NAME Staff.
This is an automated response, please do not reply!
Last edited by blackpheonix; Feb 11th, 2007 at 12:18 am.
•
•
Join Date: Feb 2007
Posts: 4
Reputation:
Solved Threads: 0
basicaly i want ppl to sign up for beta testing and then i want to be able to accept ppl individualy so the first part works fine it adds there email,userid and username to the database and also adds a random number to the betakey field and then sends me an email saying username has requested to be a beta tester that works all fine, then i go into my admin panel and select ppl from my email ie username qwerty wants to be a beta tester so i add qwerty in the form click submit now what i want to do is send qwerty an email (using the email already in the database) containing his/ her username their userid and there unique beta registration key. hope that makes sense
•
•
Join Date: Jan 2007
Posts: 37
Reputation:
Solved Threads: 3
Yes, but what I was saying is that based from your script you are trying to use variables for which their variables have not been set, meaning they have null or empty values. Now, judging from your script you can try changing:
to:
Try it out and let me know if it still doesn't work
mysql_query("SELECT * FROM users WHERE username='$accepted' AND betakey='$betakey' AND id='$userid' AND email='$email'");
to:
$result = mysql_query("SELECT * FROM users WHERE username='$accepted'"); $record = mysql_fetch_array($result, MYSQL_ASSOC); if (!empty($record)) { $betakey = $record['betakey']; $userid = $record['userid']; $email = $record['email']; } else { // Insert error handler/User notification that sending of email has failed }
Try it out and let me know if it still doesn't work
![]() |
Similar Threads
- My CD-RW plays but won't burn. What could be wrong?? Help Please? (Storage)
- Retrieve email I sent to the wrong person (Web Browsers)
- Ram voltage wrong?? (Motherboards, CPUs and RAM)
- Am I going about this the wrong way (IT Professionals' Lounge)
- wats wrong with imesh??? (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: Urgent help needed > uploading video files
- Next Thread: Query class problem
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms snippet soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube





