I have problem.
That code should change image on site after success or error:
pastebin
if(isset($func) and $func == 'claim_bonus'){
global $ado;
$user = escape($_GET['user']);
$type = escape($_GET['type']);
$now = date("Y-m-d H:i:s");
$points = rand(1,20);
$query = $ado->exec("INSERT INTO `claimed_bonuses` SET `user` = '$user', `date` = '$now', `type` = '$type'");
$query1 = $ado->exec("INSERT INTO `history` SET `user` = '$user', `date` = '$now', `type` = 'bonus', `amount` = '$points', `title` = 'Bonus Claimed', `description` = '$user claimed bonus $points points'");
$query2 = $ado->exec("update `balances` SET `actual` = actual+$points, `total` = total+$points");
if ($query && $query1 && $query2) {
echo "<img src=\"/img/bonus/add_used.png\" width=\"30%\" height=\"30%\" alt=\"Bonus claimed\" />";
} else {
echo "<img src=\"/img/bonus/error.png\" width=\"30%\" height=\"30%\" alt=\"Error\" />";
}
}
Im calling ajax using ajax.js file
// JavaScript Document
var xmlhttp=false;
function claimbonus(user, type, id){
xmlhttp = new XMLHttpRequest();
xmlhttp.abort();
xmlhttp.open("GET", "/functions/ajax.php?func=claim_bonus&user="+user+"&type="+type, true);
xmlhttp.onreadystatechange=function() {
if(xmlhttp.status == 200) {
document.getElementById(id).innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
And code is loaded on page.
Script is returning image but it doesnt replace old image.
Image code:
<img src="img/bonus/add.png" width="30%" height="30%" alt="Claim bonus" id="add_img" onclick="claimbonus(<?php echo $_SESSION['userid']; ?>, '<?php echo $type; ?>', 'add_img'); return false"/>
I hope someone can help me
You are replacing the innerHTML of the image tag. Wrap in a div or span and replace that instead and quote the userid too
<span id="add_img"><img
src="img/bonus/add.png" width="30%" height="30%"
alt="Claim bonus"
onclick="claimbonus('<?php echo $_SESSION['userid']; ?>',
'<?php echo $type; ?>', 'add_img')/></span>
Related
I have a database called opera_house with a table called room that has a field room_name and a field capacity. I want to show the room_name 's that have a capacity larger than the one entered by the user.
The Available Room text disappears, but my code only shows the MySQL query if I echo it, but I'm not sure if it is reaching to search the database.
This is my script code:
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
function showRoom(str) {
if (str === "") {
document.getElementById("txtHint").innerHTML = "";
return;
} else {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
document.getElementById("txtHint").innerHTML = this.responseText;
}
};
xmlhttp.open("GET","ajax_events.php?q="+str,true);
xmlhttp.send();
}
}
This is my html:
<body>
<form>
<input type="text" name="room" onkeyup="showRoom(this.value)">
</form>
<br>
<div id="txtHint"><b>Available Room...</b></div>
</body>
This is my php:
<?php
include('dbconnect.php');
$q = intval($_GET['q']);
mysqli_select_db($connection,"opera_house");
$sql="SELECT room_name FROM room WHERE capacity >= '".$q."'";
echo $sql;
$result = mysqli_query($connection,$sql);
while($row = mysqli_fetch_array($result)) {
echo "<td>" . $row['room_name'] . "</td>";
}
?>
My php file is called ajax_events.php
And my dbconnect.php is one that I constantly use to connect to this database.
Would really appreciate some help!!
I propose an answer using jquery. You've embedded it in your question but you're not using it ...
Explanations : You call the following url ajax_events.php with the parameter "q" only if str is defined, otherwise it fills the selector txtHint with nothing.
AJAX
if (str != "") {
$.ajax({
type: 'GET',
url: 'ajax_events.php',
dataType: 'JSON',
data : {
q: str
}
}).done(function (data) {
$('#txtHint').text = data;
}).fail(function() {
alert('Fatal error');
})
} else {
$('#txtHint').text = '';
}
With this configuration, it is important to return result with echo json_encode in your server side code.
PHP
<?php
include('dbconnect.php');
$q = intval($_GET['q']);
mysqli_select_db($connection, "opera_house");
$sql = 'SELECT room_name FROM room WHERE capacity >= '.$q; // Some corrections
$result = mysqli_query($connection, $sql);
$return = '';
while($row = mysqli_fetch_array($result)) {
$return .= '<td>' . $row["room_name"] . '</td>';
}
echo json_encode($return); // Return Json to ajax
?>
While thinking of JS it's fine. I think the problems are in the php code. Try this one.
<?php
include('dbconnect.php');
$q = intval($_GET['q']);
mysqli_select_db($connection,"opera_house");
$sql="SELECT room_name FROM room WHERE capacity >= " . $q;
$result = mysqli_query($connection,$sql);
if (!$result) {
echo mysqli_error();
exit();
} // this is to do debugging. remove when you get it fixed
$ret = ""; //variable to hold return string
while($row = mysqli_fetch_array($result)) {
$ret .= "<td>" . $row['room_name'] . "</td>";
}
echo $ret;
I am using below scripts to build an image gallery
1) scriptphoto.js
2) acceptcomment.php
3) edit_album.php
Edit_album.php contains a mysql query which run when an Image get click (to print comments if image is shared)
html:
<div id="photo_preview" style="display:none">
<div class="photo_wrp">
<img class="close" src="uploads/close.gif" />
<div style="clear:both"></div>
<div class="pleft">test1</div>
<div class="pright">test2</div>
<div style="clear:both"></div>
</div>
</div>
and Javascript on scriptphoto.js
function getPhotoPreviewAjx(id,name) {
$.post('edit_album.php',{action:'get_info',Id:id},
function(data){
if (name == 'YES'){
$('#photo_preview .pleft').html(data.data1);
$('#photo_preview .pright').html(data.data2);
$('#photo_preview').show();
}
else{
$('#photo_preview .pleft').html(data.data1);
$('#photo_preview .pright').html(data.data3);
$('#photo_preview').show();
}
}, "json"
);
};
php code on edit_album.php for that is
if ($_POST['action'] == 'get_info' && (int)$_POST['Id'] > 0) {
$iPid = (int)$_POST['Id'];
$shared = $_POST['shared'];
$sComments = '';
$sq= "SELECT * FROM comment_table WHERE ImageSN = '".$iPid."' ORDER BY C_when ASC LIMIT 10";
$sql = mysql_query($sq);
while($query = mysql_fetch_array($sql))
{
$sWhen = date('F j,Y' , $query['C_when']);
$sComments .= "<div class=\"comment\" id='".$query['C_id']."'>
<p>Comment from '".$query['c_name']."' <span>(".$sWhen.")</span>:</p>
<p>".$query['c_text']."</p>
</div>" ;
}
$sharewarning .="<div id='sharewarning'>Share Images To Enable Comments</div>";
$sCommentsBlock .="<div class=\"comments\" id=\"comments\">
<h2>Comments</h2>
<div id=\"comments_warning1\" style=\"display:none\">Don`t forget to fill both fields (Name and Comment)</div>
<div id=\"comment_warning2\" >You can't post more than one comment per 10 minutes (spam protection)</div>
<form onsubmit=\"return false;\">
<table>
<tr><td class=\"label\"><label>Your name: </label></td><td class=\"field\"><input type=\"text\" value=\"\" title=\"Please enter your name\" id=\"name\" /></td></tr>
<tr><td class=\"label\"><label>Comment: <input type=\"hidden\" name=\"action\" value=\"accept_comment\"></label></td><td class=\"field\"><textarea name=\"text\" id=\"text\"></textarea></td></tr>
<tr><td class=\"label\"> </td><td class=\"field\"><button onclick=\"submitComment(".$iPid."); return false;\">Post comment</button></td></tr>
</table>
</form>
<div><span id=\"commentspsn\"></span>
<div id=\"comments_list\">".$sComments."</div>
</div>";
$imageInfo = '';
$selecT = "SELECT imagesrc FROM imagerate WHERE ImageSN ='".$iPid."'";
$table = mysql_query($selecT);
while($query = mysql_fetch_array($table))
{
$imageInfo.=$query['imagesrc'];
}
require_once('classes/Services_JSON.php');
$oJson = new Services_JSON();
header('Content-Type:text/javascript');
echo $oJson->encode(array(
'data1' => '<img class="fileUnitSpacer" src="uploads/'. $imageInfo.'">' . $sPrevBtn . $sNextBtn ,
'data2' => $sCommentsBlock,
'data3' => $sharewarning,
));
exit;
}
when a image get clicked to view it shows like this
Till this it works fine but when I Insert a comment successfully, I want to refresh comments to show new comment thats where I got struck
jquery code for handling comments and inserting them is below
function submitComment(id) {
var sName = $('#name').val();
var sText = $('#text').val();
if (sName && sText) {
$.post('acceptcomment.php', { action: 'accept_comment', name: sName, text: sText, id: id },
function(data){
if (data != '1') {
$('#comments_list').fadeOut(2000, function () {
$(this).html(data);
$(this).fadeIn(1000);
});
$("#commentspsn").html('<span id="commentspan"> <b>comment Submitted</b></span>');
}
}
);
} else {
$('#comments_warning1').fadeIn(1000, function () {
$(this).fadeOut(1000);
});
}
};
acceptcomment.php code is
$iItemId =(int)$_POST['id']; // prepare necessary information
$sIp = getVisitorIP();
$sName = $_POST['name'];
$sText = $_POST['text'];
if ($sName && $sText) {
$sql = "SELECT ImageSN FROM comment_table WHERE ImageSN = '".$iItemId."' AND commentip = '".$sIp."' AND C_when >= 'UNIX_TIMESTAMP()-600' LIMIT 1";
$query = mysql_query($sql);
$array = mysql_num_rows($query);
if ($array == 0 ) {
$insert = "INSERT INTO comment_table SET ImageSN = '".$iItemId."' , commentip = '".$sIp."' , C_when = UNIX_TIMESTAMP(), c_name = '".$sName."', c_text ='".$sText."'";
$sql = mysql_query($insert);
$update= 'UPDATE imagerate SET comment_counts = comment_counts + 1 WHERE ImageSN = "'.$iItemId.'"';
$query = mysql_query($update);
}
}
return 1;
need guideness
Modify your accept comment.php to return a json response as below code.
// prepare necessary information
$iItemId =(int)$_POST['id'];
$sIp = getVisitorIP();
$sName = $_POST['name'];
$sText = $_POST['text'];
$oJson = new Services_JSON();
if ($sName && $sText) {
$sql = "SELECT ImageSN FROM comment_table WHERE ImageSN = '".$iItemId."' AND commentip = '".$sIp."' AND C_when >= 'UNIX_TIMESTAMP()-600' LIMIT 1";
$query = mysql_query($sql);
$array = mysql_num_rows($query);
if ($array == 0 ) {
$insert = "INSERT INTO comment_table SET ImageSN = '".$iItemId."' , commentip = '".$sIp."' , C_when = UNIX_TIMESTAMP(), c_name = '".$sName."', c_text ='".$sText."'";
$sql = mysql_query($insert);
$update= 'UPDATE imagerate SET comment_counts = comment_counts + 1 WHERE ImageSN = "'.$iItemId.'"';
$query = mysql_query($update);
$data = array("item_id"=>$iItemId,"name"=>$sName,"text"=>$sText);
return $oJson->encode($data);
}
}
return $oJson->encode(array("error"=>"Error while updating the comment"));
In your Javascript code update the comment section with the received text
function submitComment(id) {
var sName = $('#name').val();
var sText = $('#text').val();
if (sName && sText) {
$.post('acceptcomment.php', { action: 'accept_comment', name: sName, text: sText, id: id },
function(data){
if (!data.error) {
$('#comments_list').fadeOut(2000, function () {
$(this).html(data.text);
$(this).fadeIn(1000);
});
$("#commentspsn").html('<span id="commentspan"> <b>comment Submitted</b></span>');
}
}
);
} else {
$('#comments_warning1').fadeIn(1000, function () {
$(this).fadeOut(1000);
});
}
};
when i click the today button, it goes to updatetoday.php page where i select a query and display it in call back of an ajax and display the table in .php file to div with id #test. but it display's error as Uncaught TypeError: Illegal invocation
$(document).ready(function(){
$('#today').click(function()
{
alert("hi");
$.ajax({
url:'updatetoday.php',
data:{update:today}, // pass data
success:function(result)
{$( "#test" ).html(result);}
});
});
});
updatetoday.php
<?php
$conn = mysql_connect('localhost', 'root', 'root') or die("error connecting1...");
mysql_select_db("cubitoindemo",$conn) or die("error connecting database...");
if($_GET['update']==today) //taking
{
echo "<table align='center' border='1' cellspacing='2'><tr><th>Book_id</th><th>Name</th><th>Phone Number</th><th>Email Address</th><th>Start Date</th><th>Source</th><th>Destination</th><th>Morning Time</th><th>Evening Time</th><th>Duration</th><th>Days Off</th><th>Date Off</th><th>Current Status</th><th>Call Counter</th><th>Option</th><th>Calender</th><th>Save</th></tr><br><br><br>
<?php
$query_book = 'Select * from `booking` where validity = 1 limit 5';
$result_book = mysql_query($query_book);
while($row = mysql_fetch_assoc($result_book))
{
$user_id = $row['user_id'];
// query for customer table
$query_cus = 'Select * from `customer` where user_id = $user_id limit 5';
$result_cus = mysql_query($query_cus);
$row_cus = mysql_fetch_assoc($result_cus);
$name = $row_cus['user_id'];
$email = $row_cus['email_id'];
$mobile_number = $row_cus['mobile_number'];
$current_status = $row['valid'];
$startdate = $row['start_date_timestamp'];
if($current_status == '1')
{
$status = '<p style='color:green;font-weight:600;font-size:19px'>Reg</p>';
}
else if($current_status == '2')
{
$status = '<p style='color:green;font-weight:600;font-size:19px'>New</p>';
}
else if ($current_status == '3.1' )
{
$status = '<p style='color:red;font-weight:600;font-size:19px'>R</p>';
}
?>
<tr align='center'><td class='bookid'><?=$row['book_id']?></td><td ><?=$row_cus['name']?></td><td ><?=$row_cus['mobile_number']?></td><td ><?=$row_cus['email_id']?></td><td><?=$row['start_date_timestamp']?></td><td ><?=$row['source']?></td><td ><?=$row['destination']?></td><td ><?=$row['mor_timestamp']?></td>
<td><?=$row['eve_timestamp']?></td><td><?=$row['duration']?></td><td ><?=$row['days_off']?></td><td ><?=$row['date_off']?></td>
<td><?=$row['current_status']?></td ><td ><?=$row['call_counter']?></td>
<td><select class='sel' name='select_option'><option value='NULL'>Select An Option</option><option value='taking'>Taking</option><option value='later-def'>Later Defined</option><option value='later-undef'>Later Undefined</option><option value='outofrange'>Out Of Range</option><option value='rejected'>Rejected</option><option value='norespond'>No Respond</option></select></td><td><input type='text' class='cal' size='6' disabled='disabled' value='<?=$startdate?>'/></td><td><button id='<?php echo $row['book_id'];?>' class='save'>Save</button></td></tr>
<?php
}//booking table while ends
echo '</table>';
?>
</div>";
}
?>
To fix your problem you must change the line :
data:{update:today}, // pass data
to :
data:{update:'today'}, // pass data
in your code today is a string not a varible
Change the line :
success:function(data)
to :
success:function(result)
You are assigning the result from the php to a variable called data and in
{$( "#test" ).html(result);}
trying to display inside the #test div a variable called result.
Hi i am having trouble making this ajax code work with JavaScript. The function is called studentReqHandler with a button onclick function and everything is in echo's. this is the code of the function studentReqHandler:
echo "<script type='text/javascript'>
function studentReqHandler(action,id,email,elem){
_(elem).innerHTML = 'processing ...';
var ajax = ajaxObj('POST', 'verifying.php');
ajax.onreadystatechange = function() {
if(ajaxReturn(ajax) == true) {
if(ajax.responseText == 'accept_ok'){
_(elem).innerHTML = '<b>User Verified!</b><br />';
} else {
_(elem).innerHTML = ajax.responseText;
}
}
}
ajax.send('action='+action+'&id='+id+'&email='+email);
}
</script>
this is the onclick button :
<button onclick='studentReqHandler(\"accept\",\"".$id."\",\"".$email."\",\"user_info_".$id."\")'>accept</button> or
";
other ajax related functions:
function ajaxObj( meth, url ) {
var x = new XMLHttpRequest();
x.open( meth, url, true );
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
return x;
}
function ajaxReturn(x){
if(x.readyState == 4 && x.status == 200){
return true;
}
}
and last the php for this to work:
if (isset($_POST['action']) && isset($_POST['id'])&& isset($_POST['email'])){
$id = preg_replace('#[^0-9]#', '', $_POST['id']);
$email = $_POST['email'];
if($_POST['action'] == "accept"){
$sql = "UPDATE profile SET verified='1' WHERE id='$id' AND email='$email' LIMIT 1";
$query = mysqli_query($db_conx, $sql);
mysqli_close($db_conx);
echo "accept_ok";
exit();
}
}
Can anyone figure out why this doesnt work?
I pasted this code and it works:
Minimum error, is you got some messy quotes in the <button> javascript string.
<?php
/* using this at the top to check what happens when it posts. */
if (isset($_POST['action']) && isset($_POST['id'])&& isset($_POST['email'])){
$id = preg_replace('#[^0-9]#', '', $_POST['id']);
$email = $_POST['email'];
if($_POST['action'] == "accept"){
/* I commented out the query, so you must make sure that works right */
$sql = "UPDATE profile SET verified='1' WHERE id='$id' AND email='$email' LIMIT 1";
//$query = mysqli_query($db_conx, $sql);
// mysqli_close($db_conx);
echo "accept_ok";
exit();
}
}
/* some default values. You need to make sure you get these from somewhere.*/
$id=3;
$email="oo#oooo.com";
/* ELEMENT changes when I click the button */
echo "Div Element <div id='element'>ELEMENT</div> area<br><br>";
?>
<script type='text/javascript'>
function studentReqHandler(action,id,email,elem) {
/* I used the basic document element locator */
document.getElementById('element').innerHTML = 'processing ...';
/* I posted to itself this time. */
var ajax = ajaxObj('POST', 'ajax.php');
ajax.onreadystatechange = function() {
if(ajaxReturn(ajax) == true) {
if(ajax.responseText == 'accept_ok'){
document.getElementById('element').innerHTML = '<b>User Verified!</b><br />';
} else {
document.getElementById('element').innerHTML = ajax.responseText;
}
}
}
ajax.send('action='+action+'&id='+id+'&email='+email);
}
function ajaxObj( meth, url ) {
var x = new XMLHttpRequest();
x.open( meth, url, true );
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
return x;
}
function ajaxReturn(x){
if(x.readyState == 4 && x.status == 200){
return true;
}
}
</script>
/* There were too many quotes and \'s in the original button. */
<br>The Button<br>
<?php
echo "<button onclick=\"studentReqHandler('accept','$id','$email','user_info_$id') \">accept</button>";
?>
I am having an issue with my AJAX and MySQL/PHP script.
The first file below, is my javascript file I use to test accessing my server. This file works as far as I know and have tested.
Game = function() {};
var timer;
Game.EncodeURI = function (text) {
return encodeURIComponent(text);
}
Game.DecodeURI = function (text) {
return decodeURIComponent(text);
}
Game.AlterDiv = function(div,data) {
if (Game.ID(div)) {
Game.ID(div).innerHTML = data;
}
}
Game.ID = function(value) {
return document.getElementById(value);
}
Game.ServerRequest = function (url, data) {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest(); // code for IE7+, Firefox, Chrome, Opera, Safari
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
data = xmlhttp.responseText.split("|");
for (i = 0; i < data.length; i++){
var one = Game.DecodeURI(data[parseInt(i)]);
var two = Game.DecodeURI(data[parseInt(i) + 1]);
var three = Game.DecodeURI(data[parseInt(i) + 2]);
var four = Game.DecodeURI(data[parseInt(i) + 3]);
var five = Game.DecodeURI(data[parseInt(i) + 4]);
}
} else {
return false;
}
}
if (!data) {
data = "";
}
data = data.replace(/: /gi, "=");
data = data.replace(/:/gi, "=");
data = data.replace(/, /gi, "&");
data = data.replace(/,/gi, "&");
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(data);
}
Game.Action = function (id, seconds) {
clearTimeout(timer);
if (id) {
if (!seconds) {
Game.AlterDiv('message', 'You begin working.');
Game.ServerRequest("action.php", "id: " + id);
} else {
Game.AlterDiv('message', 'You begin working.');
Game.ID('timer').innerHTML = seconds;
if (seconds >= 2) {
seconds -= 1;
Game.ID('timer').innerHTML = seconds;
timer = setTimeout(function(){
Game.Action(id, seconds);
},1000);
} else {
Game.ID('timer').innerHTML = "Finished";
Game.ServerRequest("action.php", "id: " + id + ", x: x"); // Request it, then POST "x" to say timer has counted down.
}
}
} else {
alert("There was an error with your request.\n Please try again.");
}
}
This second file is a basic PHP web page that I use to test the said function.
<html>
<head>
<title>Test</title>
</head>
<body>
<span onClick="Game.Action('1','5');">Start Work</span><br /><br />
<div id="message"></div>
<div id="timer"></div>
</body>
</html>
<script type="text/javascript" src="game.js?<?php echo time(); ?>"></script><!-- the time() stops it cache-ing -->
This third file is my PHP/MYSQL file that I use to connect to the database.
<?php
$mysqli = new mysqli_connect("127.0.0.1", "root", "", "gurstang");
$id = $_POST['id'];
if(isset($_POST['x'])) {
$x = true;
}else{
$x = false;
}
$userid = 1;
$query = "SELECT * FROM `action_info` WHERE `actionid` = '$id'";
if($result = $mysqli->query($query)){
while ($row = $result->fetch_assoc()) {
$action_name = $row['name'];
$basetimer = $row['time'];
$gaineditem = $row['itemid'];
}
$result->free();
}
$query = "SELECT `item`,`plural` FROM `items` WHERE `itemid` = '$gaineditem' LIMIT 0,1";
if($result = $mysqli->query($query)){
while($row = $result->fetch_assoc()){
$gained_item = $row['item'];
$gained_plural = $row['plural'];
}
$result->free();
}
if($x == false){
echo "Action|$id|"5"";
$message = "You have begun working.";
echo "AlterDiv|message|$message";
}
if($x == true){
echo "Action|$id|"5"";
$itemnumber = mt_rand(1,2);
$gainedmessage = "You have gained $itemnumner $gained_item.";
echo "AlterDiv|message|$gainedmessage";
$query = "SELECT `count` FROM inventory WHERE userid = '$userid' AND itemid = '$gaineditem' LIMIT 0,1";
if($result = $mysqli->query($query)){
while($row = $result->fetch_assoc()){
$count = $row['count'];
$add = $count + $itemnumber;
$updatequery = "UPDATE `inventory` SET `count` = '$add' WHERE `userid` = '$userid' AND `itemid` = '$gaineditem'";
$mysqli->query($updatequery);
}
}
else{
$insertquery = "INSERT INTO `inventory` (`userid`, `itemid` ,`count`) VALUES ('$userid', '$gaineditem', '1')";
$mysqli->query($insertquery);
}
}
?>
Those are all 3 of the file currently to run my script. I have an onclick event in the php webpage, and it sends the values to my Javascript function of Game.Action. After testing I have concluded or at least assume that my Javascript function for Game.Action works. After testing my Game.ServerRequest function, I have concluded that there is a change somewhere happening. Although, when I check my server to see if the updates actually happened, nothing happens. It doesn't update the timer div or the message div properly.
So basically my question is, is my issue with PHP/MYSQL or AJAX?
Thanks for your help.