Solved

change iframe PHP variable into php include

Posted on 2010-11-09
3
427 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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ropenner earned 500 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 108

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now