|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: |
<br />
<?
if($_SERVER['REQUEST_METHOD']!='POST') {
?>
</p>
<p> </p>
<form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="Photo Uploader" id="Photo Uploader">
<table width="375" style="background-color: #FFFFFF;border:1px solid; border-color:#DDDDDD;" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="365" style="font-weight:normal; color:#000000;background-color:#FFFFFF;">Upload your car or event photos here:</td>
</tr>
<tr>
<td style="text-align:left"><input name="file" type="file" size="35" /></td>
</tr>
<tr>
<td style="text-align:center"><input type="submit" name="Submit" value=":.Send.:" /></td>
</tr>
</table>
</form>
<?
} else {
$message = "";
$validExtensions[] = "jpg";
$validExtensions[] = "jpeg";
$validExtensions[] = "gif";
$validExtensions[] = "png";
$sentFileSize = ceil($_FILES['file']['size']/1024);
# this way is more accurate for the extension
$sentFileExtension = explode(".", $_FILES['file']['name']);
$number = count($sentFileExtension);
$sentFileExtension = strtolower($sentFileExtension[$number-1]);
if(!in_array($sentFileExtension, $validExtensions)) {
$message = "<span style=\"color:black; font size:11px\"><br>Your photo has <span style=\"color:red\">NOT</span> been uploaded,";
$message .= " because of an invalid file type. <br>We only accept .JPG, .GIF and .PNG files.</span>";
} else {
// SAVE THE FILE
$uploaddir = 'images/user_photo_uploads/';
if (file_exists('images/photo_uploader_count.txt')) {
$handle = fopen('images/photo_uploader_count.txt','r+');
$newFileNumber = fread($handle,filesize('images/photo_uploader_count.txt'))+1;
fclose($handle);
$handle = fopen('images/photo_uploader_count.txt','w');
fwrite($handle,$newFileNumber.'');
fclose($handle);
} else {
$handle = fopen('images/photo_uploader_count.txt','x');
fwrite($handle,'1');
$newFileNumber = 1;
}
$uploadfile = $uploaddir . basename($newFileNumber . "." . $sentFileExtension);
$bron = $_FILES['file']['tmp_name'];
$maxbreedte = 1024;
}
if(!empty($bron)){
$dimensies = getimagesize($bron);
$breedte = $dimensies[0];
$hoogte = $dimensies[1];
if($breedte > $maxbreedte){
$nieuwebreedte = $maxbreedte;
$deelfactor = $breedte / $maxbreedte;
$nieuwehoogte = $hoogte / $deelfactor;
switch ($dimensies['mime']) {
case 'image/jpeg':
$image = imagecreatefromjpeg($bron);
$destination = imagecreatetruecolor($nieuwebreedte, $nieuwehoogte);
imagecopyresampled($destination, $image, 0, 0, 0, 0, $nieuwebreedte, $nieuwehoogte, $breedte, $hoogte);
imagejpeg($destination, $uploadfile);
imagedestroy($image);
imagedestroy($destination);
break;
case 'image/gif':
$image = imagecreatefromgif($bron);
$destination = imagecreate($nieuwebreedte, $nieuwehoogte);
imagecopyresampled($destination, $image, 0, 0, 0, 0, $nieuwebreedte, $nieuwehoogte, $breedte, $hoogte);
imagegif($destination, $uploadfile);
imagedestroy($image);
imagedestroy($destination);
break;
case 'image/png':
$image = imagecreatefrompng($bron);
$destination = imagecreate($nieuwebreedte, $nieuwehoogte);
imagecopyresampled($destination, $image, 0, 0, 0, 0, $nieuwebreedte, $nieuwehoogte, $breedte, $hoogte);
imagepng($destination, $uploadfile);
imagedestroy($image);
imagedestroy($destination);
break;
}
} else {
$uploadfile = $uploaddir . basename($newFileNumber. "." .$sentFileExtension);
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
chmod($uploadfile, 0644);
$message = "Your photo has been saved successfully, to upload another, click Back and repeat.<br>";
} else {
$message = "There was an error uploading the file, please try again!";
}
}
}
if (is_file($uploadfile)) {
$message = "<span style=\"color:black; font size:11px\"><br>Your photo has been saved successfully, to upload<br>another, click your browsers back button and repeat.<br>";
} else {
$message .= "<span style=\"color:black; font size:11px\"><br><br>Please click your browsers back button to try again.";
}
?>
<br /><table width="500" style="background-color:#FFFFFF;border:1px solid; border-color:#DDDDDD;" border="0" cellspacing="2" cellpadding="2">
<tr>
<td style="font-weight:normal; color:#000000;background-color:#FFFFFF;">Photo upload result:</td>
</tr>
<tr>
<td style="text-align:center"><? echo $message ?></td>
</tr>
</table>
<?
}
?>
|
Advertisement
| Hall of Fame |