Error » Web Related Error!! » Server Side Languages Error ! » Error message, Really drawing a blank.

Server Side Languages Error ! Post here with questions about PHP, perl/cgi, ASP, etc.

Post New Thread Reply
  Error message, Really drawing a blank.
LinkBack Thread Tools Display Modes
Old 18-Aug-2006, 10:12 AM   #1 (permalink)
Fix my Error!
 
myspacelayouts's Avatar

Posts: 23
Join Date: Aug 2006
Rep Power: 0 myspacelayouts is on a distinguished road

IM:
Unhappy Error message, Really drawing a blank.

if (array_search(strtolower(substr($file['name'], strrpos($file['name'], '.')+1)), $config['ftypes']) == false) {
echo "Invalid image file type!";
exit;

this is about line 25 in home/borexcom/public_html/admincp/upload2.php

Here is the error message...

Warning: array_search() [function.array-search]: Wrong datatype for second argument in /home/borexcom/public_html/admincp/upload2.php on line 35
Invalid image file type!

Any Ideas?
I can give more info if needed.
Thankyou

myspacelayouts is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
   


   
Old 18-Aug-2006, 10:32 AM   #2 (permalink)
Administrator
 
Admin's Avatar

Posts: 876
Join Date: Oct 2005
Rep Power: 10 Admin has disabled reputation

IM:
Default Re: Error message, Really drawing a blank.

i guess this is a minor error in using proper data type

if you can post the script file completely we can help yiu fix that error
Admin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 10:36 AM   #3 (permalink)
Fix my Error!
 
myspacelayouts's Avatar

Posts: 23
Join Date: Aug 2006
Rep Power: 0 myspacelayouts is on a distinguished road

IM:
Default Re: Error message, Really drawing a blank.





include("include.php");
chdir("..");
?>
if (!isset($_COOKIE['mys_admin'])) {
exit;
}
if (!isset($_COOKIE['mys_pass'])) {
exit;
}
function getname($thename) {
global $mysql_server,$mysql_user,$mysql_pass,$mysql_db;
mysql_connect($mysql_server,$mysql_user,$mysql_pas s);
mysql_select_db($mysql_db);
$tmpquery = mysql_query("SELECT * FROM `approved` WHERE LOWER(`name`) = '".strtolower($thename)."'");
$tmpresult = @mysql_fetch_array($query);
mysql_close();
return empty($tmpresult);
}
if (isset($submit)) {
if ($name == "") { echo "Your template must have a name!" ; exit ; }
if ($description == "") { echo "Your template must have a description!" ; exit ; }
if (empty($file)) { echo "You must upload a 150x150 thumbnail with your code!" ; exit ; }
$count = 1;
$old_name = $name;
$alias = ereg_replace("[^[:space:]a-zA-Z0-9*_.-]", "", $name);
$alias = str_replace(" ","-",strtolower($alias));
$typestr = ereg_replace("[^[:space:]a-zA-Z0-9*_.-]", "", $typestr);
$typestr = str_replace(" ","-",strtolower($typestr));
foreach ($_FILES as $file)
$ext = strtolower(substr($file['name'], strrpos($file['name'], '.')+1));
if (move_uploaded_file($file['tmp_name'], $script_dir . "thumbs/" . $typestr . "_layout_" . $alias . "." . $ext))
{
mysql_connect($mysql_server,$mysql_user,$mysql_pas s);
mysql_select_db($mysql_db);
$time = time();
mysql_query("INSERT INTO `pending` VALUES('".$time."','".addslashes($name)."','".addslashes($description)."','".$type."','".$category."','".strtolower($_COOKIE['mys_admin'])."','".$alias."','". $typestr . "_layout_" . $alias . "." . $ext."')");
$code[0] = "";
$temp = 1;
while ($temp <= 10) {
if (isset($_POST['code'.$temp])) { $code[$temp] = addslashes($_POST['code'.$temp]); } else { $code[$temp] = ""; }
$temp = $temp + 1;
}
mysql_query("INSERT INTO `codes` VALUES('".$time."','".$code[1]."','".$code[2]."','".$code[3]."','".$code[4]."','".$code[5]."','".$code[6]."','".$code[7]."','".$code[8]."','".$code[9]."','".$code[10]."')");
mysql_close();
}
else
{
echo 'Thumbnail upload failed! Please contact site admin.
';
}
}
echo "Your layout addition is currently pending. Note all pending layouts will not be published on our site until admin approval.

";
}
?>
UPLOAD LAYOUT


$type = explode("_",$type);
$type[1] = str_replace(" ","-",strtolower($type[1]));
?>



Type:


Category:



150x150 Thumbnail:

Name:


Description:




CODES:


mysql_connect($mysql_server,$mysql_user,$mysql_pas s);
mysql_select_db($mysql_db);
$query = mysql_query("SELECT * FROM `code_names` WHERE `id` = '".$type[0]."' LIMIT 1");
$result = mysql_fetch_array($query);
$temp = 1;
while ($temp <= $type[2]) {
$str = "code".$temp;
echo $result[$str].":
";
echo '

';
$temp = $temp + 1;
}
mysql_close();
?>

 



That is the file if you would need more, please be specific, I am trying hard, but there is alot to learn.
myspacelayouts is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 10:40 AM   #4 (permalink)
Administrator
 
Admin's Avatar

Posts: 876
Join Date: Oct 2005
Rep Power: 10 Admin has disabled reputation

IM:
Default Re: Error message, Really drawing a blank.

please attach the file
its hard to work that

thanks
Admin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 10:44 AM   #5 (permalink)
Fix my Error!
 
myspacelayouts's Avatar

Posts: 23
Join Date: Aug 2006
Rep Power: 0 myspacelayouts is on a distinguished road

IM:
Default Re: Error message, Really drawing a blank.

Sorry, I never knew you could do that. I hope it worked, it wouldn't let me upload the php file so I did it as text and named it upload2txt
Attached Files
File Type: txt upload2txt.txt (4.0 KB, 34 views)
myspacelayouts is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 11:09 AM   #6 (permalink)
Administrator
 
Admin's Avatar

Posts: 876
Join Date: Oct 2005
Rep Power: 10 Admin has disabled reputation

IM:
Default Re: Error message, Really drawing a blank.

Try using this one
Attached Files
File Type: txt upload2txt.txt (4.0 KB, 46 views)
Admin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 09:41 PM   #7 (permalink)
Fix my Error!
 
myspacelayouts's Avatar

Posts: 23
Join Date: Aug 2006
Rep Power: 0 myspacelayouts is on a distinguished road

IM:
Default Re: Error message, Really drawing a blank.

Thankyou, I went to bed last night and just got up and I will try it in just a bit, I will let you know how it goes.
Thankyou so much for your time and helping me.
Tammie
myspacelayouts is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 10:59 PM   #8 (permalink)
Fix my Error!
 
myspacelayouts's Avatar

Posts: 23
Join Date: Aug 2006
Rep Power: 0 myspacelayouts is on a distinguished road

IM:
Default Re: Error message, Really drawing a blank.

Administration Control Panel

Parse error: syntax error, unexpected T_STRING in /home/borexcom/public_html/admincp/upload2.php on line 31

That is what I got when I put the new one in. I will look, but I am not so good with these errors,
thankyou though, I really appreciate it.
Tammie
myspacelayouts is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 18-Aug-2006, 11:37 PM   #9 (permalink)
Administrator
 
Admin's Avatar

Posts: 876
Join Date: Oct 2005
Rep Power: 10 Admin has disabled reputation

IM:
Default Re: Error message, Really drawing a blank.

can't figure out any syntax error on the line its refering

was the old error fixed now?
Admin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 19-Aug-2006, 12:58 AM   #10 (permalink)
Fix my Error!
 
myspacelayouts's Avatar

Posts: 23
Join Date: Aug 2006
Rep Power: 0 myspacelayouts is on a distinguished road

IM:
Default Re: Error message, Really drawing a blank.

It doesn't say the other error, just this on the page. That is okay, thankyou for trying
myspacelayouts is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Post New Thread Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump