Hello,
I am sorry that this post isn't very specific because I do not understand why the error is occuring and what is causing the error. So unfortunatly I will just post the entire file that is causing the error. I have a feeling it has to do with the file upload, but I can't find why. I DID make sure the $upload_dir was CHMOD 777.
<?php
include ("header.php");
$user_name = $_SESSION["username"];
if($user_name == "") {
error_msg("$lng_nologin05");
} else {
if(empty($ttitle)) error_msg("$lng_nottitle");
if(empty($tbody)) error_msg("$lng_notbody");
str_replace("$swear_words", "****", "$tbody");
str_replace("[b]", "<b>", "$tbody");
str_replace("[/b]", "</b>", "$tbody");
str_replace("[u]", "<u>", "$tbody");
str_replace("[/u]", "</u>", "$tbody");
str_replace("[code]", "<code>", "$tbody");
str_replace("
", "</code>", "$tbody");
str_replace("", "<i>", "$tbody");
str_replace("", "</i>", "$tbody");
str_replace("[br]", "<br>", "$tbody");
addslashes($tbody);
if($upload != "") {
$tmp_name = $FILES['upload']['tmp_name'];
$new_name = $FILES['upload']['name'];
$type = $FILES['upload']['type'];
$size = $FILES['upload']['size'];
if(in_array($type, $filetypes)) {
if($size < $max_filesize) {
move_uploaded_file($tmp_name, $upload_dir . "/" . $new_name);
alert_goto("$lng_filesuccess", "$scripts/view.php?id=$id");
$uploaded_to = "$upload_dir/$new_name";
$addtodb = "INSERT INTO `$tickets` SET `board_id` = '$bid', `title` = '$ttitle', `body` = '$tbody', `upload` = '$uploaded_to', `priority` = '3', `user` = '$user_name', `timestamp` = NOW (), `status` = 'open'";
$add = mysql_query($addtodb, $conn);
$add_num = mysql_affected_rows($add);
if($num == 0) {
error_msg("$lng_notadded");
} else {
alert_goto("$lng_addedticket", "$scripts/main.php");
}
} else {
error_msg("$lng_filetobig");
}
} else {
error_msg("$lng_fileinvalidtype");
}
}
$get = "SELECT * FROM $tboard WHERE board_name = '$category'";
$doget = mysql_query($get, $conn);
if(mysql_num_rows($doget) == 0) {
error_msg("$lng_invalidcategory");
} else {
$info = mysql_fetch_assoc($doget);
$bid = $info["id"];
}
$addtodb = "INSERT INTO $tickets SET board_id = '$bid', title = '$ttitle', body = '$tbody', upload = 'NONE', priority = '3', user = '$user_name', timestamp = NOW (), status = 'open'";
$add = mysql_query($addtodb, $conn);
$add_num = mysql_affected_rows($add);
if($num == 0) {
error_msg("$lng_notadded");
} else {
alert_goto("$lng_addedticket", "$scripts/main.php");
}
}
include ("footer.php");
?>
[/code]
Any help would be very greatly appreciated. This file is from the new version of phpTroubleTickets. Whoever can help will recieve this script in its "pro" version free of charge when its complete.
Thanks,
Brian
BrianBourdon.net