title: Save DOM Element using PHP
body: <p>I have this video element in my webpage:</p>
  
  <pre><code>    &lt;video height="240" width="412" id="video" controls="controls"&gt;
      &lt;/video&gt;
  &lt;button type="button"  id ="url_go" name="url_go" onclick="showUploadDiv()"&gt; Load &lt;/button&gt;
  &lt;form id="upload" action="save.php" method="post" enctype="multipart/form-data"&gt;
  &lt;button type="submit" &gt; Save &lt;/button&gt;
  </code></pre>
  
  <p>and it has a dynamic url loaded in this way:</p>
  
  <pre><code>function showUploadDiv()
  {
      if ($("#url").val()==null || $("#url").val()=="")
          return false; 
  
      var video = document.getElementById('video');
      video.src = $("#url").val();
      video.controls = true;
      video.height = 240; 
      video.width = 412;
      document.getElementById('url').value="";
  }
  </code></pre>
  
  <p>I upload a video (set the value url) in my webpage with the button <code>load</code>. After that I want to save my element <code>video</code>.
  My problem is in the file <code>save.php</code>, where I want to save the video element with the new URL loaded. In this code I save the webpage elements in a new webpage but the video hasn't the url value loaded:</p>
  
  <pre><code>&lt;?php
      $ourFileName = "testFile.html";
      $ourFileHandle = fopen($ourFileName, 'w+') or die("can't open file");
      fwrite($ourFileHandle, file_get_contents("index.html"));
      fclose($ourFileHandle);
  ?&gt;
  </code></pre>
  
  <p>Anybody has a solution? </p>