Forum Moderators: coopster
<script language="javascript">
<!--
function rateJoke(jtitle){
var w = window.open('',' +jtitle+ ','width=500,height=500,scrollbars=yes,resizable=yes');
var d = w.document;
d.write('<html><body><?php
is(isset($_POST['rate_submit'])){
$your_rating = $_POST['user_rate'];
$both_rates = $your_rating + $rating;
$rate = $both_rates / 2;
if($rate < 5){
$new_rate = $rate;
}
else{
echo "The number is greater that 5, try again";
}
$update_query = "UPDATE rating FROM jokes WHERE title='$title' VALUES ($new_rate)";//do stuff
}
?>
<p align="center"><form><?php
for($num = 1; $num <= 5; $num++){
echo "<input type="radio\" value="{$num}" /><img src="images/rate_star_{$num}.jpg" />";
}?><input type="submit" name="user_rate" value="Rate!" />
</body></html>');
d.close();
w.focus();
}
-->
</script>
This code has not been tested, but I was wondering if that would work or a better way to do it.
Thanks,
electricocean