PDA

View Full Version : zf need dynamic url, any suggestion?


yzzelliot
09-29-2008, 10:29 AM
Hi everybody.

I am using (PHP) Zend Framework as my server side scripting.
well, i need to submit a form from flex to php with a dynamical url which will be produce by zend. so any suggestion?

basically is:

usually in php:

<form method="post" action="<?php echo $this->baseURL?>/user/addcm">


what can i do in flex is:

<mx:HTTPService id="userform" url="http://localhost/zend-tender/public/user/addcm/" method="POST">


then i will have trouble when i change my domain or root directory :p

rawmantick
09-29-2008, 01:02 PM
http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_3.html

Hope it helps...

yzzelliot
09-30-2008, 02:16 AM
<object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' height='100%' width='100%'>
<param name='src' value="<?php echo $this->baseURL?>/swf/cmform.swf" />
<param name='flashVars' value="baseURL=<?php echo $this->baseURL?>" />
<embed name='mySwf' src="<?php echo $this->baseURL?>/swf/cmform.swf" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' height='100%' width='100%' flashVars="baseURL=<?php echo $this->baseURL?>" />
</object>



[Bindable]
public var baseURL:String;

public function init():void
{
baseURL = Application.application.parameters.baseURL;
}


Thanks Romantique. I got what I want.