Jump to content

php variable in href link


desjardins2010

Recommended Posts

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 

Link to comment
https://forums.phpfreaks.com/topic/285961-php-variable-in-href-link/
Share on other sites

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>

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.