probleem browser compatibiliteit

Status
Niet open voor verdere reacties.

zodiak

Gebruiker
Lid geworden
9 okt 2008
Berichten
241
Hallo,

wanneer ik een bepaalde pagina oproep in firefox is alles mooi uitgeleind, wanneer ik dezelfde pagina open met iexplorer dan werkt men css niet en is alles slecht uitgeleind.

kent iemand dit probleem ? of kan iemand mij helpen?

pagina _foto.php
PHP:
<?
session_start();
if(!session_is_registered(myusername)){
header("location:../i_login.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../ike/modo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../slidshow.js"></script>
<script type="text/javascript">
<!--

SLIDES = new slideshow("SLIDES");

// Create some slides and add custom filters for Microsoft IE

SLIDES.add_slide(s = new slide('../images/0.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/1.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/2.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Fade()';

SLIDES.add_slide(s = new slide('../images/3.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/4.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/5.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/6.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/7.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';


//-->
</SCRIPT>
</SCRIPT>
<title>MODO eetcaf&eacute;: Admin</title>
</head>

<body onLoad="SLIDES.play();">

<div id="box">
   	  <div id="copyright">
      	<a href='../i_login.php'>© 2009 - Modo eetcaf&eacute;</a>      </div>
      <div id="kop">

      	&nbsp;
      </div>
	  <div id="inhoud">
      	<div id="inhoudLinks">
   	    	<!-- InstanceBeginEditable name="links" -->
            <ul>
              <li><a href='_index.php'>Modo eetcafé</a></li>
              <li><a href='_info.php'>Info</a></li><li><a href='_menu.php'>Menu</a></li><li><a href='_suggestie.php'>Suggestie</a></li><li><a href='_foto.php' class='hier'>Fotogalerij</a></li><li><a href='_plan.php'>Plan</a></li><li><a href='_reservatie.php'>Reservatie</a></li><li><a href='_cadeaubon.php'>Cadeaubon</a></li><li><a href='../index.php'>Uitloggen</a></li>              </ul>
        <IMG name="SLIDESIMG" src="../images/0.jpg"  border="0"
					  			  style="filter:progid:DXImageTransform.Microsoft.Fade()" alt="Slideshow image">

					  			  <SCRIPT type="text/javascript">
					  			  <!--

					  			  if (document.images) {

					  			  SLIDES.image = document.images.SLIDESIMG;

					  			  // Create a function to ramp up the image opacity in Mozilla
					  			  var fadein_opacity = 0.04;
					  			  var fadein_img = SLIDES.image;
					  			  function fadein(opacity) {
					  			    if (typeof opacity != 'undefined') { fadein_opacity = opacity; }
					  			    if (fadein_opacity < 0.99 && fadein_img && fadein_img.style &&
					  			        typeof fadein_img.style.MozOpacity != 'undefined') {

					  			      fadein_opacity += .05;
					  			      fadein_img.style.MozOpacity = fadein_opacity;
					  			      setTimeout("fadein()", 50);
					  			    }
					  			  }

					  			  // Tell the slideshow to call our function whenever the slide is changed
					  			  SLIDES.post_update_hook = function() { fadein(0.04); }

					  			  }


					  			  //-->
	  </SCRIPT>

        </div>
      	<div id="inhoudRechts">
        	<!-- InstanceBeginEditable name="rechts" -->

             <div class='titel'>Modo eetcaf&eacute;</div>

             <iframe src="./album/submit.php" frameborder="0" scrolling="no" width="500" height="500"></iframe>


<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<p>&nbsp;</p>        	<!-- InstanceEndEditable -->
        </div>
        <br class="clear" />
	  </div>
	  <div id="voet">
      	&nbsp;
      </div>
	</div>

</body>
</html>

include pagina submit.php
PHP:
<?php ini_set("memory_limit", "200000000"); // for large images so that we do not get "Allowed memory exhausted"?>
<?php
// upload the file
if ((isset($_POST["submitted_form"])) && ($_POST["submitted_form"] == "image_upload_form")) {

	// file needs to be jpg,gif,bmp,x-png and 4 MB max
	if (($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg" || $_FILES["image_upload_box"]["type"] == "image/gif" || $_FILES["image_upload_box"]["type"] == "image/x-png") && ($_FILES["image_upload_box"]["size"] < 2500000))
	{


		// some settings
		$max_upload_width = 2592;
		$max_upload_height = 1944;

		// if user chosed properly then scale down the image according to user preferances
		if(isset($_REQUEST['max_width_box']) and $_REQUEST['max_width_box']!='' and $_REQUEST['max_width_box']<=$max_upload_width){
			$max_upload_width = $_REQUEST['max_width_box'];
		}
		if(isset($_REQUEST['max_height_box']) and $_REQUEST['max_height_box']!='' and $_REQUEST['max_height_box']<=$max_upload_height){
			$max_upload_height = $_REQUEST['max_height_box'];
		}


		// if uploaded image was JPG/JPEG
		if($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"){
			$image_source = imagecreatefromjpeg($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was GIF
		if($_FILES["image_upload_box"]["type"] == "image/gif"){
			$image_source = imagecreatefromgif($_FILES["image_upload_box"]["tmp_name"]);
		}
		// BMP doesnt seem to be supported so remove it form above image type test (reject bmps)
		// if uploaded image was BMP
		if($_FILES["image_upload_box"]["type"] == "image/bmp"){
			$image_source = imagecreatefromwbmp($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was PNG
		if($_FILES["image_upload_box"]["type"] == "image/x-png"){
			$image_source = imagecreatefrompng($_FILES["image_upload_box"]["tmp_name"]);
		}


		$remote_file = "fotos/".$_FILES["image_upload_box"]["name"];
		imagejpeg($image_source,$remote_file,100);
		chmod($remote_file,0644);



		// get width and height of original image
		list($image_width, $image_height) = getimagesize($remote_file);

		if($image_width>$max_upload_width || $image_height >$max_upload_height){
			$proportions = $image_width/$image_height;

			if($image_width>$image_height){
				$new_width = $max_upload_width;
				$new_height = round($max_upload_width/$proportions);
			}
			else{
				$new_height = $max_upload_height;
				$new_width = round($max_upload_height*$proportions);
			}


			$new_image = imagecreatetruecolor($new_width , $new_height);
			$image_source = imagecreatefromjpeg($remote_file);

			imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);
			imagejpeg($new_image,$remote_file,100);

			imagedestroy($new_image);
		}

		imagedestroy($image_source);


		header("Location: submit.php?upload_message=Foto succesvol verstuurd &upload_message_type=success&show_image=".$_FILES["image_upload_box"]["name"]);
		exit;
	}
	else{
		header("Location: submit.php?upload_message=make sure the file is jpg, gif or png and that is smaller than 4MB&upload_message_type=error");
		exit;
	}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modo-eetcafe</title>
</head>

<body>



        <?php if(isset($_REQUEST['upload_message'])){?>
            <div class="upload_message_<?php echo $_REQUEST['upload_message_type'];?>">
            <?php echo htmlentities($_REQUEST['upload_message']);?>
            </div>
		<?php }?>


<form action="submit.php" method="post" enctype="multipart/form-data" name="image_upload_form" id="image_upload_form" style="margin-bottom:0px;">
<label style="color:#FFF">Fotos mogen maximum 2,5MB zijn en het bestandsformaat mag jpg, gif of png zijn:</label><br />
          <input name="image_upload_box" type="file" id="image_upload_box" size="40" />
          <input type="submit" name="submit" value="Upload foto" />

     <br />
	<br />


      <label>&nbsp;</label>
      <br />
      <input name="max_width_box" type="hidden" id="max_width_box" value="448" size="4">


      <input name="max_height_box" type="hidden" id="max_height_box" value="336" size="4">

      <br />
      <br />
      <p style="padding:5px; border:1px solid #212121; background-color:#212121; color:#FFF;">
      <strong>Voorbeeld:</strong><br />

  </p>



<input name="submitted_form" type="hidden" id="submitted_form" value="image_upload_form" />
          </form>




<?php if(isset($_REQUEST['show_image']) and $_REQUEST['show_image']!=''){?>
<p>
	<img src="fotos/<?php echo $_REQUEST['show_image'];?>" />
</p>
<?php }?>




</body>
</html>

alvast bedankt
 
Heeft denk ik niet zo heel veel te doen met PHP denk ik zo... Anyways, als er problemen zijn met uitlijning blabla zeg dan waar het probleem zit, en post de (zo nodig) belangrijke CSS code.
 
Heb je de pagina ergens online staan? Dat kijkt wat makkelijker.
 
Heeft denk ik niet zo heel veel te doen met PHP denk ik zo... Anyways, als er problemen zijn met uitlijning blabla zeg dan waar het probleem zit, en post de (zo nodig) belangrijke CSS code.

HTML:
html, body, #box {
	min-height: 101%;
	height: 101%;
}
* {
	font-family: Verdana,Verdana, Geneva, Arial, Helvetica, sans-serif, Geneva, Helvetica, Arial, sans-serif;
}
body {
	background-color: #333333;
	background-repeat: repeat-x;
	background-position: top;
	color: #FFF;
	font-size: small;
	margin: 0;
	margin-top: 10px;
	padding: 0;
}

a#mail {color:#FFF}
#box {
	width: 840px;
	height: 230px;
	margin: 0 auto;
}
#copyright {
	width: 100%;
	text-align: right;
	font-size: smaller;
	height: 24px;
}
#copyright a {
	color: #FFF;
	text-decoration: none;
	cursor: default;
}
#kop {
	width: 800;
	height: 220px;
	background-image: url(kop.gif);
	background-repeat: no-repeat;
	background-position: top left;
}
#inhoud {
	width: 100%;
	background-image: url(inhoud.gif);
	background-repeat: repeat-y;
	margin-top: 0px;
	padding: 0 00px 0 8px;
	
}
#voet {
	width: 100%;
	height: 20px;
	background-image: url(voet.gif);
	background-repeat: no-repeat;
	margin-bottom: 24px;
}

#inhoud .clear {
	clear: both;
}

#inhoudLinks {
	width: 210px;
	float: left;
	border-right:solid 2px #736f6e ;
	}
#inhoudRechts {
	width: 546px;
	float: right;
	margin-right: 40px;
	display: inline;
}

#inhoudLinks ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
#inhoudLinks ul li {
	width: 100%;
	font-weight: bold;
	
}
#inhoudLinks ul li a {
	width: 198px;
	padding: 6px;
	color: #FFF;
	text-decoration: none;
	display: block;
	background-color: #212121;
	margin-bottom: 1px;
	text-align: left;
}
#inhoudLinks ul li a:hover {
	background-color: #736f6e;
}
#inhoudLinks ul li a.hier {
	background-color: #736f6e;
	text-align: right;
}

#inhoudRechts .titel {
	font-size: large;
	width: 100%;
	display: block;
	text-align: left;
	letter-spacing: 2px;
	padding-bottom: 4px;
	margin-bottom: 8px;
	border-bottom: 1px solid #FFF;
	font-weight: bold;
}
#inhoudRechts .admin {
	font-size: large;
	color: #C00;
	width: 100%;
	display: block;
	text-transform: uppercase;
	text-align: right;
	letter-spacing: 2px;
	
	margin-bottom: 8px;
	font-weight: bold;
}
#inhoudRechts img.fotoRechts {
	float: right;
	padding: 3px;
	border: 1px solid #FFF;
	margin-left: 6px;
	margin-bottom: 6px;
}
#inhoudRechts img.fotoLinks {
	float: left;
	padding: 3px;
	border: 1px solid #FFF;
	margin-right: 6px;
	margin-bottom: 6px;
}

#aanemden {
	width: 100%;
}
#Modo administrator aanmelden  legend {
	color: #FFF;
	font-weight: bold;
}
#aanmelden .aanmeldTekstvak {
	width: 200px;
}

#inhoudRechts .fout {
	text-align: left;
	color: #C00;
}
#inhoudRechts img.fotoForm {
	padding: 3px;
	border: 1px solid #FFF;
	margin-bottom: 6px;
}

#inhoudRechts h1 {
	font-size: medium;	
}
#inhoudRechts h2 {
	font-size: small;	
}
#inhoudRechts h3 {
	font-size: small;	
}
#inhoudRechts h4 {
	font-size: small;	
}
#inhoudRechts h5 {
	font-size: small;	
}
#inhoudRechts h6 {
	font-size: small;	
}

 fieldset {
	
}
 #modo-administrator-aanmelden legend {
	color: #FFF;
	font-weight: bold;
	width: 100%;
}
#inhoudRechts .t300{
	width: 300px;
}
#inhoudRechts .t546x150{
	width: 546px;
	height: 120px;
}
#inhoudRechts .t200{
	width: 200px;
}
#inhoudRechts .ta200{
	width: 200px;
	height: 120px;
}
#inhoudRechts .ta300{
	width: 300px;
	height: 120px;
}
#inhoudRechts .t233{
	width: 233px;
}
#inhoudRechts .ta233{
	width: 233px;
	height: 120px;
}

#inhoudRechts .t546{
	width: 546px;
}

#ct {
	width: 100%;
	padding-bottom: 4px;
	border-bottom: 3px solid #FFF;
	margin-bottom: 6px;
}
	
}
#ct ul li a {
	text-decoration: none;
	color: #FFF;
	font-weight: bold;
	padding: 4px 12px 4px 12px;
}
#ct ul li a.hier {
	background-color: #4c2c22;
	color: #FFF;
}

#ct ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
#ct ul li {
	display: inline;

#inhoudRechts a {
	color: #FFF;
	text-decoration: none;
}
#inhoudRechts a:hover {
	color: #C00;
}

#inhoudRechts .odd {
	background-color: #EEE;
}
#inhoudRechts .even {
	background-color: #FFF;
}
/*------------------------------*/
#adgallerij {
	width: 100%;
	text-align: right;
}
#adgallerij .foto {
	float: left;
	padding: 3px;
	border: 1px solid #FFF;
	margin-right: 10px;
	margin-bottom: 10px;
}
#adgallerij .foto a {
	color: #FFF;
	text-decoration: none;
}
#adgallerij .foto a:hover {
	color: #C00;
}
#adgallerij .foto img {
	width: 90px;
	height: 90px;	
}
/*------------------------------*/

#wbgallerij {
	width: 98%;	
	padding: 1%;
	border: 1px solid #FFF;
}
#wbgallerijDetail {
	width: 100%;
}
#wbgallerijDetail .foto {
	float: left;
	width: 320px;
	height: 320px;
	margin-bottom: 10px;
}
#wbgallerijDetail .tekst {
	float: right;
	width: 200;
	height: 308px;
	padding: 6px;
	text-align: justify;
}
#wbgallerijOverzicht {
	width: 98%;
	height: 204px;
	overflow: auto;
}
#wbgallerijOverzicht img {
	float: left;
	width: 90px;
	height: 90px;
	padding: 1px;
	border: 1px solid #48F;
	margin-right: 6px;
	margin-bottom: 12px;
}

dit is mijn css code en in iexplorer neemt hij niet de achtergrond kleur over en is de uitlijning te ver naar rechts
 
Je hebt een aantal fouten in je HTML zitten:
http://validator.w3.org/check?uri=h...(detect+automatically)&doctype=Inline&group=0

Ik zou beginnen met daar naar kijken :) Daarna kun je ook nog een check doen of je CSS goed is.

Als dat allemaal werkt, dan zou het redelijk hetzelfde moeten zijn... doen ze dan nog steeds anders dan zit je helaas tegen een browser verschil te kijken, die zijn wat lastiger te fixen.

Het beste kun je daarvoor naar het HTML of CSS gedeelte gaan, daar zitten een aantal mensen die daar bekend mee zijn. (Maar eerst deze problemen fixen want dat is daar ook het eerste waar ze je heensturen ;))
 
En ook je inputs altijd afsluiten met /> ;) Er zitten enkele tussen die wel zo afgesloten worden, andere weer niet.
 
Hallo,

wanneer ik een bepaalde pagina oproep in firefox is alles mooi uitgeleind, wanneer ik dezelfde pagina open met iexplorer dan werkt men css niet en is alles slecht uitgeleind.

kent iemand dit probleem ? of kan iemand mij helpen?

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../ike/modo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../slidshow.js"></script>
<script type="text/javascript">
<!--

SLIDES = new slideshow("SLIDES");

// Create some slides and add custom filters for Microsoft IE

SLIDES.add_slide(s = new slide('../images/0.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/1.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/2.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Fade()';

SLIDES.add_slide(s = new slide('../images/3.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/4.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/5.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/6.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/7.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';


//-->
</script>
<title>MODO eetcaf&eacute;: Admin</title>
</head>

<body onLoad="SLIDES.play();">

<div id="box">
   	  <div id="copyright">
      	<a href='../i_login.php'>© 2009 - Modo eetcaf&eacute;</a>      </div>
      <div id="kop">

      	&nbsp;
      </div>
	  <div id="inhoud">
      	<div id="inhoudLinks">
   	    	<!-- InstanceBeginEditable name="links" -->
            <ul>
              <li><a href='_index.php'>Modo eetcafé</a></li>
              <li><a href='_info.php'>Info</a></li><li><a href='_menu.php'>Menu</a></li><li><a href='_suggestie.php'>Suggestie</a></li><li><a href='_foto.php' class='hier'>Fotogalerij</a></li><li><a href='_plan.php'>Plan</a></li><li><a href='_reservatie.php'>Reservatie</a></li><li><a href='_cadeaubon.php'>Cadeaubon</a></li><li><a href='../index.php'>Uitloggen</a></li>              </ul>
        <IMG name="SLIDESIMG" src="../images/0.jpg"  border="0"
					  			  style="filter:progid:DXImageTransform.Microsoft.Fade()" alt="Slideshow image">

					  			  <SCRIPT type="text/javascript">
					  			  <!--

					  			  if (document.images) {

					  			  SLIDES.image = document.images.SLIDESIMG;

					  			  // Create a function to ramp up the image opacity in Mozilla
					  			  var fadein_opacity = 0.04;
					  			  var fadein_img = SLIDES.image;
					  			  function fadein(opacity) {
					  			    if (typeof opacity != 'undefined') { fadein_opacity = opacity; }
					  			    if (fadein_opacity < 0.99 && fadein_img && fadein_img.style &&
					  			        typeof fadein_img.style.MozOpacity != 'undefined') {

					  			      fadein_opacity += .05;
					  			      fadein_img.style.MozOpacity = fadein_opacity;
					  			      setTimeout("fadein()", 50);
					  			    }
					  			  }

					  			  // Tell the slideshow to call our function whenever the slide is changed
					  			  SLIDES.post_update_hook = function() { fadein(0.04); }

					  			  }


					  			  //-->
	  </SCRIPT>

        </div>
      	<div id="inhoudRechts">
        	<!-- InstanceBeginEditable name="rechts" -->

             <div class='titel'>Modo eetcaf&eacute;</div>

             <iframe src="./album/submit.php" frameborder="0" scrolling="no" width="500" height="500"></iframe>


<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<p>&nbsp;</p>        	<!-- InstanceEndEditable -->
        </div>
        <br class="clear" />
	  </div>
	  <div id="voet">
      	&nbsp;
      </div>
	</div>

</body>
</html>


PHP:
<?php ini_set("memory_limit", "200000000"); // for large images so that we do not get "Allowed memory exhausted"?>
<?php
// upload the file
if ((isset($_POST["submitted_form"])) && ($_POST["submitted_form"] == "image_upload_form")) {

	// file needs to be jpg,gif,bmp,x-png and 4 MB max
	if (($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg" || $_FILES["image_upload_box"]["type"] == "image/gif" || $_FILES["image_upload_box"]["type"] == "image/x-png") && ($_FILES["image_upload_box"]["size"] < 2500000))
	{


		// some settings
		$max_upload_width = 2592;
		$max_upload_height = 1944;

		// if user chosed properly then scale down the image according to user preferances
		if(isset($_REQUEST['max_width_box']) and $_REQUEST['max_width_box']!='' and $_REQUEST['max_width_box']<=$max_upload_width){
			$max_upload_width = $_REQUEST['max_width_box'];
		}
		if(isset($_REQUEST['max_height_box']) and $_REQUEST['max_height_box']!='' and $_REQUEST['max_height_box']<=$max_upload_height){
			$max_upload_height = $_REQUEST['max_height_box'];
		}


		// if uploaded image was JPG/JPEG
		if($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"){
			$image_source = imagecreatefromjpeg($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was GIF
		if($_FILES["image_upload_box"]["type"] == "image/gif"){
			$image_source = imagecreatefromgif($_FILES["image_upload_box"]["tmp_name"]);
		}
		// BMP doesnt seem to be supported so remove it form above image type test (reject bmps)
		// if uploaded image was BMP
		if($_FILES["image_upload_box"]["type"] == "image/bmp"){
			$image_source = imagecreatefromwbmp($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was PNG
		if($_FILES["image_upload_box"]["type"] == "image/x-png"){
			$image_source = imagecreatefrompng($_FILES["image_upload_box"]["tmp_name"]);
		}


		$remote_file = "fotos/".$_FILES["image_upload_box"]["name"];
		imagejpeg($image_source,$remote_file,100);
		chmod($remote_file,0644);



		// get width and height of original image
		list($image_width, $image_height) = getimagesize($remote_file);

		if($image_width>$max_upload_width || $image_height >$max_upload_height){
			$proportions = $image_width/$image_height;

			if($image_width>$image_height){
				$new_width = $max_upload_width;
				$new_height = round($max_upload_width/$proportions);
			}
			else{
				$new_height = $max_upload_height;
				$new_width = round($max_upload_height*$proportions);
			}


			$new_image = imagecreatetruecolor($new_width , $new_height);
			$image_source = imagecreatefromjpeg($remote_file);

			imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);
			imagejpeg($new_image,$remote_file,100);

			imagedestroy($new_image);
		}

		imagedestroy($image_source);


		header("Location: submit.php?upload_message=Foto succesvol verstuurd &upload_message_type=success&show_image=".$_FILES["image_upload_box"]["name"]);
		exit;
	}
	else{
		header("Location: submit.php?upload_message=make sure the file is jpg, gif or png and that is smaller than 4MB&upload_message_type=error");
		exit;
	}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modo-eetcafe</title>
</head>

<body>



        <?php if(isset($_REQUEST['upload_message'])){?>
            <div class="upload_message_<?php echo $_REQUEST['upload_message_type'];?>">
            <?php echo htmlentities($_REQUEST['upload_message']);?>
            </div>
		<?php }?>


<form action="submit.php" method="post" enctype="multipart/form-data" name="image_upload_form" id="image_upload_form" style="margin-bottom:0px;">
<label style="color:#FFF">Fotos mogen maximum 2,5MB zijn en het bestandsformaat mag jpg, gif of png zijn:</label><br />
          <input name="image_upload_box" type="file" id="image_upload_box" size="40" />
          <input type="submit" name="submit" value="Upload foto" />

     <br />
	<br />


      <label>&nbsp;</label>
      <br />
      <input name="max_width_box" type="hidden" id="max_width_box" value="448" size="4">


      <input name="max_height_box" type="hidden" id="max_height_box" value="336" size="4">

      <br />
      <br />
      <p style="padding:5px; border:1px solid #212121; background-color:#212121; color:#FFF;">
      <strong>Voorbeeld:</strong><br />

  </p>



<input name="submitted_form" type="hidden" id="submitted_form" value="image_upload_form" />
          </form>




<?php if(isset($_REQUEST['show_image']) and $_REQUEST['show_image']!=''){?>
<p>
	<img src="fotos/<?php echo $_REQUEST['show_image'];?>" />
</p>
<?php }?>




</body>
</html>
 
@Zodiak: Zonder nu je hele code door te nemen: Heb je de algemene tips in je andere (eigenlijk zelfde) discussiedraad al gedaan, dus je code door de W3 validator gehaald en daarna de fouten eruit gehaald? Staat hier dus 'geschoonde' code of dezelfde als in die ander discussiedraad?

Tijs.
 
@Zodiak: Zonder nu je hele code door te nemen: Heb je de algemene tips in je andere (eigenlijk zelfde) discussiedraad al gedaan, dus je code door de W3 validator gehaald en daarna de fouten eruit gehaald? Staat hier dus 'geschoonde' code of dezelfde als in die ander discussiedraad?

Tijs.

Dit is de verbeterde versie, volgens w3c zitten er nog 6 fouten in maar versta niet waarom.
_foto.php
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../ike/modo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../slidshow.js"></script>
<script type="text/javascript">
<!--

SLIDES = new slideshow("SLIDES");

// Create some slides and add custom filters for Microsoft IE

SLIDES.add_slide(s = new slide('../images/0.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/1.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/2.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Fade()';

SLIDES.add_slide(s = new slide('../images/3.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/4.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/5.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/6.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/7.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';


//-->
</script>
<title>MODO eetcaf&eacute;: Admin</title>
</head>

<body onLoad="SLIDES.play();">

<div id="box">
   	  <div id="copyright">
      	<a href='../i_login.php'>© 2009 - Modo eetcaf&eacute;</a>      </div>
      <div id="kop">

      	&nbsp;
      </div>
	  <div id="inhoud">
      	<div id="inhoudLinks">
   	    	<!-- InstanceBeginEditable name="links" -->
            <ul>
              <li><a href='_index.php'>Modo eetcafé</a></li>
              <li><a href='_info.php'>Info</a></li><li><a href='_menu.php'>Menu</a></li><li><a href='_suggestie.php'>Suggestie</a></li><li><a href='_foto.php' class='hier'>Fotogalerij</a></li><li><a href='_plan.php'>Plan</a></li><li><a href='_reservatie.php'>Reservatie</a></li><li><a href='_cadeaubon.php'>Cadeaubon</a></li><li><a href='../index.php'>Uitloggen</a></li>              </ul>
        <img name="SLIDESIMG" src="../images/0.jpg"  border="0" style="filter:progid:DXImageTransform.Microsoft.Fade()" alt="Slideshow image">

					  			  <script type="text/javascript">
					  			  <!--

					  			  if (document.images) {

					  			  SLIDES.image = document.images.SLIDESIMG;

					  			  // Create a function to ramp up the image opacity in Mozilla
					  			  var fadein_opacity = 0.04;
					  			  var fadein_img = SLIDES.image;
					  			  function fadein(opacity) {
					  			    if (typeof opacity != 'undefined') { fadein_opacity = opacity; }
					  			    if (fadein_opacity < 0.99 && fadein_img && fadein_img.style &&
					  			        typeof fadein_img.style.MozOpacity != 'undefined') {

					  			      fadein_opacity += .05;
					  			      fadein_img.style.MozOpacity = fadein_opacity;
					  			      setTimeout("fadein()", 50);
					  			    }
					  			  }

					  			  // Tell the slideshow to call our function whenever the slide is changed
					  			  SLIDES.post_update_hook = function() { fadein(0.04); }

					  			  }


					  			  //-->
	  </script>

        </div>
      	<div id="inhoudRechts">
        	<!-- InstanceBeginEditable name="rechts" -->

             <div class='titel'>Modo eetcaf&eacute;</div>

             <iframe src="./album/submit.php" frameborder="0" scrolling="no" width="500" height="500"></iframe>


<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<p>&nbsp;</p>        	<!-- InstanceEndEditable -->
        </div>
        <br class="clear" />

	  <div id="voet">
      	&nbsp;
      </div>
      </div>

</div>
</body>
</html>

include pagina submit.php
PHP:
<?php ini_set("memory_limit", "200000000"); // for large images so that we do not get "Allowed memory exhausted"?>
<?php
// upload the file
if ((isset($_POST["submitted_form"])) && ($_POST["submitted_form"] == "image_upload_form")) {

	// file needs to be jpg,gif,bmp,x-png and 4 MB max
	if (($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg" || $_FILES["image_upload_box"]["type"] == "image/gif" || $_FILES["image_upload_box"]["type"] == "image/x-png") && ($_FILES["image_upload_box"]["size"] < 2500000))
	{


		// some settings
		$max_upload_width = 2592;
		$max_upload_height = 1944;

		// if user chosed properly then scale down the image according to user preferances
		if(isset($_REQUEST['max_width_box']) and $_REQUEST['max_width_box']!='' and $_REQUEST['max_width_box']<=$max_upload_width){
			$max_upload_width = $_REQUEST['max_width_box'];
		}
		if(isset($_REQUEST['max_height_box']) and $_REQUEST['max_height_box']!='' and $_REQUEST['max_height_box']<=$max_upload_height){
			$max_upload_height = $_REQUEST['max_height_box'];
		}


		// if uploaded image was JPG/JPEG
		if($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"){
			$image_source = imagecreatefromjpeg($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was GIF
		if($_FILES["image_upload_box"]["type"] == "image/gif"){
			$image_source = imagecreatefromgif($_FILES["image_upload_box"]["tmp_name"]);
		}
		// BMP doesnt seem to be supported so remove it form above image type test (reject bmps)
		// if uploaded image was BMP
		if($_FILES["image_upload_box"]["type"] == "image/bmp"){
			$image_source = imagecreatefromwbmp($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was PNG
		if($_FILES["image_upload_box"]["type"] == "image/x-png"){
			$image_source = imagecreatefrompng($_FILES["image_upload_box"]["tmp_name"]);
		}


		$remote_file = "fotos/".$_FILES["image_upload_box"]["name"];
		imagejpeg($image_source,$remote_file,100);
		chmod($remote_file,0644);



		// get width and height of original image
		list($image_width, $image_height) = getimagesize($remote_file);

		if($image_width>$max_upload_width || $image_height >$max_upload_height){
			$proportions = $image_width/$image_height;

			if($image_width>$image_height){
				$new_width = $max_upload_width;
				$new_height = round($max_upload_width/$proportions);
			}
			else{
				$new_height = $max_upload_height;
				$new_width = round($max_upload_height*$proportions);
			}


			$new_image = imagecreatetruecolor($new_width , $new_height);
			$image_source = imagecreatefromjpeg($remote_file);

			imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);
			imagejpeg($new_image,$remote_file,100);

			imagedestroy($new_image);
		}

		imagedestroy($image_source);


		header("Location: submit.php?upload_message=Foto succesvol verstuurd &upload_message_type=success&show_image=".$_FILES["image_upload_box"]["name"]);
		exit;
	}
	else{
		header("Location: submit.php?upload_message=make sure the file is jpg, gif or png and that is smaller than 4MB&upload_message_type=error");
		exit;
	}
}
?>

        <?php if(isset($_REQUEST['upload_message'])){?>
            <div class="upload_message_<?php echo $_REQUEST['upload_message_type'];?>">
            <?php echo htmlentities($_REQUEST['upload_message']);?>
            </div>
		<?php }?>


<form action="submit.php" method="post" enctype="multipart/form-data" name="image_upload_form" id="image_upload_form" style="margin-bottom:0px;">
<label style="color:#FFF">Fotos mogen maximum 2,5MB zijn en het bestandsformaat mag jpg, gif of png zijn:</label><br />
          <input name="image_upload_box" type="file" id="image_upload_box" size="40" />
          <input type="submit" name="submit" value="Upload foto" />

     <br />
	<br />


      <label>&nbsp;</label>
      <br />
      <input name="max_width_box" type="hidden" id="max_width_box" value="448" size="4">


      <input name="max_height_box" type="hidden" id="max_height_box" value="336" size="4">

      <br />
      <br />
      <p style="padding:5px; border:1px solid #212121; background-color:#212121; color:#FFF;">
      <strong>Voorbeeld:</strong><br />

  </p>



<input name="submitted_form" type="hidden" id="submitted_form" value="image_upload_form" />
          </form>




<?php if(isset($_REQUEST['show_image']) and $_REQUEST['show_image']!=''){?>
<p>
	<img src="fotos/<?php echo $_REQUEST['show_image'];?>" />
</p>
<?php }?>
 
We houden het gewoon bij 1 vraag over dit onderwerp :)

Dus samengevoegd
 
Hoi zodiak,
volgens w3c zitten er nog 6 fouten in maar versta niet waarom.
Je hebt je document een xhtml-Doctype meegegeven, en dan mogen de namen van tags en van eigenschappen alleen maar met kleine letters geschreven worden. In de waarden van eigenschappen (de dingen tussen de aanhalingstekens) mogen wel hoofdletters gebruikt worden, hoewel ook daar kleine letters worden aangeraden: overzichtelijker en minder kans op fouten als je het altijd doet. Dat geldt ook voor verwijzingen naar URL's (bv. in de src="..." bij images).
HTML:
<body onLoad="SLIDES.play();">
moet zijn:
HTML:
<body onload="SLIDES.play();">
Nu zijn er nog maar 5 errors. :)

De eerste is een weggelaten .../> slash op het eind van je <img> tag. Als een <tag> geen eigen </tag> afsluitend eind heeft, zoals bij een <img>, moet die er in xhtml bij (niet in gewone html). Dus:
HTML:
<img name="SLIDESIMG" src="../images/0.jpg"  ... alt="Slideshow image">
moet zijn:
HTML:
<img name="SLIDESIMG" src="../images/0.jpg"  ... alt="Slideshow image" />
Nu zijn er nog maar 0 errors. :D
  • De overige 4 werden verderop in de code veroorzaakt door deze weggelaten slash; daar kom je makkelijk van af.

Met vriendelijke groet,
Csshunter
 
Laatst bewerkt:
Blijft over de vraag: de reden van de verschillende uitlijning in FF en IE.
In mijn FF en IE7 onder WinXP zie ik geen verschil in uitlijning.
Alleen in IE is de background onder het formulier wit, en in FF het donkergrijs van de rest van de pagina.
  • Maar dat zou 'm er misschien in kunnen zitten, dat de submit.php er met een <iframe> is ingezet als aparte pagina, terwijl het helemaal geen aparte pagina (met eigen Doctype, <head> enz.) is.
Je gebruikt 'm daarentegen als php-include (véél beter dan een iframe!).
Maar dan moet de code op de _foto.php pagina niet:
HTML:
<iframe src="album/submit.php" frameborder="0" 
   scrolling="no" width="540" height="500"></iframe>
zijn, maar:
HTML:
<?php include("album/submit.php"'); ?>
Eventueel moet dan nog de css wat aangepast worden, en dan zou ie moeten werken.

Met vriendelijke groet,
CSShunter
 
PS:
Zoekmachine-optimalisatie
Ik zou van de <title> op de homepage i.p.v.:
HTML:
<title>Modo eetcaf&eacute;: WELKOM</title>
maken:
HTML:
<title>Eetcaf&eacute; MODO, Visserskaai, Oostende: gezellig en sfeervol</title>
Dan komen mensen die op Google zoeken naar "Eetcafé in Oostende", of naar "Visserskaai Oostende", ook nog eens ergens. :)
Ik zou "restaurant" als apart keyword in de <meta> opnemen.
En ik zou:
HTML:
<div class='titel'>Modo eetcaf&eacute;: Welkom</div>
vervangen door:
HTML:
<h1>Modo eetcaf&eacute; bij de Visserskaai in Oostende: welkom</h1>
Want behalve de <title> weten zoekmachines ook de <h1>, de belangrijkste kop op een pagina, erg te waarderen. Vooral als de <h1> dezelfde woorden bevat als de <title>, en deze woorden verderop in de gewone tekst ook nog eens voorkomen:
HTML:
<p>U kan er gezellig en sfeervol tafelen in een mooi kader aan de Kadzandstraat bij de Visserskaai van Oostende.</p>
En ik zou het adres (met huisnummer) ook zeker op de homepage vermelden, en niet pas op de pagina "Info".

M.vr.gr.,
CSShunter
 
Ok thanks, nu is alles van uitlijning in orde maar zit ik met een ander probleem. ik krijg de links wel goed maar na de succes melding komt nu niet in de juiste layout door.

ik vermoed dat het iets te maken heeft bij de form action en/ of bij
PHP:
header("Location: _foto.php?upload_message=Foto succesvol verstuurd &upload_message_type=success&show_image=".$_FILES["image_upload_box"]["name"]); exit;

de pagina codes op dit moement zijn:

_foto.php
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../ike/modo.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../slidshow.js"></script>
<script type="text/javascript">
<!--

SLIDES = new slideshow("SLIDES");

// Create some slides and add custom filters for Microsoft IE

SLIDES.add_slide(s = new slide('../images/0.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/1.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Pixelate()';

SLIDES.add_slide(s = new slide('../images/2.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Fade()';

SLIDES.add_slide(s = new slide('../images/3.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/4.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/5.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/6.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';

SLIDES.add_slide(s = new slide('../images/7.jpg'));
s.filter = 'progid:DXImageTransform.Microsoft.Barn()';


//-->
</script>
<title>MODO eetcaf&eacute;: Admin</title>
</head>

<body onload="SLIDES.play();">

<div id="box">
   	  <div id="copyright">
      	<a href='../i_login.php'>© 2009 - Modo eetcaf&eacute;</a>      </div>
      <div id="kop">

      	&nbsp;
      </div>
	  <div id="inhoud">
      	<div id="inhoudLinks">
   	    	<!-- InstanceBeginEditable name="links" -->
            <ul>
              <li><a href='_index.php'>Modo eetcafé</a></li>
              <li><a href='_info.php'>Info</a></li><li><a href='_menu.php'>Menu</a></li><li><a href='_suggestie.php'>Suggestie</a></li><li><a href='_foto.php' class='hier'>Fotogalerij</a></li><li><a href='_plan.php'>Plan</a></li><li><a href='_reservatie.php'>Reservatie</a></li><li><a href='_cadeaubon.php'>Cadeaubon</a></li><li><a href='../index.php'>Uitloggen</a></li>              </ul>
        <img name="SLIDESIMG" src="../images/0.jpg"  border="0" style="filter:progid:DXImageTransform.Microsoft.Fade()" alt="Slideshow image" />

					  			  <script type="text/javascript">
					  			  <!--

					  			  if (document.images) {

					  			  SLIDES.image = document.images.SLIDESIMG;

					  			  // Create a function to ramp up the image opacity in Mozilla
					  			  var fadein_opacity = 0.04;
					  			  var fadein_img = SLIDES.image;
					  			  function fadein(opacity) {
					  			    if (typeof opacity != 'undefined') { fadein_opacity = opacity; }
					  			    if (fadein_opacity < 0.99 && fadein_img && fadein_img.style &&
					  			        typeof fadein_img.style.MozOpacity != 'undefined') {

					  			      fadein_opacity += .05;
					  			      fadein_img.style.MozOpacity = fadein_opacity;
					  			      setTimeout("fadein()", 50);
					  			    }
					  			  }

					  			  // Tell the slideshow to call our function whenever the slide is changed
					  			  SLIDES.post_update_hook = function() { fadein(0.04); }

					  			  }


					  			  //-->
	  </script>

        </div>
      	<div id="inhoudRechts">
        	<!-- InstanceBeginEditable name="rechts" -->

             <div class='titel'>Modo eetcaf&eacute;</div>

<?php include('album/submit.php'); ?>


<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<p>&nbsp;</p>        	<!-- InstanceEndEditable -->
        </div>
        <br class="clear" />
</div>
	  <div id="voet">
      	&nbsp;

      </div>

</div>
</body>
</html>

submit.php
PHP:
<?php ini_set("memory_limit", "200000000"); // for large images so that we do not get "Allowed memory exhausted"?>
<?php
// upload the file
if ((isset($_POST["submitted_form"])) && ($_POST["submitted_form"] == "image_upload_form")) {

	// file needs to be jpg,gif,bmp,x-png and 4 MB max
	if (($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg" || $_FILES["image_upload_box"]["type"] == "image/gif" || $_FILES["image_upload_box"]["type"] == "image/x-png") && ($_FILES["image_upload_box"]["size"] < 2500000))
	{


		// some settings
		$max_upload_width = 2592;
		$max_upload_height = 1944;

		// if user chosed properly then scale down the image according to user preferances
		if(isset($_REQUEST['max_width_box']) and $_REQUEST['max_width_box']!='' and $_REQUEST['max_width_box']<=$max_upload_width){
			$max_upload_width = $_REQUEST['max_width_box'];
		}
		if(isset($_REQUEST['max_height_box']) and $_REQUEST['max_height_box']!='' and $_REQUEST['max_height_box']<=$max_upload_height){
			$max_upload_height = $_REQUEST['max_height_box'];
		}


		// if uploaded image was JPG/JPEG
		if($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"){
			$image_source = imagecreatefromjpeg($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was GIF
		if($_FILES["image_upload_box"]["type"] == "image/gif"){
			$image_source = imagecreatefromgif($_FILES["image_upload_box"]["tmp_name"]);
		}
		// BMP doesnt seem to be supported so remove it form above image type test (reject bmps)
		// if uploaded image was BMP
		if($_FILES["image_upload_box"]["type"] == "image/bmp"){
			$image_source = imagecreatefromwbmp($_FILES["image_upload_box"]["tmp_name"]);
		}
		// if uploaded image was PNG
		if($_FILES["image_upload_box"]["type"] == "image/x-png"){
			$image_source = imagecreatefrompng($_FILES["image_upload_box"]["tmp_name"]);
		}


		$remote_file = "/fotos/".$_FILES["image_upload_box"]["name"];
		imagejpeg($image_source,$remote_file,100);
		chmod($remote_file,0644);



		// get width and height of original image
		list($image_width, $image_height) = getimagesize($remote_file);

		if($image_width>$max_upload_width || $image_height >$max_upload_height){
			$proportions = $image_width/$image_height;

			if($image_width>$image_height){
				$new_width = $max_upload_width;
				$new_height = round($max_upload_width/$proportions);
			}
			else{
				$new_height = $max_upload_height;
				$new_width = round($max_upload_height*$proportions);
			}


			$new_image = imagecreatetruecolor($new_width , $new_height);
			$image_source = imagecreatefromjpeg($remote_file);

			imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);
			imagejpeg($new_image,$remote_file,100);

			imagedestroy($new_image);
		}

		imagedestroy($image_source);


		header("Location: submit.php?upload_message=Foto succesvol verstuurd &upload_message_type=success&show_image=".$_FILES["image_upload_box"]["name"]);
		exit;
	}
	else{
		header("Location: _submit.php?upload_message=make sure the file is jpg, gif or png and that is smaller than 2,5MB&upload_message_type=error");
		exit;
	}
}
?>

        <?php if(isset($_REQUEST['upload_message'])){?>
            <div class="upload_message_<?php echo $_REQUEST['upload_message_type'];?>">
            <?php echo htmlentities($_REQUEST['upload_message']);?>
            </div>
		<?php }?>


<form action="submit.php" method="post" enctype="multipart/form-data" name="image_upload_form" id="image_upload_form" style="margin-bottom:0px;">
<label>Fotos mogen maximum 2,5MB zijn en het bestandsformaat mag jpg, gif of png zijn:</label><br />
          <input name="image_upload_box" type="file" id="image_upload_box" size="40" />
          <input type="submit" name="submit" value="Upload foto" />

     <br />
	<br />


      <label>&nbsp;</label>
      <br />
      <input name="max_width_box" type="hidden" id="max_width_box" value="448" size="4">


      <input name="max_height_box" type="hidden" id="max_height_box" value="336" size="4">

      <br />
      <br />
      <p>
      <strong>Voorbeeld:</strong><br />

  </p>



<input name="submitted_form" type="hidden" id="submitted_form" value="image_upload_form" />
          </form>




<?php if(isset($_REQUEST['show_image']) and $_REQUEST['show_image']!=''){?>
<p>
	<img src="/fotos/<?php echo $_REQUEST['show_image'];?>" />
</p>
<?php }?>

heb ook al geprobeert om van deze twee files 1 file te maken maar dat blijft hetzelfde

heeft er iemand raad?
 
Laatst bewerkt door een moderator:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan