WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Upload images restricted by pixel size (Picture width and Picture Height)
Categories : PHP, HTML and PHP, Graphics Click here to Update Your Picture
Marco Luzzi
Date : Aug 11th 2004
Grade : 2 of 5 (graded 2 times)
Viewed : 12957
File : 3975.php
Images : No Images for this code example.
Search : More code by Marco Luzzi
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 


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