|
|
|
|
|
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
*/
?> | | |
|
| Proportional thumbnails Categories : PHP, HTML and PHP, Graphics | | | Simple PHP/3 Access Counter (using GD and DBM functions) Categories : Databases, PHP, Graphics, HTML and PHP, dBase | | | Functions for loading images into a MySQL database and displaying them. Categories : Graphics, HTML and PHP, MySQL, PHP, Databases | | | Using PHP im HTML image tags Categories : PHP, HTML and PHP, Graphics, Beginner Guides | | | PHPixel - output of 1 pixel transparent/colored gif for counters etc. Categories : PHP, Graphics, HTML and PHP | | | 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 | | | webcam cam view image ispy browser independant Categories : Graphics, HTML, HTML and PHP, PHP | | | Barcodes On The Fly With GD Categories : Ecommerce, Graphics, HTML and PHP, PHP | | | Creating thumbnails from MySQL Blobs online Categories : PHP, MySQL, Graphics, HTML and PHP, Databases | | | Random Image Display Categories : PHP, Filesystem, Graphics, HTML and PHP | | | 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 | | | background music script for random notes in a frame Categories : PHP, Content Management, HTML and PHP | | | Dynamic Calendar in PHP, Javascript and HTML. Categories : PHP, Java Script, HTML and PHP, Calendar | | | Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used. Categories : HTML and PHP, PHP, Date Time | | | How To Create a PDF Using PHP Categories : PHP, PDF, PHP Classes, HTML and PHP | |
| |
| |
|