Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-20-2006, 08:02 AM   #1 (permalink)
shz
Junior Member
 
Join Date: Jul 2006
Posts: 1
Default finding scripts

so im looking for a php script that friends of mine can come and upload picture to my server. then they could be displayed in a thumb gallery.

does anyone know of any good places to find a script that could do this?
shz is offline   Reply With Quote
Sponsored Links
Old 07-22-2006, 12:54 PM   #2 (permalink)
kirsche08
Junior Member
 
Join Date: Jul 2006
Posts: 11
Default Re: finding scripts

for this one you need a mysql database
coppermineDOTsfDOTnet


this one is just php
galleryDOTmenaltoDOTcom


i hope this was helpfull (please replace the DOT with a . because of the restrictions of this forum i could not post the link)
kirsche08 is offline   Reply With Quote
Old 08-04-2006, 05:38 AM   #3 (permalink)
shane.carr
Junior Member
 
shane.carr's Avatar
 
Join Date: Jun 2006
Posts: 28
Default Re: finding scripts

I made something like this recently.

This is from http://plurged.com/code.php?id=82

PHP Code:
function uploadfile($origin$dest$tmp_name) {
  
$origin strtolower(basename($origin));
  
$fulldest $dest.$origin;
  
$filename $origin;
  for (
$i=1file_exists($fulldest); $i++)
  {
   
$fileext = (strpos($origin,'.')===false?'':'.'.substr(strrchr($origin"."), 1));
   
$filename substr($origin0strlen($origin)-strlen($fileext)).'['.$i.']'.$fileext;
   
$fulldest $dest.$newfilename;
  }
 
  if (
move_uploaded_file($tmp_name$fulldest))
   return 
$filename;
  return 
false;
}

//example: uploadfile($_FILE['file']['name'],'temp/',$_FILE['file']['tmp_name']); 

And then use a database to store the picture urls or use this code that I typed up recently (create vars.txt with good permissions):

PHP Code:
<?

//variable functions
function getVar($variablename){
    
//get the contents of the file
    
$variabledatabase file_get_contents("../forums/vars.txt");
    
    
//find the value of the variable:
    
$variablea split("
"
$variabledatabase);
    
$return false;
    foreach(
$variablea as $variablec){
        
$variableb split('\$'$variablec);
        if(
$variableb[1] == $variablename){
            
$return $variableb[2];
        }
        
$i++;
    }
    return 
$return;
}

function 
newVar($variablenamenew$variablecontentsnew){
    if(!
getVar($variablenamenew) && getVar($variablenamenew) !== ""){ //if the variable doesn't exist
        //add a new one
        
$hnew fopen("../forums/vars.txt""a");
        
$allvarnew "\$".$variablenamenew."\$".$variablecontentsnew."
"
;
        
fwrite($hnew$allvarnew);
        
fclose($hnew);
        return 
true;
    } else return 
false;
}

function 
setVar($variablenameset$variablecontentsset){
    if(
getVar($variablenameset) || getVar($variablenameset) === ""){ //if the variable exists
        //get the contents of the file
        
$varstxtcontents file_get_contents("../forums/vars.txt");
        
        
//change the variable
        
$varstxtcontentsa split('\$'$varstxtcontents);
        
$j 1;
        while(
$j<sizeof($varstxtcontentsa)){
            if(
$varstxtcontentsa[$j] == $variablenameset){
                
$j++;
                
$varstxtcontentsa[$j] = $variablecontentsset."
"
;
                
$j--;
            }
            
$j $j 2;
        }
        
$variablecontentssetb join("\$"$varstxtcontentsa);
        
        
//actually write the new file
        
$hsetw fopen("../forums/vars.txt""w");
        
fwrite($hsetw$variablecontentssetb);
        
fclose($hsetw);
        return 
true;
    } else return 
false;
}

function 
delVar($varnamedel){
    if(
getVar($varnamedel) || getVar($varnamedel) === ""){ //if the variable exists
        //get the contents
        
$contentsdel file_get_contents("../forums/vars.txt");
        
        
//find and remove the variable
        
$contentsdeli 1;
        
$contentsdel1 split('\$'$contentsdel);
        while(
$contentsdeli sizeof($contentsdel1)){
            if(
$contentsdel1[$contentsdeli] == $varnamedel){
                
array_splice($contentsdel1$contentsdeli2); //where it's actually removed
                
$contentsdeli -= 2;
            }
            
$contentsdeli += 2;
        }
        
        
//put it back together
        
$contentsdel1 join("\$"$contentsdel1);
        
        
//write it!
        
$delh fopen("../forums/vars.txt""w");
        
fwrite($delh$contentsdel1);
        
fclose($delh);
        
        return 
true;
    } else return 
false;
}

?>
shane.carr is offline   Reply With Quote
Old 08-04-2006, 02:14 PM   #4 (permalink)
O~Snapple
Moderator Of The Year
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 716
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: finding scripts

Good Post Shane,

i dont have the time to test it, but SHZ if you do let me know how it works

~Snapple
__________________
The Real Truth
Epademik Emcee Esq. New Album The 3rd Finger is in Stores Now!
Snap Marketing Management and Consulting
O~Snapple is offline   Reply With Quote
Old 08-06-2006, 03:56 AM   #5 (permalink)
fares_refaat
Junior Member
 
Join Date: Aug 2006
Posts: 11
Default Re: finding scripts

Thank You All


Congratulation
fares_refaat is offline   Reply With Quote
Old 08-06-2006, 04:45 AM   #6 (permalink)
shane.carr
Junior Member
 
shane.carr's Avatar
 
Join Date: Jun 2006
Posts: 28
Default Re: finding scripts

fares_refaat, that's the third time that you have thanked instead of the originator of the thread! What's the deal? But, you're welcome!
shane.carr is offline   Reply With Quote
Reply


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

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 05:02 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums