Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 09-04-2005, 10:05 PM copy()
Manson's Avatar
Super Talker

Posts: 106
Location: South Wales, UK
Trades: 0
Hey all!

My script was running fine since I made it until today. One minute it was working, the next, it wasn't.

Can anyone help?

Here is the error:

Warning: copy(pics/Manson5C990.jpg): failed to open stream: Permission denied in /home/excessti/public_html/index.php on line 191

And the code:

PHP Code:
        case 6:$file="myphotos.php";
                include(
"checksession.php");
                if(isset(
$addpic))
                {
                        
$approved=getSetting("APPROVEPIC");
                        if(!empty(
$url))
                        {
                                
$sql="insert into photos(url,filename,username,upldate,approved) values('$url','$filename','$ses_username',now(),'$approved')";
                                
$res=mysql_query($sql);
                        }
                        else if(!empty(
$uppic_name))
                        {
                            
$allowable=getSetting("ALLOWEDFORMATS");
                            
$allowablearr=split(",",$allowable);
                            
$allowedType=0;
                            
$ext=strchr($uppic_name,".");
                            
                            if(
in_array($ext,$allowablearr))$allowedType=1;
                            if(
$allowedType==1)
                            {
                            
$fileid generateShortCode();
                            
$filename $ses_username.$fileid.$ext;
                            
                            
$copytofile="pics/$filename";
                            
copy($uppic,$copytofile);
                            @
unlink($uppic);
                            
                                
$sql="insert into photos(url,filename,username,upldate,approved) values('$url','$filename','$ses_username',now(),'$approved')";
                                
$res=mysql_query($sql);
                            }
                            else
                            {
                                @
unlink($uppic);
                                
$uperror="Format not supported!";
                            }
                        }
                        if(
$approved=="Y")
                        {
                            
$error="Image has been added.";    
                        }
                        else if(
$error=="")
                        {
                            
$error="Image is awaiting approval.";
                        }
                }
                break; 
line 191 is "copy($uppic,$copytofile);"

any help would be great!

Manson
__________________
Admin of
Please login or register to view this content. Registration is FREE
Manson is offline
Reply With Quote
View Public Profile Visit Manson's homepage!
 
 
Register now for full access!
Old 09-04-2005, 10:10 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Permissions must have been reset on your pics directory. Try changing the permissions to allow writing to it.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 09-04-2005, 10:29 PM
Manson's Avatar
Super Talker

Posts: 106
Location: South Wales, UK
Trades: 0
brilliant!

cptnwinky ur a star!!
__________________
Admin of
Please login or register to view this content. Registration is FREE
Manson is offline
Reply With Quote
View Public Profile Visit Manson's homepage!
 
Old 09-04-2005, 10:29 PM
Manson's Avatar
Super Talker

Posts: 106
Location: South Wales, UK
Trades: 0
cnt belive i didnt think of that lol
__________________
Admin of
Please login or register to view this content. Registration is FREE
Manson is offline
Reply With Quote
View Public Profile Visit Manson's homepage!
 
Reply     « Reply to copy()
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13187 seconds with 12 queries