Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="<?php URL ?>imagen" method="POST" enctype="multipart/form-data" >
- <input type="file" name="foto" id="boton_enviar">
- <input type="button" name="enviar" value="enviar" onclick="enviarid()">
- </form>
- function enviarid(){
- var ajax = new XMLHttpRequest()
- id = sessionStorage.getItem("id")
- ajax.open("POST","localhost/imagen",true)
- ajax.send("id="+id);
- }
- $id = $_POST["id"];
- $img = $_FILES['foto']["name"];
- $save = $_FILES['foto']['tmp_name'];
- $ruta = $img;
- copy($save, $ruta);
- echo "El id: ",$id,"subio una foto";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement