[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

change iframe PHP variable into php include

Posted on 2010-11-09
3
Medium Priority
?
444 Views
Last Modified: 2012-05-10
I currently use a php variable in a <iframe> like this:

<iframe src="<?=$iframe_url;?>" width="565" scrolling="no" height="3500" frameborder=0></iframe>

I need to make it into a php include and have tried different variations of the following to no effect?  What am I doing wrong?

<?php include('$iframe_url;'); ?>
0
Comment
Question by:pda4me
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ropenner earned 2000 total points
ID: 34098645
if

$iframe_url = "http://google.ca"

in both your examples it does not make sense in the 'include' case

if however there is a file called "test.txt" and that file looks like:

http://google.ca

and the variable

$iframe_url = "test.txt";

and that file is in the include path and has accessible permissions then.

it will insert the correct url into your frame declaration and the final result will be:

<iframe src="http://google.ca" width="565" scrolling="no" height="3500" frameborder=0></iframe>

to test for a correct include you can write this in PHP

include_once test.txt;

and the result should be output of the text in the test.txt file namely:

http://google.ca
0
 
LVL 8

Expert Comment

by:ropenner
ID: 34098650
test code should have been:

include_once "test.txt";
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 34105564
Can you please post the code where you are having trouble?  Post the main frame in one code snippet and the iframe frame in a separate code snippet.  Thanks, ~Ray
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question