Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you present flash in PHP script 1

Status
Not open for further replies.

zrazzaq

MIS
Apr 13, 2005
102
US
I have the following code:
Code:
<?
if(!empty($_SESSION[MemberID]))
{
	$LoginLogout = "<a href=\"logout.php\"><embed SRC=\"images/logout.swf\" WIDTH=100 HEIGHT=50 ALT=\"Login\" border=0></embed></a>";
	
	if(ereg("index.php", $_SERVER[SCRIPT_NAME]))
	{
		$WelcomeMessage = nl2br($aset[message])."<br><hr width=\"100%\" size=1 color=dddddd>";
	}
}
else
{
	$LoginLogout = "<a href=\"login.php\"><img SRC=\"images/login.swf\" WIDTH=100 HEIGHT=50 ALT=\"Login\" border=0></a>";
	
}
?>
instead of images I have a flash file that I want to use but it will not bring up anything. Where am I going wrong?
Thanks
Z
 
First Flash mopvies are not images, and therefore cannot be called as an image you should read this:
Flash said:
<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

Note: This is the minimum code you need to embed a Flash movie in a browser. A broken icon will appear on the Web page if the user does not have the Flash plug-in installed.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi Thanks Vacunita:
I have tried it and still doesn't work:
Code:
<?
if(!empty($_SESSION[MemberID]))
{
    $LoginLogout = "<object width="550" height="400">
<param name="movie" value="images/logout.swf">
<embed src="images/logout.swf" width="550" height="400">
</embed>
</object>";
    
    if(ereg("index.php", $_SERVER[SCRIPT_NAME]))
    {
        $WelcomeMessage = nl2br($aset[message])."<br><hr width=\"100%\" size=1 color=dddddd>";
    }
}
else
{
    $LoginLogout = "<object width="550" height="400">
<param name="movie" value="images/login.swf">
<embed src="images/login.swf" width="550" height="400">
</embed>
</object>";
    
}
?>
 
Lets disect your string $LoginLogout shall we:
Code:
 $LoginLogout = "<object width="550" height="400">
<param name="movie" value="images/logout.swf">
<embed src="images/logout.swf" width="550" height="400">
</embed>
</object>";

Your string starts [red]"<object width=[/red] then PHP finds a closing double quote [green]"[/green] it thinks the string has ended, however a little down the line it finds another [green]"[/green] and there it should have given you an error.

Anyway you have to learn how to use the quotes for strings in PHP it is either double quotes surrounding single ones or single quotes surrounding double quotes. SO if your string starts with double quotes every quote inside is going to have to be a single quote

Try the following:
Code:
 $LoginLogout = "<object width='550' height='400'>
<param name='movie' value='images/logout.swf'>
<embed src='images/logout.swf' width='550' height='400'>
</embed>
</object>";




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top