Jump to content

Picture size limit when uploading


MDanz

Recommended Posts

I want the the max size allowed to be uploaded 100px x 100px.  how do i do that?

 

<?php
session_start();
include("connect1.php");
   $username= $_SESSION['username'];
if ($_SESSION['username'])
{
  


if($_POST['Upload']) {

//get file attributes
$name = $_FILES['myfile']['name'];
$tmp_name = $_FILES['myfile']['tmp_name'];

          if($name)
          {
	  $location = "avatars/$name";
	  	move_uploaded_file($tmp_name, "avatars/".$name);
		$query = mysql_query("UPDATE Users SET imagelocation='$location' WHERE username='$username'");
          
                        die("<font color=white>Your Avatar has been uploaded.  <a href='member.php'>Return to Upload Page</a></font>");
          
          }

}
echo "<font color=white>Upload your image:</font>
      <form action='upload.php' method='POST' enctype='multipart/form-data'>
      <input type='file' name='myfile'><input type='submit' name='Upload' value='Upload'>

      </form>";
}
?>
<p align="center"><a href="http://www.fdsfddf.com/Index.php">
<img src="U-stack Another Logo.jpg" width="145" height="111" border="0" /></a></p>
<p> </p>
<p> </p>

<div align="center">
  <style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style>
  
</div>
<title>U-Stack</title>

Link to comment
https://forums.phpfreaks.com/topic/172075-picture-size-limit-when-uploading/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.