I have a select box and when it selects it refreshes the page causing the iframe to update its link. Now everything works fine except every time I change value of listbox it refreshes the entire page, and I am looking for partial only.
The select and iframe, now I'll show you my PHP and then maybe it will clear out the situation!
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$dbh = mysql_connect("host", "user", "pass");
mysql_select_db("database_name");
############END OF CONNECT SCRPIT#############################
$id = $_GET['id'];
######id as in index.php?id=1 from the list page#####
$anime = "SELECT * FROM anime WHERE id=$id";
$anime_query = mysql_query($anime) or die(mysql_error());
$thisanime = mysql_fetch_assoc($anime_query);
$amountepi = $thisanime['episodes'];
if(isset($_POST['epinum'])){
$epinum = $_POST['epinum']; // Storing Selected Value In Variable
##############episodes number how many 1-2-3!!
$episodes = "SELECT * FROM episodes WHERE animeid = $id AND number = $epinum";
$episodes_query = mysql_query($episodes) or die(mysql_error());
$allepisodes = mysql_fetch_assoc($episodes_query);
}
?>
<html>
<!-- Header -->
<?PHP require('work/header.php'); ?>
<!-- Sidebar -->
<?PHP require('work/left.php'); ?>
</div><div></div><div></div></div><div></div></div></div>
<!-- bagian main -->
<div id='main-wrapper'>
<div><div><div><div><div></div><div><div></div></div></div><div></div></DIV><div></div><div>
<div class="post-container">
<h3 class="post-title"><?PHP echo $thisanime['animename']; ?> <font style='float:right;'>Status:<font color='green'><?PHP echo $thisanime['status']; ?></h3>
<div class="post-thumb"><img src="<?PHP echo $thisanime['imagecover']; ?>" /></div>
<div class="post-content">
<p></p>
<font color="yellow">Year Of Release:<?PHP echo $thisanime['year']; ?></font>
<p><font color="lightblue"><?PHP echo $thisanime['description']; ?> </p></font></div>
</div>
*******thisisthepartIwantonlytorefresh********
<tbody><tr><td>
<?PHP echo " <font size='4' color = 'blue'>Episode " . $allepisodes["number"]. " -->" . $allepisodes["name"]. "</font>"; ?>
<form class="anilist" action="" method="post">
<select class="listofepisodes" onchange='this.form.submit()' name="epinum" multiple='multiple'>
<?PHP if ($amountepi==3){ ?>
<option value='1' <?php if($allepisodes['number']==1) echo "selected='selected'"; ?>>Episode 1</option>
<option value='2' <?php if($allepisodes['number']==2) echo "selected='selected'"; ?>>Episode 2</option>
<option value='3' <?php if($allepisodes['number']==3) echo "selected='selected'"; ?>>Episode 3</option>
<?PHP }elseif ($amountepi==2){ ?>
<option value='1' <?php if($allepisodes['number']==1) echo "selected='selected'"; ?>>Episode 1</option>
<option value='2' <?php if($allepisodes['number']==2) echo "selected='selected'"; ?>>Episode 2</option>
<?PHP }elseif ($amountepi==1){ ?>
<option value='1' <?php if($allepisodes['number']==1) echo "selected='selected'"; ?>>Episode 1</option>
<?PHP } ?>
</select>
<noscript><input type="submit" value="Submit"></noscript>
</form>
<iframe src="<?PHP echo $allepisodes['code']; ?>" width="408" height="324" frameborder="1" allowfullscreen></iframe>
*************till here************************
</div></div></div></div></div>
<!-- sidebar right -->
<?PHP require('work/right.php'); ?>
<!-- Footer -->
<?PHP require('work/footer.php'); ?>