Changing a flash for a picture

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Sandrine
Forum Newbie
Posts: 10
Joined: Wed Nov 16, 2005 6:14 am

Post by Sandrine »

This is it:

Code: Select all

<?php 
$urlvars = (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : "none"); 
if($urlvars == "none")
 { 
  include ("http://www.yayasan.org/templates/tdwfreedom/flash.php"); 
} else { 
  echo '<img src="'.$mosConfig_live_site.'/templates/tdwfreedom/images/mainpiclogo.jpg" border="0" alt="Photo by Andrea Simonato - downloaded from www.sxc.hu">'; 
} 
?>
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

echo $urlvars to see what it shows you should.
Sandrine
Forum Newbie
Posts: 10
Joined: Wed Nov 16, 2005 6:14 am

Post by Sandrine »

No, it does ot have any sense.
Someone, any idea ?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Code: Select all

<?php 
$urlvars = (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : "none"); 
echo $urlvars;
?>
what does that show?
Sandrine
Forum Newbie
Posts: 10
Joined: Wed Nov 16, 2005 6:14 am

Post by Sandrine »

Here is the code that works:

Code: Select all

<?php 
$msg = $_SERVER['REQUEST_URI'];
$emeteur = substr($msg, 0, 3);
$size = strlen($emeteur);
if ($size == 1) { 
  include ("http://www.yayasan.org/templates/tdwfreedom/flash.php"); 
} else { 
  echo '<img src="'.$mosConfig_live_site.'/templates/tdwfreedom/images/mainpiclogo.jpg" border="0" alt="Photo by Andrea Simonato - downloaded from www.sxc.hu">'; 
} 
?>
Found it alone !! :D

Regards.
paulfynch
Forum Newbie
Posts: 6
Joined: Thu Nov 17, 2005 1:41 pm

Simpler answer

Post by paulfynch »

...for a Mambo site (which it looks like you are using)

Code: Select all

<? if($_SERVER['QUERY_STRING']!=""){echo "<object (flash stuff)......>"; } else {echo "<img (picture stuff)>";}?>
Cheers!
pf
Post Reply