markvaughn2006 Posted September 24, 2009 Share Posted September 24, 2009 Is there a way to make an iframe source conditional? Something like..(I know the syntax isn't exactly correct but you get the idea) If $condition == "Example" { iframe src ="example.php" } Else { iframe src ="different.php" } Thanks!! Link to comment https://forums.phpfreaks.com/topic/175356-solved-if-condition-iframe-src-examplephp/ Share on other sites More sharing options...
Adam Posted September 24, 2009 Share Posted September 24, 2009 Yeah, quite easily: <?php if (your condition here) { $iframe_src = 'example.php'; } else { $iframe_src = 'different.php'; } ?> <iframe src="<?php echo $iframe_src; ?>"></iframe> Link to comment https://forums.phpfreaks.com/topic/175356-solved-if-condition-iframe-src-examplephp/#findComment-924084 Share on other sites More sharing options...
TeNDoLLA Posted September 24, 2009 Share Posted September 24, 2009 Adam was faster .. Link to comment https://forums.phpfreaks.com/topic/175356-solved-if-condition-iframe-src-examplephp/#findComment-924085 Share on other sites More sharing options...
markvaughn2006 Posted September 24, 2009 Author Share Posted September 24, 2009 badass! thanks Link to comment https://forums.phpfreaks.com/topic/175356-solved-if-condition-iframe-src-examplephp/#findComment-924096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.