samedi 28 février 2015

Upload image to page, image is saved onto the page for staff rota HTML/PHP/JScript

Would it be possible to have an image uploaded, this image then added to preferable to a gallery so admin can go see the images uploaded without previous being replaced by new uploads...


I have this which allows for the user to upload an image which then appears, but how would i make it so this image is then always there?



<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
</style>
</head>
<body>
<input type='file' onchange="readURL(this);" />
<img id="blah" src="#" alt="your image" />

<script>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();

reader.onload = function (e) {
$('#blah')
.attr('src', e.target.result)
.width(150)
.height(200);
};

reader.readAsDataURL(input.files[0]);
}
}
</script>


Any ideas? quite new to this! thanks


Aucun commentaire:

Enregistrer un commentaire