POST ne travaille pas
Posté : 13 déc. 2005, 20:02
1er! pordon pour mon francais mais Je apprenais.
mon probleme:
jai' une website www.solarnova.co.uk/politica
je veux envoyer une nombre aléatoire(RAND) leur email.
MAIS quand le PHP recieverent 'form'
$_POST[from] est OK.
$_POST[Email1] et $_POST[Email2] sont vide!!!
Le form, c'est perfait!!
mon probleme:
jai' une website www.solarnova.co.uk/politica
je veux envoyer une nombre aléatoire(RAND) leur email.
MAIS quand le PHP recieverent 'form'
$_POST[from] est OK.
$_POST[Email1] et $_POST[Email2] sont vide!!!
Le form, c'est perfait!!
<?php
$from=$_POST['from'];
$email1=$POST['email1'];
$email2=$POST['email2'];
echo"<HTML>\n
<HEAD>\n<TITLE>The Clanwars System</TITLE>\n</HEAD>\n<body background=\"/politica/images/cwback.jpg\">
";
echo"<h1>Account Details for ";
echo($_COOKIE['user']) ;
echo"</H1>";
/*----------------upload accounts---------*/
if (!$file = fopen('**********.txt', 'rb')) {/* nom de DB fichier*/
echo 'Error whilst opening the file.';
} else {
$users = array();
while (!feof($file)) {
$users[]= fgets($file);
}
}
fclose($file);
/*-------------------trim account details----*/
$i = 0;
$max = count($users) - 1;
while($i<=$max) :
$user2[]=trim($users[$i],"\x00..\x1F");
$i++;
endwhile;
/*-----------------(find out where the script is from------*/
switch($from)
{
case(addemail):
if($email1==$email2)
{
$user2[$_COOKIE['accno']+2]=$email1;
$activation=rand(1111111,9999999);
mail($email1,"politica Activation code", "Your Activation code is $activation");
echo"<BR>This adddress $email1 has been added to your account.";
echo"<BR>An activation code has been sent";
/*add account edits*/
}else{
echo"<BR>sorry the email $email1";
echo"<BR>is not the same as the email $email2 , please try again<br>";
}
break;
}
/*-----------------list account details----------*/
echo"\n<br>PASSWORD:";
echo($user2[$_COOKIE['accno']+1]);
echo"\n<BR>EMAIL:";
echo($user2[$_COOKIE['accno']+2]);
echo"\n<br>ACTIVITY/GAME:";
echo($user2[$_COOKIE['accno']+3]);
echo"\n<br><form name=pss target=main action=\"http://www.solarnova.co.uk/cgi-bin/account.php\">";
echo"\n<br>Type New Password__:<input type=\"text\" name=\"newpass1\">";
echo"\n<BR>Retype New Password:<input type=\"text\" name=\"newpass2\">";
echo"\n<input type=\"hidden\" value=\"newpassword\" name=\"from\">";
echo"\n<input type=\"submit\" value=\"Change Password\" />\n";
echo"\n</form>";
if($user2[$_COOKIE['accno']+2] =="None")
{
echo"\n<br>To activate your account you must supply an email address";
echo"\n<br><form name=eml method=\"post\" target=main action=\"http://www.solarnova.co.uk/cgi-bin/account.php\">";
echo"\n<br>Type Email__:<input type=\"text\" NAME=\"email1\">";
echo"\n<BR>Retype Email:<input type=\"text\" NAME=\"email2\">";
echo"\n<input type=\"hidden\" NAME=\"from\" VALUE=\"addemail\">";
echo"\n<input type=\"submit\" value=\"Add Email Address\" />\n";
echo"\n</form>";
}else{
echo"\n<br><form target=main action=\"http://www.solarnova.co.uk/cgi-bin/account.php\">";
echo"\n<br>Activation Code:<input type=\"text\" name=\"newpass1\">";
echo"\n<input type=\"hidden\" value=\"activate\" name=\"from\">";
echo"\n<input type=\"submit\" value=\"Activate account\" />\n";
echo"\n</form>";
}
?>
Modération : Sujet déplacé