Hello all
Been battling with this for a little while and am very close. Hoping
someone can help me fill in the final piece I need here.
I'm retrieving a url variable with php that is being sent from a
hyperlink on a photo. I am trying to send the name of a picture to
swfobject variable in order to display a picture in a flash zoom
script.
[code]<body>
<div id="zoom"></div>
<?php
$links = mysql_connect("localhost", "Username", "XXXXXX") ;
$res=mysql_select_db("xxxxx",$links);
if(is_numeric($_GET['id'])){
$id=mysql_real_escape_string($_GET['id']);
}else{
$id="The current id is not a number!";
}
if($id){
$query = "select * from links where id='$id'";
$results = mysql_query($query)or die("Query error\n".mysql_error());
while ($line = mysql_fetch_assoc($results)) {
echo $line['description'];
}
mysql_close($links);
}else{
echo $id;
}
?>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject('zoom.swf', 'zoom', '600px',
'600px', '8', '#CCCCCC');
so.useExpressInstall('swfobject/expressinstall.swf');
so.addParam("wmode","transparent");
so.addVariable("image", "<?php echo $line['image'] ;
?>");
so.write("zoom");
// ]]>
</script>
</body>
[/code]
The description Text pulls up fine and I can reference the rest of the
info in the row no problem just stuck on getting it into the flash
file now. Anyone had experience with this before? I'm assuming it's
because I'm closing the php script before I'm retrieving the variable
but I can't seem to include the Javascript in echo I tried that with
no love.
Alternatively I have a script that produces the xml equivalent of what
I need. I'm just not sure where to code it without the xml printout
showing up on the screen. Any help would be appreciated trying to meet
a deadline!
Thanks in Advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---