"; fwrite($fd,$data); fflush($fd); fclose($fd); }; function adminheaders($baseURL) { echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo " Yappa: Administration web photo album\n"; echo " \n"; echo " \n"; echo ""; echo ""; echo "
Yappa generatedAdministration center  |   Base of the photo album
"; } function adminendhtml() { echo "
"; echo "

.

\n"; echo " \n"; echo "\n"; } // cut the begin of a path function stripbeginfrompath($base,$dir) { $data=split($base,$dir); return($data[1]); } // display directories recurslivy, $base is used to strip the begin of path. function recursdir($adir,$base) { $handle=opendir($adir); while ($file = readdir($handle)) { if (is_dir($adir."/".$file) && ($file!=".") && ($file!="..")&& ($file!=".tn") && ($file!="admin")) { $dir=$adir."/".$file; $actiondir=stripbeginfrompath($base,$dir); echo " $actiondir "; echo "delete directory"; recursdir($dir,$base); } }; }; function writealldirectories() { $basedir=dirname(getcwd()); $base=basename($basedir); echo ""; // Add a line for the base directory. so users can create directories on base. echo ""; echo ""; recursdir($basedir,$base); echo "
Base directory  
"; } //return 1 if version in $contentversion > $version function goodversion($version,$content) { $data=explode("\n",$content); for($i=0;$i0) { echo "New version detected"; return 1; } else { echo "No new version"; return 0; }; } } return(0); } //write operation available on main admin page function sendnormaloperations($basedir,$baseURL) { global $actiondir, $deletedir,$addaccess,$pass,$email,$PHP_AUTH_USER,$autoinstall,$version,$testunarchiver; echo ""; //gestion des actions if (isset($deletedir)) { // we must clean up misc files: .tn directory and index.php rmdir($basedir."/".$deletedir."/.tn"); unlink($basedir."/".$deletedir."/index.php"); if (rmdir($basedir."/".$deletedir)) { echo "
Directory $deletedir deleted.
"; } else { echo "
The directory $deletedir couldn't be deleted (access denied, not empty or nonexistant)
"; }; }; if (isset($addaccess)) { if ($pass=="") { echo "Password can't be empty. No action taken"; } else { if (!file_exists("$basedir/admin/.htaccess")) { $fd=fopen("$basedir/admin/.htaccess","w"); $data="AuthName \"Acces administration de yappa. give your admin email as login\"\n"; $data.="AuthType Basic\n"; $data.="AuthUserFile $basedir/admin/.htpasswd\n"; $data.="AuthGroupFile None\n"; $data.="require valid-user"; fwrite($fd,$data); fclose($fd); }; if (file_exists("$basedir/admin/.htpasswd")) { $command="htpasswd -mb $basedir/admin/.htpasswd $email $pass"; system($command); } else { $fd=fopen("$basedir/admin/.htpasswd","w"); $data=$email.":".crypt($pass); fwrite($fd,$data); fclose($fd); }; mail($email,"Yappa administration","From: yappa@localhost\nThe password for administration is :\n$pass\nSee you later"); echo "Change done"; }; }; if (isset($autoinstall)) { $url="http://manu.agat.net/yappa/yappa.txt"; $fcontents = join( '', file( $url ) ); if ($fcontents!="" && goodversion($version,$fcontents)==1) { $fd=fopen($basedir."/yappa.txt","w"); fwrite($fd,$fcontents); fclose($fd); if (file_exists("$basedir/index.php.old")) { unlink("$basedir/index.php.old"); }; rename("$basedir/index.php","$basedir/index.php.old"); rename("$basedir/yappa.txt","$basedir/index.php"); echo "Update done"; }; }; if (isset($testunarchiver)) { exec("which unrar",$devnull,$data); if ($data==0) { echo "unrar available"; } else { echo "unrar unavailable"; } echo "
"; exec("which unzip",$devnull,$data); if ($data==0) { echo "unzip available"; } else { echo "unzip unavailable"; } echo "
"; exec("which tar",$devnull,$data); if ($data==0) { echo "tar available"; } else { echo "tar unavailable"; } echo "
"; }; echo "
"; echo ""; }; function listallphotofromdir($actiondir,$basedir,$baseURL) { $handle=opendir($basedir."/".rawurldecode($actiondir)); echo "\n";$nbphotos=0; while ($file = readdir($handle)) { $filename=$basedir."/".$actiondir."/".$file; if (is_file($filename) && ($file!="index.php")) { echo ""; if ((ereg(".jpg$",$filename)) || (ereg(".JPG$",$filename)) || (ereg(".jpeg$",$filename))) { echo ""; } else { if (ereg(".*\.txt$",$filename)) { echo ""; } else { if (ereg("config.php$",$filename)) { echo ""; } else { echo ""; } } } echo " " ; if ((ereg(".jpg$",$filename)) || (ereg(".JPG$",$filename)) || (ereg(".jpeg$",$filename))) { echo ""; } else { if (ereg("config.php$",$filename)) { echo ""; } else { echo ""; } } echo "\n"; $nbphotos=1; }; }; echo "
".$file."photo's commentconfig file delete fileadd a comment:"; echo "
"; echo ""; echo ""; echo ""; echo "
To use general options for comments and number of thumbnails per line, delete this file 
"; if ($nbphotos==0) { echo "No photo in this directory"; }; }; function workonadirectory($actiondir,$basedir,$baseURL) { global $deletefile,$directory,$nom,$sendfile,$sendfile_name,$sendfile_type,$file,$textecommentaire,$commentfile,$createthetn,$version,$comment,$allow_comments,$allow_jpeginfo,$img_per_row,$newallowcom,$newjpeginfo,$newimgperrow; // en gras pour montrer les actions effectués. echo ""; //gestion de l'effacement d'un fichier if (isset($deletefile)) { if (unlink($basedir."/".$actiondir."/".$deletefile) ) { if (file_exists($basedir."/".$actiondir."/.tn/tn_".$deletefile)) {unlink($basedir."/".$actiondir."/.tn/tn_".$deletefile);}; if (file_exists($basedir."/".$actiondir."/".$deletefile.".txt")) {unlink($basedir."/".$actiondir."/".$deletefile.".txt");}; echo "
File $deletefile deleted.
"; } else { echo "
The file $deletefile couldn't bze deleted (acces denied or non existent)
"; }; }; //gestion de la creation d'un répertoire if (isset($directory)) { if ($directory=="create") { if (mkdir($basedir."/".$actiondir."/".$nom,0755)) { echo "Directory $nom created
"; } else { echo "Directory couldn't be created. Check permissions on $actiondir
"; }; }; }; // gestion des envois de fichiers if (isset($sendfile)) { // On vérifie qu'on a des fichiers jpeg rar ou zip. un system("file") devrait etre tres efficace poru connaitre le contenu if (ereg(".*\.jpg$",$sendfile_name) || ereg(".*\.JPG$",$sendfile_name) || ereg(".*\.jpeg$",$sendfile_name)) { echo "File $sendfile_name accepted
"; move_uploaded_file($sendfile, $basedir."/".rawurldecode($actiondir)."/".$sendfile_name); } else { if (ereg(".*\.tar$",$sendfile_name)) { move_uploaded_file($sendfile, $basedir."/".rawurldecode($actiondir)."/".$sendfile_name); $command="tar xf \"$basedir".rawurldecode($actiondir)."/$sendfile_name\" -C \"$basedir".rawurldecode($actiondir)."\" && rm -f \"$basedir".rawurldecode($actiondir)."/$sendfile_name\""; system($command); echo "File in place."; }; if (ereg(".*\.tar\.gz$",$sendfile_name)) { move_uploaded_file($sendfile, $basedir."/".rawurldecode($actiondir)."/".$sendfile_name); $command="tar xfz \"$basedir".rawurldecode($actiondir)."/$sendfile_name\" -C \"$basedir".rawurldecode($actiondir)."\" && rm -f \"$basedir".rawurldecode($actiondir)."/$sendfile_name\""; system($command); echo "File in place."; }; if (ereg(".*\.tgz$",$sendfile_name)) { move_uploaded_file($sendfile, $basedir."/".rawurldecode($actiondir)."/".$sendfile_name); $command="tar xfz \"$basedir".rawurldecode($actiondir)."/$sendfile_name\" -C \"$basedir".rawurldecode($actiondir)."\" && rm -f \"$basedir".rawurldecode($actiondir)."/$sendfile_name\""; system($command); }; if (ereg(".*\.zip$",$sendfile_name)) { move_uploaded_file($sendfile, $basedir."/".rawurldecode($actiondir)."/".$sendfile_name); $command="unzip \"$basedir".rawurldecode($actiondir)."/$sendfile_name\" -d \"$basedir".rawurldecode($actiondir)."\" && rm -f \"$basedir".rawurldecode($actiondir)."/$sendfile_name\""; system($command); echo "File in place."; }; if (ereg(".*\.rar$",$sendfile_name)) { move_uploaded_file($sendfile, $basedir."/".rawurldecode($actiondir)."/".$sendfile_name); $command="unrar x \"$basedir".rawurldecode($actiondir)."/$sendfile_name\" -C \"$basedir".rawurldecode($actiondir)."\" && rm -f \"$basedir".rawurldecode($actiondir)."/$sendfile_name\""; system($command); echo "file in place."; }; } }; //gestion de l'ajout d'un commentaire a une photo. if (isset($commentfile)) { $fd=fopen($basedir."/".rawurldecode($actiondir)."/".rawurldecode($file).".txt","a+"); fwrite($fd,"127.0.0.1|".date("Y-m-d H:i")."|admin|$textecommentaire\n"); fclose($fd); echo "Added comment"; }; //gestion add a comment for all photos comment wil be written in comment.html in the dir. if (isset($comment)) { $fd=fopen($basedir."/".rawurldecode($actiondir)."/comment.html","w"); fputs($fd,$nom); fclose($fd); }; //gestion de la creation des thumbnails if (isset($createthetn)) { createtn($basedir."/".$actiondir,$createthetn) ; echo "Thumbnails created"; }; //gestion de l'autorisation des commentaires if (isset($newallowcom)) { writeconfig($basedir."/".rawurldecode($actiondir),$newallowcom,$allow_jpeginfo,$img_per_row); if ($allow_comments==0) { echo "Comments are now denied."; } else { echo "Comments are now allowed."; }; }; if (isset($newimgperrow)) { writeconfig($basedir."/".rawurldecode($actiondir),$allow_comments,$allow_jpeginfo,$newimgperrow); echo "Now, $img_per_row picture(s) per line will be displayed"; }; // affichage du menu echo "
\n"; echo "

Work directory: $actiondir"; echo "\n"; echo "You have found a bug ? no problems, the bug will disappear in a few minutes/hours/days/weeks/months/never if you write me what you have done, the yappa version and of course the error :)"; echo "
Write me (please don't change the subject)"; }; // No need to touch these variable unless you nkow exactly what happens. // default values are *best* values :) // Propagate the index.php file in subdirectories. 1 = activate it. 0 disable it. default=1 $autopropagateindex=1; // Name of the file to block autopropagation $blockautopropagate=".yappa.nopropage"; //autocreate thumbnails on fly 1 = enabled. 0 = disabled. default=1 $autocreatethumbnails=1; // allow comment. Available value: 0/1 (0 disable, default: 1) /* *************** Configuration stop here. ********** */ /* * FUNCTIONS */ /* return html code to create link running in the following directories.*/ function mysplit($thestring2) { global $base_dir_picture; if (ereg("\?",$thestring2)) { $thestring3=explode("?",$thestring2); $thestring=$thestring3[0]; } else { $thestring=$thestring2; }; $res=explode("/",$thestring); for($i=0;(strcmp($res[$i],$base_dir_picture)!=0) && ($i<1000) ;$i++); if ($i>999) {echo "ERROR";}; for($j=$i;$j".rawurldecode($res[$j])." / \n"; } } /* return html code to create link running in the following directories.*/ function mydirectorylist($thestring2) { global $basedir,$base_dir_picture,$autopropagateindex, $index; if (ereg("\?",$thestring2)) { $thestring3=explode("?",$thestring2); $thestring= $thestring3[0]; } else { $thestring=$thestring2; }; $res=explode("/",$thestring); if (basename($thestring)!=basename($basedir)) { $parent=dirname($thestring); echo "Parent directory
"; }; echo "Thumbnails view
(current album)


"; $subdirsexists=0; $handle=opendir("."); while ($file = readdir($handle)) { if (($file=="admin") && (is_dir($file)) && (!file_exists("$file/index.php"))) { symlink("$basedir/index.php","$file/index.php"); } if (($file != ".") && ($file != "..") && ($file != "admin") && ($file != ".tn") && (is_dir($file))) { // echo "$file
\n"; $dirs[]=$file; $subdirsexists=1; if (($autopropagateindex==1) && (!file_exists($blockautopropagate)) &&(!file_exists("$file/index.php"))) { symlink("$basedir/index.php","$file/index.php"); }; } } sort($dirs); // count and write number of photos for ($key=0; $key < count($dirs); $key++) { $file=$dirs[$key]; echo "$file
\n"; $d=dir($file); $a=0;$b=0; while ($subfile=$d->read()) { if ( (( eregi("\.jpg$",$file."/".$subfile) ) || (eregi("\.jpeg$",$file."/".$subfile))) && (is_file($file."/".$subfile)) ) { $a++; }; if ( is_dir($file."/".$subfile) && (($subfile!=".") && ($subfile!="..") && ($subfile!=".tn")) ) { $b++; }; } // count and write subdirs echo "$a pictures
"; echo "$b subdirs


"; } closedir($handle); if ($subdirsexists==0) { echo "No subdirs."; } } // Create thumbnails function createtn($dir,$style) { if (file_exists("$dir/.tn") && (is_dir("$dir/.tn"))) { } else { mkdir("$dir/.tn",0775); } $d=dir("$dir"); while ($file=$d->read()) { if ( ( (eregi("\.jpg$",$dir."/".$file)) || (eregi("\.JPG$",$dir."/".$file)) || (eregi("\.jpeg$",$dir."/".$file))) && (is_file($dir."/".$file)) && ((!file_exists($dir."/.tn/tn_".$file)) || (!file_exists($dir."/.tn/tf_".$file))) ) { if ($style=="gray") { $commstyle=" -colorspace GRAY ";}; system("convert -quality 30 $commstyle -geometry 120x100 \"$dir/$file\" \"$dir/.tn/tn_$file\""); // Build Thumb Finger (oo, im clever) // Fingersize used for later option stuff $fingersize = 640; system("convert -sharpen 3 -normalize -geometry ".$fingersize."x$fingersize \"$dir/$file\" \"$dir/.tn/tf_$file\""); echo "."; }; } }; function displaytn($thestring2) { global $img_per_row; if (ereg("\?",$thestring2)) { $thestring3=explode("?",$thestring2); $thedir= $thestring3[0]; } else { $thedir=$thestring2; }; //da is a sorted array of available files. $da=GetDirArray("."); $counter=0; if (count($da)>0) { while (list($key,$file)=each($da)) { if ( ((ereg(".*\.jpg$",$file)) || (ereg("\.JPG$",$dir."/".$file)) || (ereg(".*\.jpeg$",$file))) && (is_file($file)) ) { $oneimageexist=1; if ($counter==0) { echo "\n\n";} echo "\n" ; $counter++; if ($counter==$img_per_row+1) { echo "

$file

"; displaycomment($file); echo "
\n"; $counter=0;} }; }; }; if ( $oneimageexist==1) { if ($counter!=0) { for ($i=$counter;$i<$img_per_row+1;$i++) { echo " "; }; echo "\n"; $counter=0;} } else { echo "
No images in this directory
"; } }; function fulldisplay($image,$da) { global $allow_comments,$allow_jpeginfo,$yappanom; $current=""; $counter=0; while ($image!=$da[$counter]) { $counter++; }; if ($counter==0) { $prec=""; } else { $prec=$da[$counter-1]; }; if ($counter==count($da)) { $suiv=""; } else { $suiv=$da[$counter+1]; }; if ($prec!="") { echo " PREV "; }; if ($allow_jpeginfo==1) { echo " Image Info "; }; if ($suiv!="") { echo " NEXT"; }; echo "

"; if ($allow_comments==1) { echo "
\n"; echo "\n"; echo "
\n"; if (!isset($yappanom)) { $nom="your name"; } else { $nom=$yappanom; }; echo "
\n"; echo " \n"; echo "
\n"; } } function originaldisplay($image,$da) { global $allow_comments,$allow_jpeginfo,$yappanom; $current=""; $counter=0; while ($image!=$da[$counter]) { $counter++; }; if ($counter==0) { $prec=""; } else { $prec=$da[$counter-1]; }; if ($counter==count($da)) { $suiv=""; } else { $suiv=$da[$counter+1]; }; if ($prec!="") { echo " PREV "; }; if ($allow_jpeginfo==1) { echo " Image Info "; }; if ($suiv!="") { echo " NEXT"; }; echo "

"; if ($allow_comments==1) { echo "
\n"; echo "\n"; echo "
\n"; if (!isset($yappanom)) { $nom="your name"; } else { $nom=$yappanom; }; echo "
\n"; echo " \n"; echo "
\n"; } } function infodisplay($image,$da) { global $allow_comments,$allow_jpeginfo,$yappanom; $current=""; $counter=0; echo "
Image Info For ".rawurlencode($thedir.$image)."

"; // For cleanleness echo "
";
   system("jhead \"".rawurlencode($thedir.$image)."\"");
   echo "
"; if ($allow_comments==1) { echo "
\n"; echo "\n"; echo "
\n"; if (!isset($yappanom)) { $nom="your name"; } else { $nom=$yappanom; }; echo "
\n"; echo " \n"; echo "
\n"; } } //write a file in the current directory with al data for a comment function addcomment($remote,$date,$text,$name,$file) { if (is_writable(".")) { $fd=fopen($file.".txt","a+"); fwrite($fd,"$remote|$date|$name|$text\n"); fclose($fd); } else { echo "pb pour ecrire"; }; }; // display a text file passed as argument function displaycomment($file) { if ((file_exists($file.".txt")) && (is_readable($file))) { $fd=fopen($file.".txt","r"); $data=fread($fd,filesize($file)); fclose($fd); $dataexploded=explode("\n",$data); for($i=0;$i(".$dataexploded2[1].")
"; } } }; //return a table of all pictures. function GetDirArray($sPath) { //Load Directory Into Array $handle=opendir($sPath); while ($file = readdir($handle)) if ( ((ereg(".*\.jpg$",$file)) || (ereg("\.JPG$",$dir."/".$file))|| (ereg(".*\.jpeg$",$file))) && (is_file($file)) ) { $retVal[count($retVal)] = $file; }; //Clean up and sort closedir($handle); if (count($retVal)>0) { sort($retVal); }; return $retVal; }; function sendHTMLhead($TITLE) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "$TITLE\n"; echo "\n"; echo "\n"; echo "\n"; }; function footerandendHTML() { echo "\n"; echo "\n"; }; // in normal operation, display picturess and menu. function normalaction($uri,$ip) { global $original,$big,$jpeginfo,$text,$nom,$img,$Valider,$allow_comments,$allow_jpeginfo,$autocreatethumbnails; echo "\n"; // ############## START OF TOP LINE echo "\n"; echo "\n"; echo "\n"; // end of top line // // ############### BEGIN left side for sub dirs echo "\n"; echo "\n"; // end left side // ############### begin for right side for photos echo "\n"; // ############### end right side echo "\n"; echo "
Yappa generated\n"; mysplit($uri); echo "\n"; echo ""; echo "
\n"; mydirectorylist($uri); echo "\n"; // If we are on the base directory, add admin link and forgotten pass if (!is_link("index.php")) { echo "

"; echo "Administration (restricted area)"; echo "
"; echo "
Forgotten password? type your admin email to get a new password: "; echo ""; echo "
(email will be verified before)"; } echo "
\n"; // compute a table of all files. $indexpictures=GetDirArray(realpath(".")); if (isset($big)) { fulldisplay($big,$indexpictures); } else if (isset($jpeginfo)) { infodisplay($jpeginfo,$indexpictures); } else if (isset($original)) { originaldisplay($original,$indexpictures); } else { if ((isset($Valider)) && ($allow_comments==1) ) { addcomment($ip,date("Y-m-d H:i"),$text,$nom,$img); } // create thumbnails if they don't exists. if ($autocreatethumbnails==1) { createtn(getcwd(),"color"); } displaygeneralcomment(); // display them displaytn($uri); } echo "\n"; echo "
\n"; }; // display a comment general for the current album function displaygeneralcomment() { if (file_exists("comment.html")) { readfile("comment.html"); }; }; function compareandall($email) { global $basedir; // first compage email and an entry in .htpasswd $fd=fopen("admin/.htpasswd","r"); $found=""; while (!feof($fd) && ($found=="")) { $buffer = fgets($fd, 4096); $bufferexploded=explode(":",$buffer); if ($bufferexploded[0]==rawurldecode($email)) { $found=$bufferexploded[0]; }; }; fclose ($fd); if ($found!="") { echo "found Email"; $time=gettimeofday(); $pass=$time["usec"]; $time=gettimeofday(); $pass.=$time["usec"]; if (file_exists("$basedir/admin/.htpasswd")) { $command="htpasswd -mb $basedir/admin/.htpasswd $email $pass"; system($command); } else { $fd=fopen("$basedir/admin/.htpasswd","w"); $data=$email.":".crypt($pass); fwrite($fd,$data); fclose($fd); }; mail($email,"Yappa administration","From: yappa@localhost\nPassword is :\n$pass\nSee you later"); echo "Update done"; } else { echo "No corresponding email found"; } } function createadminstuff() { }; /* END OF FUNCTIONS */ //begin of CODE if (is_link("index.php")) { //we are not in the base of the admin dir. $basedir=dirname(readlink("index.php")); } else { //we are on the base of the photo album $basedir=getcwd(); }; $base_dir_picture=basename($basedir); if ((!file_exists("$basedir/config.php")) ) { writeconfig($basedir,1,1,3); }; include("$basedir/config.php"); if (file_exists("config.php")) { include("config.php"); } //echo "basedir=$basedir
"; //echo "base_dir_picture:$base_dir_picture
"; $base=basename($basedir); //echo "base:$base
"; $data1=explode("?",$GLOBALS["REQUEST_URI"]); $baseURL=$data1[0]; //echo "baseURL:$baseURL"; // START OF PAGE if ((basename(getcwd())!=$base) || (file_exists("admin") && is_dir("admin"))) { //normal stuff. look if we are in admin or not: if (basename(getcwd())=="admin") { //ADMIN PART adminheaders($baseURL); if (isset($actiondir)) { //test valididy of $actiondir: ../.. and other tricks must be intercepted. //if realpath don't contain $base, $actiondir must have ../.. or something like that. $realpath=realpath($basedir."/".$actiondir); if (ereg(".*$base.*",$realpath)) { if (file_exists("$realpath/config.php")) { include("$realpath/config.php"); } workonadirectory($actiondir,$basedir,$baseURL); } else { echo "Sorry cannot read the specified dir"; } } else { sendnormaloperations($basedir,$baseURL); } adminendhtml(); } else { // NORMAL PAGE sendHTMLhead($TITLE); if (isset($email)) { compareandall($email); }; normalaction($GLOBALS["REQUEST_URI"],$GLOBALS["REMOTE_ADDR"]); footerandendHTML(); } } else { if (!isset($firsttime)) { sendHTMLhead($TITLE); if (is_writeable(".")) { echo "



Welcome to yappa. Please write your email, so I can send you a new password to administrate your Yet Another PHP Photo Album. If you don't have htpasswd in your path, edit and modifiy the script, or you won't be able to change your password! (will be fixed in next version)"; echo "

Your email:
"; echo "Thanks for using YAPPA!"; } else { echo "Please make your current dir (".getcwd().") writeable by the web server!!!"; } footerandendHTML(); } else { mkdir("admin","0755"); sendHTMLhead($TITLE); if (!file_exists("$basedir/admin/.htaccess")) { $fd=fopen("$basedir/admin/.htaccess","w"); $data="AuthName \"Admin yappa. (Email as login)\"\n"; $data.="AuthType Basic\n"; $data.="AuthUserFile $basedir/admin/.htpasswd\n"; $data.="AuthGroupFile None\n"; $data.="require valid-user"; fwrite($fd,$data); fclose($fd); }; // TODO: test email validity $time=gettimeofday(); $pass=$time["usec"]; $time=gettimeofday(); $pass.=$time["usec"]; // $command="htpasswd -cmb $basedir/admin/.htpasswd $firstemail $pass"; //Removed, and to be propaged: binary not in path?... // A function must be done for that! if (!file_exists("$basedir/admin/.htpasswd")) { $fd=fopen("$basedir/admin/.htpasswd","w"); $data=$firstemail.":".crypt($pass); fwrite($fd,$data); fclose($fd); } mail($firstemail,"Yappa administration","From: yappa@localhost\nThe password is :\n$pass\nSee you later"); echo "Thanks for using YAPPA!
"; echo "Click here to access to the photo album"; footerandendHTML(); } } ?>