TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-23-2007, 05:41 PM   #1 (permalink)
The Visitor
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
luk3 is on a distinguished road
Default [Question] why does my script have this error

I recently purchased a script called PHPix and ive uploaded it.

www.hairscene.net/hotornot/

and when it comes to the image uploading part, it wont upload the images, try it for yourself and see

www.hairscene.net/hotornot/signup.php

it says to upload a valid file type, which i did. An ideas?

thanks
luk3 is offline  
Reply With Quote
Old 09-23-2007, 06:25 PM   #2 (permalink)
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 437
Thanks: 22
Karl is on a distinguished road
Default

What type of file did you upload? Without looking at the script, the error implies that the file type you uploaded is not a valid type for the script. For example, you tried to upload a .txt document when the script only expects .jpg images.
Karl is offline  
Reply With Quote
Old 09-23-2007, 07:25 PM   #3 (permalink)
The Visitor
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
luk3 is on a distinguished road
Default

no i have uploaded a jpg file,... and it says it is the wrong file type and i should only upload, jpg,png or gif images
luk3 is offline  
Reply With Quote
Old 09-23-2007, 07:55 PM   #4 (permalink)
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 437
Thanks: 22
Karl is on a distinguished road
Default

I think it may be that the extension must be uppercase. I tried to upload an image with an upper case extension (i.e. picture.JPG instead of picture.jpg) and the script did something, although it still didn't work - this time it just timed out after about 30 seconds.
Karl is offline  
Reply With Quote
Old 09-23-2007, 07:59 PM   #5 (permalink)
The Visitor
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
luk3 is on a distinguished road
Default

nope i just tried that, but the same error
luk3 is offline  
Reply With Quote
Old 09-23-2007, 11:03 PM   #6 (permalink)
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 437
Thanks: 22
Karl is on a distinguished road
Default

There isn't really much more I can suggest without seeing the code. I would personally contact the guy who you bought the script from and ask for some assistance.
Karl is offline  
Reply With Quote
Old 09-24-2007, 02:47 PM   #7 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

its easyer if you would like explain some more,
and maybe show bits of the code and try to get a error
error is more useful to go on..
Codefreek.
codefreek is offline  
Reply With Quote
Old 09-24-2007, 03:46 PM   #8 (permalink)
The Visitor
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
luk3 is on a distinguished road
Default

*EDIT* i think this is where the image upload is

Quote:

function is_uploaded_fil($filename) { // function for PHP versions < 4.0.3

if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($filename);
return (ereg_replace('/+', '/', $tmp_file) == $filename);
}


$username = strtolower($username);
if(!$username) { $message .= NOUSERNAME."<br>";}
if(!$password) { $message .= NOPASS."<br>"; }
if(!$email == "" && (!strstr($email,"@") || !strstr($email,"."))) $message .= ENTEREMAIL."<BR>";

if ($submitpic != "no" ) {if((strlen($url) <= 8) && !$userpic) $message .= NOURL."<br>"; }

// if(!$age) $message .= "Your age was not entered.<br>";
if(!$category) $message .= NOCAT."<br>";
if ($submitpic != "no") {if(!$describe) $message .= NODESCRIP."<br>";}
if(!$self) $self=5;
if (userexists($username)) $message .= USEREXISTS."<br>";
if (sitexists($url) && !$userpic && $submitpic != "no") $message .= IMGEXISTS."<br>";
if (isset($aself)) $message .= "<br><ID#>";
$resize = "no";
if (!isset($submitpic)) $submitpic ="yes";

if ($submitpic == "yes" && !$message ) {

if (strlen($url) <= 8 && $allowupload != 0 ) { // begin file upload routine
$source = $HTTP_POST_FILES['userpic']['tmp_name'];
$dest = '';
if (($source != 'none') && ($source != '' )) {
$newfile = uniqid('img').'';
$dest = $uploadpath.$newfile;
if (ereg( "[4-9]\.[0-9]\.[3-9].*", phpversion() ) || ereg( "[4-9]\.[1-9]\.[0-9].*", phpversion() )) {
if ( $dest != '' ) {
if ( move_uploaded_file( $source, $dest ) ) {$url = $uploadurl.$newfile;}
else $message .= FILENOTSTORED."<BR>";
if (isset($chmod)) chmod ($dest, 0755); // some servers will require this line
}
}else {
if ( $dest != '' ) {
if (is_uploaded_fil($source)) { copy($source, $dest); $url = $uploadurl.$newfile;}
if (isset($chmod)) chmod ($dest, 0755); // some servers will require this line
}
}

}
else $message = FILETOOBIG;

$imagesize = @getimagesize($dest);
switch ( $imagesize[2] ) {
case 1:
rename($dest, $dest.".gif");
$url.= ".gif";
break;
case 2:
rename($dest, $dest.".jpg");
$url.= ".jpg";
$dest .= ".jpg";
addlogo();
$jpg = 1;
break;
case 3:
rename($dest, $dest.".png");
$url.= ".png";
break;
default:
$message = INVALIDIMG;
@unlink($dest);
break;
}


if ( $imagesize[0] > $imgsize) $resize = "yes";
if ( $source_size > ($uploadsize * 1024) ) $message .= FILETOOBIG;
if ( filesize($dest) > ($uploadsize * 1024) ) { unlink($dest); $message .= FILETOOBIG; }

} // end file upload routine
}

Last edited by luk3 : 09-24-2007 at 04:34 PM.
luk3 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 02:10 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design