hoponhiggo Posted June 22, 2011 Share Posted June 22, 2011 Hi Guys I am using a freind request script, part of which is as follows: <? session_start(); //starts session include "includes/db.php"; //include config if ($_SESSION['MM_Username']){ //checks user is logged in if ($_GET[user]){ //gets username $username = htmlspecialchars($_GET[user]); //friend $by = $_SESSION['MM_Username']; //you $query = mysql_query("INSERT INTO `friend_requests` ( `username` , `by` ) VALUES ( '$username' , '$by' )"); //inserts the request echo ( "$username has been sent a friend request. You must now wait for it to be accepted<br> <p><a href='members.php'>Go Back</a></p>" ); //echos completion } else { echo ( "You have no more requests!" ); // or no request sent } } else { echo ( "You need to be logged in" ); //not logged in } ?> I am guessing that the if ($_GET[user]){ //gets username $username = htmlspecialchars($_GET[user]); //friend bit turns the username into a variable? Is there a way i can also extract the 'friends' email address and turn to a variable which i can then use to send mail to? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted June 22, 2011 Share Posted June 22, 2011 It's hard to tell. Since there's no reference to email anywhere in the code, where is it supposed to come from? Quote Link to comment Share on other sites More sharing options...
hoponhiggo Posted June 22, 2011 Author Share Posted June 22, 2011 Thats the bit thats confusing me. There isnt any reference to the email on this page of the script Is there any way to add to some code which would request the email address from the 'users' table? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.