<?php $imgs = $_GET["img"]; $cod = $imgs = $_GET["cod"]; $id = $_GET["id"]; $imagem = "$cod/$id/$imgs"; $img = ""; $tam = 200; $ext = @strtolower(end(explode(".", $imagem))); if ($ext == "jpg" || $extensao == "jpeg") $img = @imagecreatefromjpeg($imagem); else if ($ext == "png") $img = @imagecreatefrompng($imagem); else if ($ext == "gif") $img = @imagecreatefromgif($imagem); $ox = imagesx($img); $oy = imagesy($img); $x = $ox; $y = $oy; if ($x >= $y) { if ($x > $tam) { $x1= (int)($x * ($tam/$x)); $y1= (int)($y * ($tam/$x)); } else { $x1= $x; $y1= $y; } } else { if ($y > $tam) { $x1= (int)($x * ($tam/$y)); $y1= (int)($y * ($tam/$y)); } else { $x1= $x; $y1= $y; } } $x = $x1; $y = $y1; $img_final = @ImageCreateTrueColor($x, $y); @ImageCopyResampled($img_final, $img, 0, 0, 0, 0, $x+1, $y+1, $ox, $oy); header("Content-type: image/jpeg"); imagejpeg($img_final); ?> Code (markup): Warning: imagesx(): supplied argument is not a valid Image resource in /home/xxxxx/thumb.php on line 16 Warning: imagesy(): supplied argument is not a valid Image resource in /home/xxxx/thumb.php on line 17 Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/thumb.php:16) in /home/xxx/thumb.php on line 49 Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/xxxx/thumb.php on line 50
Exactly that was the problem. But any way whenever you need some help, it would be a pleasure to help you out.
Im just starting to read and learn about php recently, can i ask was it because of the lack of space between $ and cod in that $cod = $imgs = $_GET["cod"]; Im brand new to the stuff, its all helpful to understand this better. Hope you both dont mind me asking.
No it was because in this code $cod = $imgs = $_GET["cod"]; Code (markup): I Had to assign the value of $_GET["cod"]; to $cod which by mistakely i added another variable $imgs = which wasnt needed
No Problem Mate i guess any problem u have u can just post in this section some1 or the other does surely help out Regards