Bonjour,

J’essayer d’enregistrer une variable javascript dans un fichier
Quand je fais un echo la variable s’affiche bien.
la variable et 23 donc OK.

Mais quand j’essayer d’enregistrer cette variable dans un fichier je reçois le code complet de javascript.

Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
<infos>
<marge1_min><script language='Javascript'>document.write(marge1_min);</script></marge1_min>
</infos>

Au lieu de
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
<infos>
<marge1_min>23</marge1_min>
</infos>


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
<?php
	if (isset($_POST['SaveOption1']))
	{
$newXml = "";
$marge1_min = "<script language='Javascript'>document.write(marge1_min);</script>"; 
	$newXml.= '<infos>'."\n";
// mes marges
	$newXml.= '<marge1_min>'. $marge1_min. stripslashes($line).'</marge1_min>'."\n";
	$newXml.= '</infos>'."\n";
	if ($fd = @fopen(dirname(__FILE__).'/marge.tmp', 'w')) 
	{
	if (!@fwrite($fd, $newXml))
	$this->_html.= $this->displayError($this->l('Unable to write to the editor file.'));
	}
	else
	$this->_html .= $this->displayError($this->l('Unable to update the editor file.<br />Please check the editor file\'s writing permissions.'));
	$this->_html .= '<div class="conf ok">'.$this->l('Settings updated').'</div>';
	}
?>
Pouvez vous m'aider SVP
Serveur perso
PHP 5.3