christian wrote:
I use a AJAX refresh script on a page to test a $var state
<div>
<?
include ("include/refr.inc.php");
//ajax script for reload
require ("bd_inc.php");
//test the line state buzy or free
$st = mysql_query("SELECT linestate FROM broad WHERE num='40'");
$linest = mysql_fetch_array($st);
$linestate= $linest["linestate"];
if ($linestate=='0')
{
echo "<script language=\"JavaScript\">";
echo "window.location.replace(\"update.php\")";
echo "</script>";
}
else .........
unfortunely it work with all instructions I have tested but redirection
instructions are not working
If I just use a simple meta refresh without ajax it work
Any idea ?
You have yet to learn PHP and HTML to begin with:
<div>
<?php
include 'include/refr.inc.php';
// ajax script for reload
require 'bd_inc.php';
// test the line state buzy or free
$st = mysql_query('SELECT linestate FROM broad WHERE num=40');
$linest = mysql_fetch_array($st);
if ($linest !== FALSE)
{
$linestate = $linest['linestate'];
if ($linestate === '0')
{
?>
<script type="text/javascript">
window.location.replace("update.php");
</script>
<?php
}
else .........
}
?>
Unfortunately, you have omitted the relevant parts. When analyzing and
posting problems with *client-side* scripts, you should look at and post the
*client-side* code, not the server-side one -- View the Source, Luke!
See also <http://jibbering.com/faq/>. And fix your sender address.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>