bluewalrus
09-15-2009, 03:59 PM
Is there a way to have a javascript value control which php is displayed? For example I'm trying to use an increasing javascript variable to control which php array value is displayed.
var x = 0;
while ( x < <?php echo $Total; ?> ) {
var address = "<?php echo $Name[?>x<?php ];?>>";
x++;
}
So it would go be to the php as something like this in the end
var x = 0;
// x=0
while ( 0 < 5 ) {
var address = "<?php echo $Name[0];?>";
x++;
//x = 1
var address = "<?php echo $Name[1];?>";
x++;
// ETC.
}
and on the actual page
var x = 0;
// x=0
while ( 0 < 5 ) {
var address = "22 main street city, state, country";
x++;
//x = 1
var address = "23 different street city, state, country";
x++;
// ETC.
}
var x = 0;
while ( x < <?php echo $Total; ?> ) {
var address = "<?php echo $Name[?>x<?php ];?>>";
x++;
}
So it would go be to the php as something like this in the end
var x = 0;
// x=0
while ( 0 < 5 ) {
var address = "<?php echo $Name[0];?>";
x++;
//x = 1
var address = "<?php echo $Name[1];?>";
x++;
// ETC.
}
and on the actual page
var x = 0;
// x=0
while ( 0 < 5 ) {
var address = "22 main street city, state, country";
x++;
//x = 1
var address = "23 different street city, state, country";
x++;
// ETC.
}