cooldude832 Posted January 2, 2010 Share Posted January 2, 2010 So I have this bit of code that pulls content into a center column (You can see it working kseego.com click the left column) and I am trying to setup an array of values in the called php script so they are set in the parent document so I can access them. The bit of code does this <?php if(mysql_num_rows($r) >0){ echo "<script type=text/javascript'>"; echo "var events_ids=new Array();"; echo "var events_dates=new Array();"; echo "var events_cats=new Array();"; echo "var events_open=new Array();"; echo "</script>"; $i = 0; while($row = mysql_fetch_assoc($r)){ write_ebox($row['EventID'],$row['ImageID'],$row['Ext'],$row['Title'],$row['StartDate'],$row['UserID'],$row['Poster'],$row['StartTime'], $row['EndTime'],$i,$row['CatID']); $i++; } } ?> In the write_ebox function I populate those 4 arrays with values using <?php echo "<script type=text/javascript'>"; echo "events_ids[".$i."]='event_div_".$id."'"; echo "events_dates[".$i."]='".date('j',strtotime($date))."'"; echo "events_cats[".$i."]='".$cat."'"; echo "events_open[".$i."]=0"; echo "</script>"; ?> However when I look in firebug I don't see those arrays even showing up any ideas on how to do this? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted January 2, 2010 Author Share Posted January 2, 2010 I did a work around putting the content in a hidden div not pretty but worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.