Bonjour @ tous,

J'essaie de faire de la copie de fichier via ajax.
J'ai un script php qui me copie mon fichier.
Ce script s'appelle betement copy.php
j'ai un bete fichier HTML (enfin php)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php 
	session_start();
	require_once("Environment.php");
	require_once("Repository.php");
  //require_once("header.php");
	$client=$_POST["env"];
	$dl=$_SESSION["repository"];
	$type=$_SESSION["type"];
	$array = array("env" => $client, "type" => $type, "repository" => $dl);
	if(isset($_POST["comp"]) && $_POST["comp"]!="") 
	{
		$array["comp"]=$_POST["comp"];
	}
	$comp = new Environment($array);
	$_SESSION["comp"]=serialize($comp);
	echo "<table><tbody>";
	echo "<tr><td>Nom du site</td><td>".$comp->get_name()."</td></tr>";
	echo "<tr><td>Type de licence</td><td>".$comp->show_licence_type()."</td></tr>";
	echo "<tr><td>R&eacute;pertoire de t&eacute;l&eacute;chargement : </td><td>".$comp->get_folder()."</td></tr>";
	echo "</tbody></table>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Interface de gestion des comptes</title>
		<link rel="stylesheet" type="text/css" href="style.css" />
		<script src="ajax.js" type="text/javascript"></script>
	</head>
	<body>
<fieldset>
  <legend>Action possible</legend>
    	<input type="button" id="env-copy" value="Copier licence" />
</fieldset>
<?php require_once('footer.php'); ?>
et quand j'affiche cette page, la variable jacvascript copy_button est null.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
window.onload=__init__();
function __init__()
{
	var copy_button=document.getElementById("env-copy");
  var xhr = null; 
	if(window.XMLHttpRequest) 
	{
		xhr = new XMLHttpRequest(); 
	}
	else if(window.ActiveXObject) 
	{
		xhr = new ActiveXObject("Microsoft.XMLHTTP"); 
	}
	else 
	{ 
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	}
 
	if(copy_button!=null && copy_button!=undefined && copy_button!="")
  {
    copy_button.onclick=copy_licence;
  }
}
function copy_licence( )
{
	xhr.open("get", "./copy.php", true);
	xhr.onreadystatechange = function() 
	{ 
		if(xhr.readyState == 4) 
		{
			alert(xhr.responseText);
		}
	} 
}
Sauriez vous pourquoi ?

--Merci de vos réponses--