[Solved] Code problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

Post by bla5e »

i already had that.

when i do
echo $email;
on the mailer it doesnt show anything
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

Post 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']."\">");
bla5e
Forum Contributor
Posts: 234
Joined: Tue May 25, 2004 4:28 pm

Post 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>"; 
	} 
?>
Post Reply