< >

bilder_tauschen_mit_get.php


Quell Code


<html>
<head>
<style>
form,h5{
     margin:0 auto;
     width:200px;
}
#box{
     width:60vw;
     border:3px solid grey;
     border-radius:50px;
     margin:0 auto;
     overflow:hidden;
}
#box img{
     width:100%;
}
</style>
</head>
<body>
<form>
<select name="name">
<option value="1.jpg">Bild 1</option>
<option value="2.jpg">Bild 2</option>
<option value="3.jpg">Bild 3</option>
<option value="4.jpg">Bild 4</option>
<option value="5.jpg">Bild 5</option>
<option value="6.jpg">Bild 6</option>
</select>
<input type="submit">
</form>
<h5>Hier werden dann die Bilder angezeigt</h5>
<div id="box">

</div>
<script>
    if (window.location.search != ''){
       var url = window.location.search;

var gett=url.split('=')[1];
if(gett!=''){
document.getElementById('box').innerHTML='<img src="../bilder/'+gett+'">';
}
}
</script>
</body>
</html>