Actually I have the following code in one page that is frame 1:
and I want to call the [<?=($counterC+1);?>] from another frame...
<?php ob_start(); ?>
<?php
//include_once("../../utils/dbConn/dbConn.php");
include_once($_SERVER["DOCUMENT_ROOT"]."/utils/dbConn/dbConn.php");
include_once("calculatorConfig.php");
?>
<script language="JavaScript">
<!--
var arrayCountry = new Array();
<?php
$counterC = -1;
// Define a SQL Select Query
$vqueryC = "Select Countries.Id, Name, Zone, Air, Sea, Sal, Ems, AirViaCountry, SeaViaCountry, SeaBase, SeaAdd, SalBase, SalAdd, EmsBase, EmsAdd, WeightMax, InsuranceMax, InsuranceBase, InsuranceAdd, AirBase, AirAdd, InsuranceMaxSea, Weight1, Tariff1, Weight2, Tariff2, TypeId FROM Countries, Zones WHERE Zones.Id = Countries.Zone";
if (!$vresultC = mysql_query($vqueryC, $link))
header("location:../index.php");
$vaffected_rowsC = mysql_num_rows($vresultC);
if($vaffected_rowsC != 0)
{
while ($rowC = mysql_fetch_array($vresultC, MYSQL_ASSOC))
{
?>
arrayCountry[<?=($counterC+1);?>] = "<?= $rowC["Id"];?>";
arrayCountry[<?=($counterC+2);?>] = "<?= $rowC["Name"];?>";
arrayCountry[<?=($counterC+3);?>] = "<?= $rowC["Zone"];?>";
arrayCountry[<?=($counterC+4);?>] = "<?= $rowC["Air"];?>";
arrayCountry[<?=($counterC+5);?>] = "<?= $rowC["Sea"];?>";
arrayCountry[<?=($counterC+6);?>] = "<?= $rowC["Sal"];?>";
arrayCountry[<?=($counterC+7);?>] = "<?= $rowC["Ems"];?>";
arrayCountry[<?=($counterC+8);?>] = "<?= $rowC["AirViaCountry"];?>";
arrayCountry[<?=($counterC+9);?>] = "<?= $rowC["SeaViaCountry"];?>";
arrayCountry[<?=($counterC+10);?>] = "<?= $rowC["SeaBase"];?>";
arrayCountry[<?=($counterC+11);?>] = "<?= $rowC["SeaAdd"];?>";
arrayCountry[<?=($counterC+12);?>] = "<?= $rowC["SalBase"];?>";
arrayCountry[<?=($counterC+13);?>] = "<?= $rowC["SalAdd"];?>";
arrayCountry[<?=($counterC+14);?>] = "<?= $rowC["EmsBase"];?>";
arrayCountry[<?=($counterC+15);?>] = "<?= $rowC["EmsAdd"];?>";
arrayCountry[<?=($counterC+16);?>] = "<?= $rowC["WeightMax"];?>";
arrayCountry[<?=($counterC+17);?>] = "<?= $rowC["InsuranceMax"];?>";
arrayCountry[<?=($counterC+18);?>] = "<?= $rowC["InsuranceBase"];?>";
arrayCountry[<?=($counterC+19);?>] = "<?= $rowC["InsuranceAdd"];?>";
arrayCountry[<?=($counterC+20);?>] = "<?= $rowC["Weight1"];?>";
arrayCountry[<?=($counterC+21);?>] = "<?= $rowC["Tariff1"];?>";
arrayCountry[<?=($counterC+22);?>] = "<?= $rowC["Weight2"];?>";
arrayCountry[<?=($counterC+23);?>] = "<?= $rowC["Tariff2"];?>";
arrayCountry[<?=($counterC+24);?>] = "<?= $rowC["TypeId"];?>";
arrayCountry[<?=($counterC+25);?>] = "<?= $rowC["AirBase"];?>";
arrayCountry[<?=($counterC+26);?>] = "<?= $rowC["AirAdd"];?>";
arrayCountry[<?=($counterC+27);?>] = "<?= $rowC["InsuranceMaxSea"];?>";
<?
$counterC = $counterC + 27;
}
}
?>
//-->
</script>
Frame 2
Now I want to add the <?=$counterC + 1;?> in the while loop but it is giving me undefined...
while ( x2 <= <?=$counterC + 1;?>)
And i have used the code below to check if am getting the variable $counterC]; from another frame...
var counterC = top.frames[0].arrayCountry[$counterC];
alert (counterC);