Jump to content


Photo

Help with 3rd party code...


  • Please log in to reply
1 reply to this topic

#1 ghostrider1

ghostrider1
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 14 October 2006 - 11:31 PM

Hello everyone, I am fairly new to PHP and I got this project to fix... I need some help though, and im hoping someone can give me a hand...

Ok.. This site has a admin.php page, in this page, you can add departments and subdepartments, when I add a sub department, I fill all the blanks and submit the request... well.. the same page comes up without any subdepartments listed... I believe they are not being stored in the database..

Look at this code please and tell me if this might be a connection/permissions issue:

case 'addsubdepartment':
$display = 4;
$newChoice='Add Sub Department';
break;
case 'Add Sub Department':
if ($_REQUEST['start'] == ''){
$_REQUEST['start'] = 0;
}
$message=$department->SubDepartmentValidation();
if($message=='')
{
$extension = split('\.', $_FILES['subdeptphoto']['name']);
$photoext = $extension[sizeof($extension) - 1];
$extension = split('\.', $_FILES['subdeptdoc']['name']);
$docext = $extension[sizeof($extension) - 1];
$extension = split('\.', $_FILES['subdeptvideo']['name']);
$videoext = $extension[sizeof($extension) - 1];
$department->SetSubDepartment($_REQUEST,$photoext,$docext,$videoext);
$subdeptId = $department->AddSubDepartment();
if($_FILES['subdeptphoto']['name']){
upload_once($subdeptId,$_FILES,'subdeptphoto',$photoext);
}
if($_FILES['subdeptdoc']['name']){
upload_documents($subdeptId,$_FILES,'subdeptdoc',$docext);
}
if($_FILES['subdeptvideo']['name']){
upload_videos($subdeptId,$_FILES,'subdeptvideo',$videoext);

}
$department->GetSubDepartmentById($_REQUEST['deptid'],'limit '.$_REQUEST['start'].','.$_REQUEST['noofrecords']);
$display = 3;
}
else

{
$department->mDbArr=$_REQUEST;
$display = 4;
$newChoice='Add Sub Department';
}
break;

#2 Mortier

Mortier
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 17 October 2006 - 05:36 PM

This code doesn't make any sense to me, I think we need more sufficient code too solve this problem :)
SQL query could be a problem. And I do not see any in this code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users