ifis Posted May 17, 2008 Share Posted May 17, 2008 I'm trying to pull up an external website within my iframe, but the address has a varaible in it ($FILE) that is messing it up. It works in straight HTML; is there anyway to get this to work easily? <?php $read=$_GET['read']; switch($read) { case 'AC61-25f': echo "<iframe src='http://rgl.faa.gov/Regulatory_and_Guidance_Library/rgAdvisoryCircular.nsf/0/c9461c4231acdc7d86256f1c006f8fce/$FILE/ac60-25f.pdf' frameborder='no' width='100%' height='680'></iframe>"; break; case 'Learning Statement Reference Guide': echo "<iframe src='http://www.faa.gov/education_research/testing/airmen/media/LearningStatementReferenceGuide.pdf' frameborder='no' width='100%' height='680'></iframe>"; break; default: thanks Link to comment https://forums.phpfreaks.com/topic/106111-php-and-iframe/ Share on other sites More sharing options...
947740 Posted May 18, 2008 Share Posted May 18, 2008 Put a \ in front of $FILE. It makes the $ a literal character. Otherwise, PHP thinks it is a variable. Seeing as you have not defined it, it is empty, therefore outputting nothing. Link to comment https://forums.phpfreaks.com/topic/106111-php-and-iframe/#findComment-543917 Share on other sites More sharing options...
ifis Posted May 18, 2008 Author Share Posted May 18, 2008 thanks, that worked. The probably knew I should have escaped it, but was not sure if it would work in an address. Odviously, it does, thanks again. Link to comment https://forums.phpfreaks.com/topic/106111-php-and-iframe/#findComment-543921 Share on other sites More sharing options...
947740 Posted May 18, 2008 Share Posted May 18, 2008 No problem. Please hit the "Topic Solved" button. Link to comment https://forums.phpfreaks.com/topic/106111-php-and-iframe/#findComment-543924 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.