Hey Greeham,
Try this...
PHP Code:
<?php
// If the session exists do this
if(isset($_SESSION["dtg_userid"])) {
// If the current file is "userhome.php"
// then show "button6.swf"
if(!preg_match("/\/userhome.php/",$_SERVER['SCRIPT_NAME'])) {
?>
<div align="center"><a href="userhome.php" class="toplinkbar style10">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button6.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#F2F7FF">
<embed src="button6.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#F2F7FF"></embed>
</object>
</a>
<?php
}
// Or, if the current file is "signin.php"
// then show "button7.swf"
elseif(!preg_match("/\/signin.php/",$_SERVER['SCRIPT_NAME'])) {
?>
<a href="signin.php" class="toplinkbar style10">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button7.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#F2F7FF">
<embed src="button7.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#F2F7FF"></embed>
</object>
</a>
<?php
}
}
?>
If I understand correctly, you are including this file into both "signin.php" and "userhome.php", and want the script to show "button6.swf" if the user is logged in and is on "userhome.php" or if the user is no logged in and is on "signin.php" to show "button7.swf"?
Hopefully this should do the trick.
Bookmarks