Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <form action="<?php URL ?>imagen" method="POST" enctype="multipart/form-data" >
  2. <input type="file" name="foto" id="boton_enviar">
  3. <input type="button" name="enviar" value="enviar" onclick="enviarid()">
  4. </form>
  5.  
  6. function enviarid(){
  7. var ajax = new XMLHttpRequest()
  8. id = sessionStorage.getItem("id")
  9. ajax.open("POST","localhost/imagen",true)
  10. ajax.send("id="+id);
  11.  
  12. }
  13.  
  14. $id = $_POST["id"];
  15. $img = $_FILES['foto']["name"];
  16. $save = $_FILES['foto']['tmp_name'];
  17. $ruta = $img;
  18. copy($save, $ruta);
  19. echo "El id: ",$id,"subio una foto";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement