PDA

View Full Version : Getting values from php variables


Mandrake
05-27-2005, 11:30 AM
Hey!
I've got a problem, I want to get values from vars used to determine what the php-file is showing.

Take this url for example:
www.domain.com/index.php?option=com_content&task=view&id=12&Itemid=26

What i'd like is to get the option value(com_content) and id value(12) and using them in the object/embed to determine what flash the page is showing.
In this case the flash might have been www.domain.com/flash/com_content_12.swf .
I need assistance on this matter as i'm not a seasoned actionscripter, so any help would be greatly appreciated!

Boskic.com
05-27-2005, 12:10 PM
This is pure PHP question, it can be solved with javascript but it is simpler to create PHP function.
<?php
$Option = $_REQUEST['option'];
$ID = $_REQUEST['id'];
?>
<object type="application/x-shockwave-flash" data="<?=$Option.'_'.$ID?>.swf" width="100%" height="100%">
<param name="movie" value="<?=$Option.'_'.$ID?>.swf">
<param name="scale" value="noscale">
<param name="bgcolor" value="#000000">
<param name="menu" value="false">
<param name="quality" value="high">
</object>
or if you want to directly call swf as in you post you should use mod_rewrite under Apache server.

Mandrake
05-27-2005, 01:26 PM
Thanks alot, I owe you one!
Now it works like a charm, i'm glad I didn't go through all that hassle with a javascript.