desjardins2010 Posted February 5, 2014 Share Posted February 5, 2014 can you tell me this link below what proper way to include a php variable <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=USER_ID" frameborder="0" width="728" height="2400" scrolling="no"></iframe> need to add $username to the USER_ID part I tried just <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=$username" frameborder="0" width="728" height="2400" scrolling="no"></iframe> should that not work??? I thought it would but - superrewards app don't show and I thinking might be casue this is not bring in the username Quote Link to comment https://forums.phpfreaks.com/topic/285961-php-variable-in-href-link/ Share on other sites More sharing options...
ginerjm Posted February 5, 2014 Share Posted February 5, 2014 That syntax is correct. Quote Link to comment https://forums.phpfreaks.com/topic/285961-php-variable-in-href-link/#findComment-1467849 Share on other sites More sharing options...
Ch0cu3r Posted February 5, 2014 Share Posted February 5, 2014 (edited) That syntax is correct. No the syntax is correct for the HTML, but PHP code is only parsed if it is within <?php ?> tags. @desjardins2010, have you tried <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=<?php echo $username; ?>" frameborder="0" width="728" height="2400" scrolling="no"></iframe> Edited February 5, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/285961-php-variable-in-href-link/#findComment-1467851 Share on other sites More sharing options...
ginerjm Posted February 5, 2014 Share Posted February 5, 2014 Perhaps my mistake. I assumed OP had that html in a heredocs which is how I code most of my html Quote Link to comment https://forums.phpfreaks.com/topic/285961-php-variable-in-href-link/#findComment-1467852 Share on other sites More sharing options...
davidannis Posted February 6, 2014 Share Posted February 6, 2014 The answer is in post #3 by ch0cu3r : @desjardins2010, have you tried <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=<?php echo $username; ?>" frameborder="0" width="728" height="2400" scrolling="no"></iframe> Quote Link to comment https://forums.phpfreaks.com/topic/285961-php-variable-in-href-link/#findComment-1467916 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.