i used javascript and php script as mixed. i got a parse error
this is the code
<script language="JavaScript1.1">
var photos=new Array()
var which=0
<? for($i=0;$i< count($productdata2);$i++)
{
foreach($productdata2 as $row)
{?>
// the error occured at this line
photos[0]=<?=base_url().'uploads/'.$productdata2[$i]->image;?>";
// the error occured at this line
<? }
}
?>
function backward(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which]
}
}
function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
}
else window.status='End of gallery'
}
</script>
help me please.....