|
|
|
Upload images restricted by pixel size
in this example x <= 200 pixel and y <= 200 pixel
NOTE:
We assume coming from a <form> html page where we have
in input some file as: <input type=file name=image>
| [code]
<?php
$size = GetImageSize("$image");
$width = $size[0] ;
$height = $size[1] ;
if($width>200 || $height>200){
print "Error.. image max size is 200x200<br>";
?><a href="javascript:history.go(-1)"><- back</a><?
exit;
}
$noinput = true;
$path="img"; //put path of dir. we assume is under actual dir. and called img
if($image != none && $image_name != "" && !empty($image_name)) {
//print("Percorso locale: $image <BR>\n");
print("File name: $image_name <BR>\n");
print("File Dimension: $image_size <BR>\n");
print("File Type: $image_type <BR>\n");
print("<HR>");
if($image!="none" &&
copy($image , "$path/$image_name" ) &&
unlink($image)){
$nofile=false;
echo "<center>";
echo "<br>File <b>".$image_name."</b> loaded successfully.<br><br>";
echo "</center>";
}else{
print "Error.. upload aborted<br>";
?><a href="javascript:history.go(-1)"><- back</a><?
exit;
}
}else{
$nofile=true;
print "... no file to upload.<br>";
}
/*
code by Marco Luzzi - www.byimage.com
*/
?> | | |
|
| Random Image Display Categories : PHP, Filesystem, Graphics, HTML and PHP | | | Creating thumbnails from MySQL Blobs online Categories : PHP, MySQL, Graphics, HTML and PHP, Databases | | | webcam cam view image ispy browser independant Categories : Graphics, HTML, HTML and PHP, PHP | | | Functions for loading images into a MySQL database and displaying them. Categories : Graphics, HTML and PHP, MySQL, PHP, Databases | | | Snipe.Net's Web Design Color Scheme Previewer- Allows uses to input hex
codes for their text, background, and link colors, and preview the color
scheme with their background image. Example:
http://www.snipe.net/tech/snipeschool/hex.php3 Categories : PHP, HTML and PHP, General, Graphics, HTML | | | PHPixel - output of 1 pixel transparent/colored gif for counters etc. Categories : PHP, Graphics, HTML and PHP | | | Barcodes On The Fly With GD Categories : Ecommerce, Graphics, HTML and PHP, PHP | | | Simple PHP/3 Access Counter (using GD and DBM functions) Categories : Databases, PHP, Graphics, HTML and PHP, dBase | | | Proportional thumbnails Categories : PHP, HTML and PHP, Graphics | | | PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality. Categories : PHP, GD image library, Graphics | | | a function that builds an HTML select list from any mysql table. Categories : PHP, MySQL, HTML and PHP | | | Tag content retrieval from websites with preg_match Categories : PHP, Regexps, Arrays, HTML and PHP | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | |
|
|
|