- Joost...
-
Portfolio Design...
It's very simple, but neat
-
Help adding AJAX to upload Script
If you know alot about ajax and how to implement it into a web page so it doesn't have to reload, please contact me.
-
Help Perfecting Image Upload Script
It shouldn't have to reload to show the results. Maybe put in a spinner loading image while it loads. This one if you can. index.php.zip
-
Help Perfecting Image Upload Script
I am trying to perfect my upload script, so I was wondering if someone could present a few ideas on how to add a in browser, 'on the page' way of adding a loading image. Currently, this is the order to the PHP upload script. 1. Click Browse (find image) 2. Submit image 3. Page reloads with codes and thumbnail I basically want no reloading of the page, without frames or intense coding. Between 2 and 3, it should have a loading image if possible, but it shouldn't delay the upload if it's a small image. I have heard of a few methods, like Ajax and Javascript, but I was wondering what would be the easiest, fastest, and most compatible way of adding this 'Loading' Image.
-
Photographers Web site
Look into JS Lightbox 2.0 for the Photo Gallery Background music is usually a loop, but make sure the loop is at least 30 seconds long and pulsey.
-
PHP Thumbnails
"...but if you know enough php..." I don't But thank you so much. I will wait until you have time
-
PHP Thumbnails
Is there any way that the thumbnailer can save the file to a folder called 'thumbs' with the same name as the original image? So it can be linked to. something like $thumb->save('/thumbs/'.$img.''); ? By the way great job on the script
-
PHP Thumbnails
http://www.gen-x-design.com/projects/php-thumbnailer-class/ If you can, I think that would be the easiest way.
-
PHP Thumbnails
I don't have root access.
-
PHP Thumbnails
I am very confused. Do I simply put this on my upload server path? And when I connect to the US FTP download thing it shows a ton of files.
-
PHP Thumbnails
My server has GD support i guess. Now how do I install this imagemagik?
-
PHP Thumbnails
Thank you! Can you attach all the files neccesary? I don't know where to get GD library or where to put/install it.
-
PHP Thumbnails
sounds good. Really it only needs to be put in though. It's not a problem. Updated Code: <html> <head> <style> input.liteoption { background-color: #FAFAFA; font-weight:200; font-size: 10px; font-family: "Verdana, Arial, Helvetica, sans-serif"; } input.litesearch { background-color: #FAFAFA; font-weight:200; font-size: 10px; font-family: "Verdana, Arial, Helvetica, sans-serif"; } .style1 { font-size: 10px; font-family: Arial, Helvetica, sans-serif; } .small { font-size:10px; text-decoration:underline; } .spacing { line-height:80%;} </style> </head> <body> <center> <font size="9" face="Arial"><form enctype="multipart/form-data" method="POST" class="spacing"> <input name="file" type="file" width="15" class="liteoption"/><br><input type="submit" name="upload" value="Upload" class="liteoption" /> </form></font> <? function rand_pass($length=255, $charset='A', $returnMD5=false) { $charset = strtoupper($charset); $charArray = array(); $upper = range('A','Z'); $lower = range('a','z'); $num = range(0,9); for($x=0; $x<strlen($charset); $x++) { switch($charset{$x}) { case 'U': $charArray = array_merge($charArray, $upper); break; case 'L': $charArray = array_merge($charArray, $lower); break; case 'N': $charArray = array_merge($charArray, $num); break; } } if (version_compare(PHP_VERSION, '4.2.0') == -1) { mt_srand((double)microtime() * 1234567); } shuffle($charArray); $pass = ''; for($x=0; $x<$length; $x++) { $pass .= $charArray[mt_rand(0, (sizeof($charArray)-1))]; } if ($returnMD5) { return array('pass'=>$pass, 'md5'=>md5($pass)); } else { return $pass; } } $data = rand_pass(10, 'ULN', true); if(isset($_GET['image'])){ $img = $_GET['image']; if(!file_exists("$img")){ // Does the file exist? or is someone messing with it? // If file doesnt exist, display a nice little message echo "File does not exists"; } else { // Lets view the image $domain = file_get_contents("domain_name.php"); echo '<br><center> <table border="0" align="center" cellpadding="0" cellspacing="0" class="small"> <tr> <td width="38" height="22">Direct Link: </td> <td width="55"> <textarea style="width: 55px; font-size:8px;" onClick="this.select();" />http://'.$domain.'/'.$img.' </textarea> </td> </tr> <tr bgcolor="#EEEEEE"> <td height="22" width="55">BBCode:</td> <td><textarea style="width: 55px; font-size:8px;" onClick="this.select();" />[img=http://'.$domain.'/'.$img.']</textarea> </td> <tr> <td height="22" width="55">HTML IMG:</td> <td> <textarea style="width: 55px; font-size:8px;" onClick="this.select();" />< img src="http://'.$domain.'/'.$img.'"></textarea> </td> </tr> </table> <a href="http://sigpick.com/upload/'.$img.'"><img src="'.$smlthumb.'" width=auto max-width="150" height=66 border=0></a> </center> '; echo ' '; } } else { if(isset($_POST['upload'])) { function check_folder($folder) { static $img_folder = '1'; if ( strlen($img_folder) == 1 ) { $img_folder = '0' . $img_folder; } if ( !file_exists($folder . $img_folder) ) { mkdir($folder . $img_folder, 0777); return $img_folder; } $dir = @opendir($folder . $img_folder); $img_count = 0; while ( $file = @readdir($dir) ) { if ( $file == '..' || $file == '.' ) { continue; } if ( is_file($file) ) { $img_count++; } } if ( $img_count >= 100 ) { $img_folder++; return check_folder($folder); } return $img_folder; } $img_folder = ( strlen(check_folder('imgs/img')) == 1 ) ? 'img0' : 'img'; $uploaddir = 'imgs/' . $img_folder . check_folder('imgs/img') . '/'; $maxfilesize = 5120; // Currently is 1 MB $filename = $_FILES['file']['name']; $filesize = $_FILES['file']['size']; $filetmpname = $_FILES['file']['tmp_name']; $allowed_types = array("jpg" , "gif" , "png" , "jpeg" , "bmp", "pdf"); $filetype = substr($filename, -3, 3); if($filename) { $error = 0; if(($filesize > $maxfilesize) || ($filesize == 0)){ $error = 1; $errmsg = "Your file is too big, limit: 5mb<br>"; // Wonder what the limit is? } else { $error = 0; } if(!in_array($filetype,$allowed_types)) { $error = 1; $errmsg .= "<meta http-equiv='refresh' content='0; URL=http://sigpick.com>"; } else { $error = 0; } if($error == 1) { echo "$errmsg"; } else { $data = rand_pass(10, 'ULN', true); $num_start = $data['pass']; // Generates a random file name $filename_new = $num_start. "." .$filetype;// Lets make a new file $upload = move_uploaded_file($filetmpname, "$uploaddir$filename_new"); if($upload) { echo '<center><img src="images/loading.gif" alt="Upoading Image"> </center>'; echo "<meta http-equiv='refresh' content='0; URL=?image=$uploaddir$filename_new'>"; } else { echo 'The system generated an unkown error'; } } }else { echo "<meta http-equiv='refresh' content='0; URL=http://sigpick.com/'>"; } } else { ?> <br> <br> <? } } ?> <br><br> </center> </body> </html>
-
PHP Thumbnails
I just need help making a thumbnail within the script Error message: Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '$' in /public_html/goxom/sp/ulod/Upload_Script/continue.php on line 60 Line 60: $thumb = new ('$_GET['image']'); $thumb->resize(250,250); $thumb->createReflection(40,40,80,true,'#a4a4a4'); <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <center><? function rand_pass($length=255, $charset='A', $returnMD5=false) { $charset = strtoupper($charset); $charArray = array(); $upper = range('A','Z'); $lower = range('a','z'); $num = range(0,9); for($x=0; $x<strlen($charset); $x++) { switch($charset{$x}) { case 'U': $charArray = array_merge($charArray, $upper); break; case 'L': $charArray = array_merge($charArray, $lower); break; case 'N': $charArray = array_merge($charArray, $num); break; } } if (version_compare(PHP_VERSION, '4.2.0') == -1) { mt_srand((double)microtime() * 1234567); } shuffle($charArray); $pass = ''; for($x=0; $x<$length; $x++) { $pass .= $charArray[mt_rand(0, (sizeof($charArray)-1))]; } if ($returnMD5) { return array('pass'=>$pass, 'md5'=>md5($pass)); } else { return $pass; } } $data = rand_pass(10, 'ULN', true); if(isset($_GET['image'])){ $img = $_GET['image']; if(!file_exists("$img")){ // Does the file exist? or is someone messing with it? // If file doesnt exist, display a nice little message echo "File does not exists"; } else { // Lets view the image $domain = file_get_contents("domain_name.php"); $thumb = new ('$_GET['image']'); $thumb->resize(250,250); $thumb->createReflection(40,40,80,true,'#a4a4a4'); echo '<br><center> <table width="834" height="76" border="0"> <tr> <td width="100" height="22">Direct Link: </td> <td width="639"><input type="text" onClick="highlight(this);" style="width: 260px" size="70" value="http://'.$domain.'/'.$img.'" /></td> </tr> <tr bgcolor="#CCCCCC"> <td height="22">BBCode:</td> <td><input type="text" onClick="highlight(this);" style="width: 260px" size="70" value="[url=http://'.$domain.'/][img=http://'.$domain.'/'.$img.'][/url]" /> </td> </tr> <tr> <td>HTML:</td> <td><input type="text" onClick="highlight(this);" style="width: 260px" size="70" value="<a href="http://'.$domain.'" target="_blank"><img src="http://'.$domain.'/'.$img.'" alt="hosted by '.$domain.'"></a>" /></td> </tr> </table> Click on the Thumbnail to view the full size of the image. </center> '; echo '<div align=\"right\"> <a href="http://'.$domain.'/'.$img.'" target="_blank><img src="'.$thumb.'" width=auto height=200 border=0></div></a><br> <br>'; echo "Size: ".filesize("".$img."")." bytes<br>\n"; echo "Type: ".substr("".$img."", -4)."<br>\n"; echo "Uploaded on: ".date("F d Y", filemtime("".$img.""))."<br>"; } } else { if(isset($_POST['upload'])) { function check_folder($folder) { static $img_folder = '1'; if ( strlen($img_folder) == 1 ) { $img_folder = '0' . $img_folder; } if ( !file_exists($folder . $img_folder) ) { mkdir($folder . $img_folder, 0777); return $img_folder; } $dir = @opendir($folder . $img_folder); $img_count = 0; while ( $file = @readdir($dir) ) { if ( $file == '..' || $file == '.' ) { continue; } if ( is_file($file) ) { $img_count++; } } if ( $img_count >= 100 ) { $img_folder++; return check_folder($folder); } return $img_folder; } $img_folder = ( strlen(check_folder('imgs/img')) == 1 ) ? 'img0' : 'img'; $uploaddir = 'imgs/' . $img_folder . check_folder('imgs/img') . '/'; $maxfilesize = 1024; // Currently is 1 MB $filename = $_FILES['file']['name']; $filesize = $_FILES['file']['size']; $filetmpname = $_FILES['file']['tmp_name']; $allowed_types = array("jpg" , "gif" , "png" , "jpeg" , "bmp", "pdf"); $filetype = substr($filename, -3, 3); if($filename) { $error = 0; if(($filesize > $maxfilesize) || ($filesize == 0)){ $error = 1; $errmsg = "Your file is too big, limit: 5mb<br>"; // Wonder what the limit is? } else { $error = 0; } if(!in_array($filetype,$allowed_types)) { $error = 1; $errmsg .= "<meta http-equiv='refresh' content='3; URL=error.php?no=2'>"; } else { $error = 0; } if($error == 1) { echo "$errmsg"; } else { $data = rand_pass(10, 'ULN', true); $num_start = $data['pass']; // Generates a random file name $filename_new = $num_start. "." .$filetype;// Lets make a new file $upload = move_uploaded_file($filetmpname, "$uploaddir$filename_new"); if($upload) { echo '<center>Uploading Your Image <br> <img src="images/loading2.gif" alt="Upoading Image"><br> <img src="images/loading.gif" alt="Upoading Image"> </center>'; echo "<meta http-equiv='refresh' content='3; URL=?image=$uploaddir$filename_new'>"; } else { echo 'The system generated an unkown error'; } } }else { echo "<meta http-equiv='refresh' content='0; URL=error.php?no=1'>"; } } else { ?> <form enctype="multipart/form-data" method="POST" action="continue.php"> Image: <input name="file" type="file" /> <input type="submit" name="upload" value="Upload" /> </form> <div class="feature"> <h3>Info</h3> <p> <?php include("includes/fs_fe.php"); ?> </p> </div> <br><br> <? } } ?> </center> </body> </html> What's Wrong, how can I fix it. I basically want to display the thumbnail with a link to the full size. Thanks.