Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/08/2015, 06:57
maitara
 
Fecha de Ingreso: julio-2015
Mensajes: 21
Antigüedad: 8 años, 9 meses
Puntos: 0
Respuesta: porque una parte del codigo me aparece en la pagina web

este es mi codigo entero cuando lo pongo entre <? y ?>
me sale este error

parse error syntax error,unexpected '}' in perfil.php on line 374





Código PHP:
Ver original
  1. <?
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. $add="imagenes/upimg/".$_FILES['fichero']['name']; // the path with the file name where the file will be stored, upload is the directory name.
  9.  
  10.  
  11.  
  12. //echo $add;
  13. if(move_uploaded_file ($_FILES['fichero']['tmp_name'],$add)){
  14. echo "Successfully uploaded the mage";
  15. chmod("$add",0777);
  16.  
  17. }else{
  18. echo "Failed to upload file Contact Site admin to fix the problem";
  19. }
  20.  
  21.  
  22.  
  23. ///////// Start the thumbnail generation//////////////
  24. $n_width=200;          // Fix the width of the thumb nail images
  25. $n_height=200;         // Fix the height of the thumb nail imaage
  26. ////////////////////////////////////////////
  27.  
  28. $tsrc="imagenes/thimg/".$_FILES['fichero']['name'];   // Path where thumb nail image will be stored
  29. //echo $tsrc;
  30. if (!($_FILES['fichero']['type'] =="image/jpeg" OR $_FILES['fichero']['type']=="image/gif")){echo "Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>";
  31. /////////////////////////////////////////////// Starting of GIF thumb nail creation///////////
  32. if (@$_FILES['fichero']['type']=="image/gif")
  33. {
  34. $width=ImageSx($im);              // Original picture width is stored
  35. $height=ImageSy($im);                  // Original picture height is stored
  36. $n_height=($n_width/$width) * $height; // Add this line to maintain aspect ratio
  37. $newimage=imagecreatetruecolor($n_width,$n_height);
  38. imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
  39. if (function_exists("imagegif")) {
  40. Header("Content-type: image/gif");
  41. ImageGIF($newimage,$tsrc);
  42. }
  43. elseif (function_exists("imagejpeg")) {
  44. Header("Content-type: image/jpeg");
  45. ImageJPEG($newimage,$tsrc);
  46. }
  47. chmod("$tsrc",0777);
  48. }////////// end of gif file thumb nail creation//////////
  49.  
  50. ////////////// starting of JPG thumb nail creation//////////
  51. if($_FILES['fichero']['type']=="image/jpeg"){
  52. $width=ImageSx($im);              // Original picture width is stored
  53. $height=ImageSy($im);             // Original picture height is stored
  54. $n_height=($n_width/$width) * $height; // Add this line to maintain aspect ratio
  55. $newimage=imagecreatetruecolor($n_width,$n_height);                
  56. imageCopyResized($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height);
  57. ImageJpeg($newimage,$tsrc);
  58. chmod("$tsrc",0777);
  59. }
  60.  
  61. ////////////////  End of JPG thumb nail creation //////////
  62. echo "<br>width = ($width) $n_width , height = ($height) $n_height ";
  63.                                                
  64. ?>
  65.  
  66.  
  67. <?
  68.  
  69.  
  70.   //insertamos en la BD los campos del form  
  71.  if(isset($_SESSION['usuario_id'])) // Aqui actualizaremos el perfil del usuario en la base de datos y le mostraremos que esta conectado
  72. {
  73. $orden = ("select * from usuarios where usuario_id = ". $_SESSION['usuario_id'] ."");
  74.  
  75. $reg = mysql_query("INSERT INTO datos (usuario_id, fichero, descripcion, usuario_freg) VALUES ('".$usuario_id."', '".$_FILES['fichero']['name']."', '".$descripcion."', NOW())");
  76.    
  77.    
  78. }
  79.  
  80.                                       }else{echo "no se guardo la foto, ni se inserto  en la Base de Datos";}  
  81.                      }else{echo "no se subio foto";}  
  82.            }else{echo "";}