Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Support > php issues.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-19-2006, 05:27 PM
new member
 
Join Date: Aug 2006
Location: Chertsey, UK
Posts: 6
Send a message via MSN to northstjarna
Default Parsing an Array into FlashVars

Hi there,

I hope someone can help me. I had a look around the forums on other sites but did not find a post that matched my own question...

I created a simple competition form in flash that allows you to type in a promotional code and it either tells you if you have won or not. This works fine if I have only one promotional code, however if i want to have more than one winning code I can't as it takes the variable from the first or next highest level in the recordset

I think that I need to return some type of loop or array and say that if you type in either "123" or "456" either will parse the variable into FlashVars and play the winning sequence.

I am curently trying this


Quote:
$prevar = array('<'?php do { ?>'<'?php echo $row_Promotions['PromotionalVariable']; ?>
'<'?php } while ($row_Promotions = mysql_fetch_assoc($Promotions)); ?>);
and then this is the flash object

Quote:
<..object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="400" accesskey="p" tabindex="24" title="Promotional Form" '>'
This is a form that shows an input box and submit button. Input your code to see if you have won anything...
'<'param name="movie" value="Promotion.swf" />
'<'param name="quality" value="high" />
'<'param name="flashvars" value="ProVar=$prevar&SuccessRes=<?php echo $row_Promotions['SuccessResponse']; ?> winning code is...<?php echo $row_Promotions['PromotionalVariable']; ?>" />
'<'embed src="Promotion.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="400" flashvars="ProVar=$prevar&SuccessRes=<?php echo $row_Promotions['SuccessResponse']; ?> winning code is...<?php echo $row_Promotions['PromotionalVariable']; ?>"></embed>
</obj...
The code was a little funky as I was trying to get it to post in this form... ie '<' instead of <
Any help would be greatly appreciated.

Thanks

Andi

Last edited by northstjarna; 09-19-2006 at 05:39 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:48 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum