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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.