Forum Moderators: coopster
<?php
$expires = gmdate('D, d M Y H:i:s', time()-(60*60*24*365*2)) . ' GMT';
header('Expires: '.$expires, true);
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // HTTP/1.0
?> 3) I navigate to the next page and make a query to return the number from DB - it return "4" (!)
currentImage = 5;
new Ajax.Request("/operations.php",{method:'post',postBody:'currentImage='+currentImage,onComplete:currentImageSaved});
function currentImageSaved(req){
feedbackData = req.responseText;
//check what happened at operations.php, shows echoed data from the code at operations.php
alert(feedbackData);
}
if(isset($_POST['currentImage'])){
$currentImage= mysql_real_escape_string($_POST['currentImage']);
$sql = "UPDATE imageGallery SET currentImage='".$currentImage."' WHERE user ='1' LIMIT 1";
$result = mysql_query($sql, $conn) or die(mysql_error());
$sql = "SELECT * FROM imageGallery WHERE user= '1' LIMIT 1";
$result = mysql_query($sql, $conn);
if (mysql_num_rows($result) == 0) {
} else {while ($row = mysql_fetch_array($result)) {
echo $row['currentImage'];
}
}
}
$sql = "SELECT * FROM imageGallery WHERE user = '1' LIMIT 1";
$result = mysql_query($sql, $conn);
if (mysql_num_rows($result) == 0) {
} else {while ($row = mysql_fetch_array($result)) {
echo $row['currentImage'];
}
}