Texte qui grossit comme par magie!

Nouveau WRInaute
Bon le titre est un peu exagéré car chaque chose à une explication mais la je reste perplex.
Voici mon site à la base:
26239172.jpg


et l'image lorsque le script d'upload d'une photo à été effectué, suivit d'un rafraichissement de la page.
68003434.jpg


Voici le fichier en question. Si quelqu'un remarque qq chose qui pourrait etre la source du problème.
Code:
<?php
	session_start();
	if (!isset($_SESSION['loginmb'])) {
		header ('Location: index.php');
		exit();
	}
	echo '<?xml version="1.0" encoding="UTF-8"?>'; # Inclusion de l'encodage.
	$page='Galerie';
	$loginsession=$_SESSION['loginmb']; 
	
if(isset($_FILES['uploadfile'])){
	//----------------------------------------- start edit here ---------------------------------------------//
	$script_location = "http://demo.zmeutz.com/image_upload/"; // location fo the script
	$maxlimit = 9048576; // maxim image limit
	$folder = "photos"; // folder where to save images

	// requirements
	$minwidth = 400; // minim width
	$minheight = 400; // minim height
	$maxwidth = 2000; // maxim width
	$maxheight = 1500; // maxim height

	// allowed extensions
	$extensions = array('.png', '.gif', '.jpg', '.jpeg','.PNG', '.GIF', '.JPG', '.JPEG');
	//----------------------------------------- end edit here ---------------------------------------------//

	// check that we have a file
	if((!empty($_FILES["uploadfile"])) && ($_FILES['uploadfile']['error'] == 0)) {

	// check extension
	$extension = strrchr($_FILES['uploadfile']['name'], '.');
	if (!in_array($extension, $extensions))	{
		echo 'Mauvais format. Les formats autorisés sont png,gif,jpg et jpeg
		<script language="javascript" type="text/javascript">window.top.window.formEnable();</script>';
	} else {

	// get file size
	$filesize = $_FILES['uploadfile']['size'];

	// check filesize
	if($filesize > $maxlimit){ 
		echo "Le poids de l'image est trop lourd.";
	} else if($filesize < 1){ 
		echo "L\'image n'est pas correcte.";
	} else {

	// temporary file
	$uploadedfile = $_FILES['uploadfile']['tmp_name'];

	// capture the original size of the uploaded image
	list($width,$height) = getimagesize($uploadedfile);

		// check if image size is lower
		if($width < $minwidth || $height < $minheight){ 
			echo 'L\'image est trop petite. Minimum requis '.$minwidth.'x'.$minheight.'
			<script language="javascript" type="text/javascript">window.top.window.formEnable();</script>';
		} else if($width > $maxwidth || $height > $maxheight){ 
			echo 'L\'image est trop grande. Maximum requis '.$maxwidth.'x'.$maxheight.'
			<script language="javascript" type="text/javascript">window.top.window.formEnable();</script>';
		} else {

	// all characters lowercase
	$filename = strtolower($_FILES['uploadfile']['name']);

	// replace all spaces with _
	$filename = preg_replace('/\s/', '_', $filename);

	// extract filename and extension
	$pos = strrpos($filename, '.'); 
	$basename = substr($filename, 0, $pos); 
	$ext = substr($filename, $pos+1);

	// get random number
	$rand = time();

	// image name
	$image = $basename .'-'. $rand . "." . $ext;

	// check if file exists
	$check = $folder . '/' . $image;
		if (file_exists($check)) {
			echo 'L\'image existe déjà.';
		} else {
		// check if it's animate gif
		$frames = exec("identify -format '%n' ". $uploadedfile ."");
			if ($frames > 1) {
				// yes it's animate image
				// copy original image
				copy($_FILES['uploadfile']['tmp_name'], $folder . '/' . $image);

				// orignal image location
				$write_image = $folder . '/' . $image;
			} else {

		// create an image from it so we can do the resize
		 switch($ext){
		  case "gif":
			$src = imagecreatefromgif($uploadedfile);
		  break;
		  case "jpg":
			$src = imagecreatefromjpeg($uploadedfile);
		  break;
		  case "jpeg":
			$src = imagecreatefromjpeg($uploadedfile);
		  break;
		  case "png":
			$src = imagecreatefrompng($uploadedfile);
		  break;
		 }

		// copy original image
		copy($_FILES['uploadfile']['tmp_name'], $folder . '/' . $image);

		// orignal image location
		$write_image = $folder . '/' . $image;

		// create first thumbnail image - resize original to 80 width x 80 height pixels 
		if($height<$width){$newheight = ($height/$width)*70; $newwidth =70;}
					   else{$newwidth = ($width/$height)*70; $newheight =70;}
		$tmp=imagecreatetruecolor($newwidth,$newheight);
		imagealphablending($tmp, false);
		imagesavealpha($tmp,true);
		$transparent = imagecolorallocatealpha($tmp, 255, 255, 255, 127);
		imagefilledrectangle($tmp, 0, 0, $newwidth, $newheight, $transparent);
		imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);

		// write thumbnail to disk
		$write_thumbimage = $folder .'/thumb-'. $image;
		 switch($ext){
		  case "gif":
			imagegif($tmp,$write_thumbimage);
		  break;
		  case "jpg":
			imagejpeg($tmp,$write_thumbimage,100);
		  break;
		  case "jpeg":
			imagejpeg($tmp,$write_thumbimage,100);
		  break;
		  case "png":
			imagepng($tmp,$write_thumbimage);
		  break;
		 }

		// create second thumbnail image - resize original to 125 width x 125 height pixels 
		if($height<$width){$newheight = ($height/$width)*700; $newwidth =700;}
					   else{$newwidth = ($width/$height)*700; $newheight =700;}

		$tmp=imagecreatetruecolor($newwidth,$newheight);
		imagealphablending($tmp, false);
		imagesavealpha($tmp,true);
		$transparent = imagecolorallocatealpha($tmp, 255, 255, 255, 127);
		imagefilledrectangle($tmp, 0, 0, $newwidth, $newheight, $transparent);
		imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);

		// write thumbnail to disk
		$write_thumb2image = $folder .'/thumb2-'. $image;
		 switch($ext){
		  case "gif":
			imagegif($tmp,$write_thumb2image);
		  break;
		  case "jpg":
			imagejpeg($tmp,$write_thumb2image,100);
		  break;
		  case "jpeg":
			imagejpeg($tmp,$write_thumb2image,100);
		  break;
		  case "png":
			imagepng($tmp,$write_thumb2image);
		  break;
		 }

		// all is done. clean temporary files
		imagedestroy($src);
		imagedestroy($tmp);

			  }
			}
		  }
		}
			// database connection
			include('login.php');
			// insert into mysql database and show success message
			mysql_query("INSERT INTO `modelBook_photos` (`id`, `name`, `position`) VALUES (NULL, 'thumb-". $image ."', '1')");
			header('Location: admin-galerie.php');
		  }
			// error all fileds must be filled
	}else {
		echo '<div class="wrong">Cette photo a déjà été envoyé.</div>'; }
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
	<?php require_once('meta.php'); ?>
	<link rel="stylesheet" href="stylebook.css" type="text/css" />
	<script type="text/javascript" src="script/jquery-1.7.1.min.js"></script>
	<link rel="stylesheet" href="jquery-ui-1.8.16.custom.css" type="text/css" />
	<script type="text/javascript" src="scripts/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="scripts/ajax.js"></script>
	<script type="text/javascript">
	$(document).ready( function(){ // quand la page a fini de se charger
	  $("#list-photos").sortable({ // initialisation de Sortable sur #list-photos
		placeholder: 'highlight', // classe à ajouter à l'élément fantome
		update: function() {  // callback quand l'ordre de la liste est changé
			var order = $('#list-photos').sortable('serialize'); // récupération des données à envoyer
			$.post('ajax.php',order); // appel ajax au fichier ajax.php avec l'ordre des photos
		}
	  });
	  
	});
	</script>
</head>
<body> 
	<div id="entete">
		Retrouvez-nous sur <a href="https://www.google.fr" />Facebook</a><br />
		<div id="logo">
			<table>
				<tr><td>
				<a href="index.php"><img src="images/logo.png" /></a>
				</td>
				<td style="width:453px;">
					<?php require_once('menu.php'); ?>
				</td><td>
				<div id="connexion">
					<div id="connexiontext">
						Bonjour <span class="textsession"><?php echo $_SESSION['loginmb']; ?></span> !<br />
						<a href="deco.php" class="subbox"><img src="images/deconnexion.jpg" /></a>
					</div>
				</div>
				</td></tr>
			</table>
		</div>
	</div>
	<div id="menuadmin">
		<?php require_once('menuadmin.php'); ?>
	</div>
	<div id="corps">
		<table>
			<tr>
				<td style="vertical-align:top;width:700px;">
					<div class="titreadmin">Photos de votre galerie</div>
				</td>
				<td style="vertical-align:top;width:200px;">
					<div class="titreadmin">Ajouter une photo</div>
				</td>
			</tr>
			<tr>
				<td style="vertical-align:top;">
					<ul id="list-photos">
						<?php
						//connexion à la base de données 
						require('login.php');
					 
						// récupération des photos dans le bon ordre
						$result =   mysql_query( 'SELECT id, name, position FROM modelBook_photos ORDER BY position ASC' , $base );
						while( $photo = mysql_fetch_assoc( $result ))
						{
						?>
						<li id="photo_<?php echo $photo['id'] ?>" >
							<table>
							<tr><td style="height:75px;width:75px;text-align:center;">
							<img src="photos/<?php echo $photo['name'] ?>" alt="ModelBook" />
							</td></tr><tr><td>
							<p><a href="del.php?id=<?php echo $photo['id'] ?>"><img src="images/trash.gif" /></a></p>
							</td></tr>
							</table>
						</li>
						<?php
						}
						?>
					</ul>
				</td>
				<td style="vertical-align:top;">
						
					<form action="" style="border:1px solid #e0e0e0; padding:5px;" method="post" name="image_upload" id="image_upload" enctype="multipart/form-data">
						<label class="texteAjoutPhoto">Image (jpg, png, gif)</label><br />
						<input type="file" size="12" name="uploadfile" id="uploadfile" class="file margin_5_0" onChange="javascript:submit()"  />
						<div id="upload_area" class="corners align_center" style="color:#f68500;">
							Sélectionnez une image
						</div>
					</form>
					
					<p class="texteAjoutPhoto">Pas de photos non conformes aux règles décrites dans les CGU (pas de photos vulgaires, pornographique, racistes ou xenophobie...) sous peine de supression de compte sans préavis.</p>
				</td>
			</tr>
		</table>
	</div>
	<div id="footer">
		<img src="images/ligne.jpg" />
		© 2011  |  <a href="#">Condition générale d’utilisation</a> 
	</div>
</body>
</html>
 
Nouveau WRInaute
Yes! C'est ca Marie-Aude! J'ai mis le scripte en dessous du l'appel css et ca marche!
Il y a certaines choses que je comprendrai jamais. Pour moi rafraîchir une page réaffiche tout comme si on venait sur la page naturellement. Bizarre qu'il faille changer l'ordre des éléments pour que ca s'affiche correctement.
 
Haut