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!! Quote 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> Quote 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 .. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.