OVH Cloud OVH Cloud

Incomprehensible

25 réponses
Avatar
shmol
Bonsoir

d'un coté un code html:


<body>
<form id="form1" name="form1" method="post" action="inscription.php">
<label>nom
<input name="nom" type="text" id="nom" />
</label>
<br />
<input name="prenom" type="text" id="prenom" />
<br />
<input name="mail" type="text" id="mail" />
<br />
<input type="submit" name="Submit" value="Envoyer" />
</form>

De l'autre le inscription .php

<?
$text="Nom: ".$nom.chr(10).chr(13)."Prenom: ".$prenom.chr(10).chr(13)."Mail:
".$mail.chr(10).chr(13);
mail("inscription@20h00.info", "Inscription",$text);
header("Location:merci.htm");
?>

Et donc je recois le mail.. Mais pas les données ... Une idée?

10 réponses

1 2 3
Avatar
shmol
Info importante le meme code marche sur un autre serveur


"shmol" a écrit dans le message de news:
4432d9fc$0$20159$
Bonsoir

d'un coté un code html:


<body>
<form id="form1" name="form1" method="post" action="inscription.php">
<label>nom
<input name="nom" type="text" id="nom" />
</label>
<br />
<input name="prenom" type="text" id="prenom" />
<br />
<input name="mail" type="text" id="mail" />
<br />
<input type="submit" name="Submit" value="Envoyer" />
</form>

De l'autre le inscription .php

<?
$text="Nom: ".$nom.chr(10).chr(13)."Prenom:
".$prenom.chr(10).chr(13)."Mail: ".$mail.chr(10).chr(13);
mail("", "Inscription",$text);
header("Location:merci.htm");
?>

Et donc je recois le mail.. Mais pas les données ... Une idée?





Avatar
Dominique ROUSSEAU
Le mar, 04 avr 2006 at 20:41 GMT, shmol a écrit :
De l'autre le inscription .php

<?
$text="Nom: ".$nom.chr(10).chr(13)."Prenom: ".$prenom.chr(10).chr(13)."Mail:
".$mail.chr(10).chr(13);
mail("", "Inscription",$text);
header("Location:merci.htm");
?>

Et donc je recois le mail.. Mais pas les données ... Une idée?


Du code de brin qui présume register_gloals à On ...
-> http://fr.php.net/fr/register_globals


Dom

Avatar
Calimero
shmol wrote:
Bonsoir

d'un coté un code html:


<body>
<form id="form1" name="form1" method="post" action="inscription.php">
<label>nom
<input name="nom" type="text" id="nom" />
</label>
<br />
<input name="prenom" type="text" id="prenom" />
<br />
<input name="mail" type="text" id="mail" />
<br />
<input type="submit" name="Submit" value="Envoyer" />
</form>

De l'autre le inscription .php

<?
$text="Nom: ".$nom.chr(10).chr(13)."Prenom: ".$prenom.chr(10).chr(13)."Mail:
".$mail.chr(10).chr(13);
mail("", "Inscription",$text);
header("Location:merci.htm");
?>


register_globals, c'est le mal !

$text = "Nom:" . $_POST['nom'] . "rnPrenom:" . $_POST['prenom'];

--
@+
Calimero

Avatar
shmol
Mince oui exact !!


c reglé


"Dominique ROUSSEAU" a écrit dans le message de news:

De l'autre le inscription .php

<?
$text="Nom: ".$nom.chr(10).chr(13)."Prenom:
".$prenom.chr(10).chr(13)."Mail:
".$mail.chr(10).chr(13);
mail("", "Inscription",$text);
header("Location:merci.htm");
?>

Et donc je recois le mail.. Mais pas les données ... Une idée?


Du code de brin qui présume register_gloals à On ...
-> http://fr.php.net/fr/register_globals


Dom




Avatar
Frédéric VANNIÈRE
Calimero wrote:

register_globals, c'est le mal !

$text = "Nom:" . $_POST['nom'] . "rnPrenom:" . $_POST['prenom'];



Ca signifie que 1&1 a mis register_globals à Off par défaut, ils sont
courageux.

Frédéric.

--
Frédéric VANNIERE 231 rue Saint-Honoré
Directeur Technique 75001 PARIS - FRANCE
PLANET-WORK Tél : 0891 024 424
http://www.planet-work.com Fax : 0143 461 199

Avatar
nonono
Exact ! En quoi es ce une preuve de courrage?

"Frédéric VANNIÈRE" a écrit dans le message de
news: 443373ef$0$29030$
Calimero wrote:

register_globals, c'est le mal !

$text = "Nom:" . $_POST['nom'] . "rnPrenom:" . $_POST['prenom'];



Ca signifie que 1&1 a mis register_globals à Off par défaut, ils sont
courageux.

Frédéric.

--
Frédéric VANNIERE 231 rue Saint-Honoré
Directeur Technique 75001 PARIS - FRANCE
PLANET-WORK Tél : 0891 024 424
http://www.planet-work.com Fax : 0143 461 199



Avatar
Frédéric VANNIÈRE
nonono wrote:
Exact ! En quoi es ce une preuve de courrage?


Ca doit casser 95% des sites en PHP.

Frédéric.




--
Frédéric VANNIERE 231 rue Saint-Honoré
Directeur Technique 75001 PARIS - FRANCE
PLANET-WORK Tél : 0891 024 424
http://www.planet-work.com Fax : 0143 461 199

Avatar
nonono
Merci de ces precisions.
Cette variable se change ou? Y a t il un moyen de la changer pour la
globalité d'un serveur?


"Frédéric VANNIÈRE" a écrit dans le message de
news: 44339a7d$0$5178$
nonono wrote:
Exact ! En quoi es ce une preuve de courrage?


Ca doit casser 95% des sites en PHP.

Frédéric.




--
Frédéric VANNIERE 231 rue Saint-Honoré
Directeur Technique 75001 PARIS - FRANCE
PLANET-WORK Tél : 0891 024 424
http://www.planet-work.com Fax : 0143 461 199



Avatar
nonono
Etrange mais un phpinfo m'indique un register_globals off.

Et pourtant j'ai réglé le pb de cette facon....

<?
//si tu veux que ca affiche rien enleve cette ligne.
//si tu veux une redicrection appel moi
import_request_variables('p', 'p_');
$text="nom: ".$p_nom.chr(10).chr(13)."Prenom:
".$p_prenom.chr(10).chr(13)."Mail: ".$p_mail.chr(10).chr(13);
mail("", "Inscription",$text);
header("Location:merci.htm");
?>

Alors la je ne pige plus
Avatar
Alexandre Havard
Merci de ces precisions.
Cette variable se change ou? Y a t il un moyen de la changer pour la
globalité d'un serveur?


Pour un serveur ? Oui, dans php.ini

Pour un répertoire (dans un fichier .htaccess) ou un vhost, avec la
directive :
php_flag register_globals on

Mais bon, autant bien programmer...

--
Alexandre Havard
In God we Trust -- all others must submit an X.509 certificate.

1 2 3