i seam to not get it to work with this form i made..
what have i missed
i send veribals in the url an thay are there sow you knOw!
delete-childetopic.php
<?php
require( './functions.php');
$redirect_childetopicID = $_GET['childetopicID'];
$redirect_maintopicID=$_GET["maintopicID"];
$mainpostID=$_GET["mainpostID"];
$childetopicID=$_GET["childetopicID"];
$action=$_POST["action"];
$username=$_POST["username"];
$password=$_POST["password"];
$post=$_POST["post"];
if ($action == "delete_two") {
$post_query = mysql_query("SELECT * FROM childetopics WHERE (ID='$childetopicID' AND username='$username' AND password='$password')") or die (mysql_error());
if (mysql_num_rows($post_query) != 1) {
?>
<br><p><center><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica">That Name/Pass combo is not correct, or the post does not belong to you</center></p>
<?php
exit;
}
$post = mysql_fetch_array($post_query);
mysql_free_result($post_query);
deletechildetopic();
function redirect($url,$delay='5') {
print '
<meta http-equiv="refresh" content="'.$delay.';URL='.$url.'">
';
}
redirect("main-postview.php?maintopicID=$redirect_maintopicID&childetopicID=$redirect_childetopicID");
echo "<b>Your topic and all the posts has been deleted succesfuly!<br>
Now You Will Be Redirect back to mainpost viewbord in 5 Secounds!</B>";
}
else {
?>
<TABLE BORDER=0 WIDTH=100% CELLSPACING=3 CELLPADDING=5>
<TR><TD>
<FONT COLOR="#000000" FACE="Arial,Verdana,Helvetica" size=-1>
</TD></TR></TABLE>
<FORM METHOD=POST ACTION="<?php echo $PHP_SELF ?>">
<INPUT TYPE="hidden" name="childetopicID" value="<?php echo $childetopicID ?>">
<INPUT TYPE="hidden" name="maintopicID" value="<?php echo $maintopicID ?>">
<INPUT TYPE="hidden" name="action" value="delete_two">
<TABLE border=0 cellpadding=0 cellspacing=0 width="95%">
<TR><TD bgcolor="#000000">
<table border=0 cellpadding=4 cellspacing=1 width=100%>
<tr bgcolor="#C0C0C0">
<td >
<FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica"><B>Your UserName:</B></FONT></td><td>
<INPUT TYPE="TEXT" NAME="username" SIZE=25>
</td></tr>
<tr bgcolor="#C0C0C0">
<td>
<FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica"><B>Your Password:</B></FONT></td><td>
<INPUT TYPE="PASSWORD" NAME="password" SIZE=13>
</font></td></tr>
<tr bgcolor="#C0C0C0">
<TD colspan=2><CENTER><INPUT TYPE="submit" Value="Delete Post"></CENTER></TD>
</tr>
</table>
</TD>
</TR>
</TABLE>
</FORM>
<?php
}
?>
function.php
/* Delete childe topic and posted thred in this childe topics */
<?
function deletechildetopic () {
global $childetopicID, $maintopicID;
$childetopic_deletequery = mysql_query("DELETE FROM childetopics WHERE (ID='$childetopicID' AND maintopicID='$maintopicID')");
$mainpost_deletequery = mysql_query("DELETE FROM mainposts WHERE (maintopicID='$maintopicID' AND childetopicID='$childetopicID')");
if (mysql_error() != "") {
?>
<br><p><center><b>There was a MySQL Error -- <?php echo mysql_error() ?></b></center></p>
<?php
exit;
}
}