How can I make facebox without refreshing page

31 views
Skip to first unread message

Arnold Lagbas

unread,
Jan 23, 2018, 6:45:59 AM1/23/18
to facebox
Please help me for my thesis on how can I make facebox without refreshing page. Every time I will edit my data on the table below it will back to top of the table and it is hassle for the user, that's why I want to make a better idea on how can I make without refreshing page. Please help me..

this my firstpage.php
while($row = mysql_fetch_array($result))
 
{
echo
'<td> </td>';
 echo
'<td>';
 echo
'<a rel="facebox" href="editfiq1.php?access_code='.$code.'&item='.$row['fiq1'].'">'.$row['fiq1'].'</a>';
 echo
'</td>';
}

this is my editfiq1.php
<form action="editfiq1exec.php" method="post">
<input name="access_code" type="hidden" class="ed" id="brnu" value="
<?php echo $_GET['access_code']; ?>" />


Score
<br />
<input name="quizitem" onkeypress="return isNumberKey(event)" required="" autofocus type="text" class="ed" id="brnu" value="
<?php echo $_GET['item']; ?>" />
<br>
<input type="submit" name="Submit" value="save" id="button1" />
</form>
thisi my editfiq1exec.php
<?php
 mysql_connect
("localhost","root") or die(mysql_error());
 mysql_select_db
("dbthesis") or die(mysql_error());


$idnum
=$_POST['idnum'];
$access_code
=$_POST['access_code'];
$quizitem
=$_POST['quizitem'];


mysql_query
("UPDATE tblitemquiz SET fiq1='$quizitem' WHERE access_code='$access_code' ");
header
('location: percentage.php');
?>

Israel Carberry

unread,
Jan 23, 2018, 9:15:23 AM1/23/18
to facebox
Arnold, sounds like you want to learn how to make an AJAX request and update the page based on the returned result.  To make life easy, I would suggest using jQuery (see the $.ajax() example there on the home page).  Work your way through the tutorials, and you'll be able to engineer the solution you want here in no time.

Best of luck!
Reply all
Reply to author
Forward
0 new messages