[Solved] Code problem
Posted: Tue Aug 09, 2005 10:07 am
The Function:
The 'Yes' Page/code: * This is the part that wont display *
The Action Page for Yes:
I dont get any errors, but the First 'Yes' page wont display itself... I posted 'Yes' page2 incase someone wants to see if there is any errors in that page cuz im not able to debug it until the First yes page works.
Please help!! ive been workin on this for 30min and still cant get any results!
Thanks
Code: Select all
<?php
echo ("<td width=20%> <a href=\"view.php?yes=".$data['id']."\">YES</a> / <a href=\"view.php?id=".$data['id']."\">NO</a></td>");
?>Code: Select all
<?php
if ("yes" == "".$_GET['id']."") {
$con = mysql_connect($server, $user, $password) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db($database);
echo mysql_error();
$sql = "SELECT * FROM `join` where `id` = '".$_GET['id']."'";
$result = mysql_query($sql, $con) or die(mysql_error());
echo mysql_error();
while ($data = mysql_fetch_assoc($result)) {
echo ("<br>");
echo ("<form method=\"post\" action=\"yesp2=".$_GET['id']."");
echo ("<input name=\"email\" type=\"text\" value=\"".$data['email']."\" disabled> ");
echo ("<textarea col=25 rows=20 name=mail>");
echo ("<input type=submit name=submit value=Add>");
echo ("</form");
}
}
?>The Action Page for Yes:
Code: Select all
<?php
if ("yesp2" == "".$_GET['id']."") {
$con = mysql_connect($server, $user, $password) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db($database);
echo mysql_error();
$del = "DELETE FROM `join` WHERE `id` = '".$_GET['id']."'";
$sql1 = "SELECT * FROM `join` where `id` = '".$_GET['id']."'";
$result = mysql_query($sql1, $con) or die(mysql_error());
echo mysql_error();
while ($data = mysql_fetch_assoc($result)) {
$mail = $_POST['mail'];
$AdminMessage .= $mail;
mail("".$data['email']."", "Team Exile", $AdminMessage, "From: join@teamexileonline.com");
}
mysql_query($del, $con) or die(mysql_error());
echo mysql_error();
echo ("<br>Deleted from Requests & Sent mail to user for acceptance.");
}
?>I dont get any errors, but the First 'Yes' page wont display itself... I posted 'Yes' page2 incase someone wants to see if there is any errors in that page cuz im not able to debug it until the First yes page works.
Please help!! ive been workin on this for 30min and still cant get any results!
Thanks