Page 3 of 3

Posted: Tue Aug 09, 2005 11:34 am
by bla5e
i already had that.

when i do
echo $email;
on the mailer it doesnt show anything

Posted: Tue Aug 09, 2005 11:37 am
by s.dot
that's because your form isn't being passed to a page

Code: Select all

echo ("<form method=\"post\" action=\"".$_SERVER['php_self']."?yesp2=".$_GET['yes']."");
You said you already had that.... but I didn't see it in your code :P

Posted: Tue Aug 09, 2005 11:37 am
by bla5e
ok i got it to work..
it wouldnt work cuz i had the email value disabled becuase i didnt want it edited.. but instead i just made it a hidden value:

Code: Select all

echo ("<input type=\"hidden\" name=\"email\" value=\"".$data['email']."\">");

Posted: Tue Aug 09, 2005 11:39 am
by bla5e
ok everything works! thanks for all the help guys!
heres the final code:

Code: Select all

<?php
	if($_GET['yes']) { 
    $con = mysql_connect($server, $user, $password); 
    mysql_select_db($database, $con); 
    $result = mysql_query("SELECT * FROM `join` where `id` = '".$_GET['yes']."'"); 
    while($data = mysql_fetch_assoc($result))     { 
        echo ("<br>"); 
        echo ("<form method=\"post\" action=\"view.php?yesp2=".$_GET['yes']."\">"); 
        echo ("<textarea cols=90 rows=15 name=mail> </textarea><br>");
        echo ("<input type=\"hidden\" name=\"email\" value=\"".$data['email']."\">");
        echo ("<input type=submit name=submit value=Add>"); 
        echo ("</form>"); 
    } 
	} 

	if($_GET['yesp2']) { 
    $con = mysql_connect($server, $user, $password); 
    mysql_select_db($database, $con); 
    $email = $_POST['email'];
    $mail = $_POST['mail']; 
    $AdminMessage = $mail; 
    mail($email, "Team Exile", $AdminMessage, "From: join@teamexileonline.com"); 
    mysql_query("DELETE FROM `join` WHERE `id` = '".$_GET['yesp2']."'"); 
    echo ("<br>Deleted from Requests & Sent mail to user for acceptance.<br>Email sent to:"); 
    echo $email; 
	echo "<BR>Containg the message:"; 
	echo $AdminMessage; 
	echo "<BR>"; 
	} 
?>