[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Сессии перестали работать
PHPLIVE
Передаю переменную через аякс что бы записать её в сессию, но ничего не записывается.
Хотя прежние примеры работают нормально. В чём проблема?



файл query.php

<?php session_start();
function capcha() {
unlink('capcha.png');
$chars="abcdefghijklmnpqrstuvwxyzswedcvfrtgbnhyujmkip23456789";
$max=4;
$size=StrLen($chars)-1;
$capchacode=null;
while($max--){
$capchacode.=$chars[rand(0,$size)];}
$image = imagecreate(100,50);
$green = imagecolorallocate($image, 100, 150, 100);
$black = imagecolorallocate($image, 0, 0, 0);
imageline($image, 0, 0, 100, 50, $black);
imageline($image, 100, 0, 0,50 , $black);
imagestring($image, 6, 50, 25, "$capchacode ", $black);
imagepng($image,'capcha.png');
imagedestroy($image);
$_SESSION['capcha']=$capchacode;


}


if(isset($_POST['fgm'])){

include("./prog/db.php");
$email=$_POST['fgm'];
$cap=$_POST['cc'];
echo $cap;
echo $email;
print_r($_SESSION);}

if(isset($_POST['fpass'])){
//include("./prog/security.php");
//include("

include("./prog/db.php");
capcha();
echo "<form action='forget_password.php' method='Post' name='forget'><table align='center'><tr><td>";
word('Ведите код с изображения','Sicherheitscode','code of image','код зображення');
echo "<br>
<input type='text' name='image'></td><td><img src='capcha.png?r="
.rand(0,9999)."' ></td></tr><tr><td>";
word('Введите ваш email','email','email','email');
echo"<br>
<input type='email' name='email'><br><input type='button' onclick=
\"forgetemail('forget','index_window') \" value='";
word('Отправить данные на почту','Daten an E-Mail senden','send data to email','послати дані на email');
echo"'>

</form></td></tr></table>"
; session_write_close(); }
?>


отправляю аяксом


function forgetemail(fname,win) {

var lang ="<?php echo $_SESSION['lang']; ?>";var lang ="<?php echo $_SESSION['lang'];?>";
var email = document.forms[fname]['email'].value;
var image = document.forms[fname]['image'].value;

var xmlhttp = getXmlHttp();
var url = "query.php";
var params = "fgm="+email+"&cc="+image+"&lang="+lang;
xmlhttp.open("POST", url, true);
//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");

xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
dynamic_text(xmlhttp.responseText,win);
}
}
xmlhttp.send(params);
}


сама форма

         
<form action="forget_password.php" method="Post" name="forget"><table align="center"><tbody><tr><td>Ведите код с изображения<br>
<input
name="image" type="text"></td><td><img src="capcha.png?r=2149"></td></tr><tr><td>Введите ваш email<br>
<input
name="email" type="email"><br><input onclick="forgetemail('forget','index_window') " value="Отправить данные на почту" type="button">

</td></tr></tbody></table>

</form>





Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.