473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Echo an iframe with a html src that has a php variable

Hey Guys,
I am trying to make a iframe that changes depending on variables I call from a database. The database is working, variables are filling up, but I am having trouble with the echoing a iframe with the php variables within it. With some help from Markus I've made some progress but my attempts so far have been unsuccessful.

Expand|Select|Wrap|Line Numbers
  1. echo "<iframe SRC=/"http://www.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=\"\" , $lat_mins , ".width=/"100%/" height=/"100%/" frameborder=/"0/">If you can read this your browser does not support iframes</iframe>" ;
in the above attempt I am trying to concatenate the PHP variable to the html src for the iframe, but I get the following error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

its probably something I'm missing, any ideas guys?
Jun 6 '09 #1
3 7758
Markus
6,050 Expert 4TB
Instead of having to escape the nested double quotes, use single quotes. Also, when using double quoted strings, you don't need to concatenate a variable into a string.

Consider the below:

Expand|Select|Wrap|Line Numbers
  1. echo "My name is 'Mark'. {$vars} can be put in without {$needing} to concatenate the ${string}.";
  2.  
You get the error because you haven't properly escaped the nested double quotes (you used a forward slash instead of a backslash).

- mark.
Jun 6 '09 #2
@Markus
Thanks Bud, did the trick :).
Jun 6 '09 #3
Markus
6,050 Expert 4TB
@kierandes
Welcome.

- mark
Jun 6 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Angelo | last post by:
I'm trying to use iframe to create a menu for a bunch of pages - only I'd like the menu to change slightly (a highlight) depending on what page it's being displayed in. <iframe name="menu"...
7
by: Vincent van Beveren | last post by:
Hi everyone I have a JavaScript app that creates an IFRAME through DOM (createElement('IFRAME')) However, that IFRAME does not have any content yet. ...
3
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The...
4
by: Jaco | last post by:
Hey, Maybe I am in the wrong newsgroup. I am writing an browserapplication. In the webpage I have 2 parts a fixed part and a variable part. The variable part is an IFRAME. If I press a button in...
5
by: mike | last post by:
If I have a document like: <script> function mike_test() {alert('hi');} </script> <iframe src="blank.html" id="my_iframe1"> </iframe> and in blank.html I have:
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
9
by: aatcbbtccctc | last post by:
Hi folks I've googled for an answer to this, with no success. Can someone please jump in, and put me out of my misery! (I'm sure it's quite simple) I have an invisible IFRAME, and a visible...
1
by: zzzbla | last post by:
Hello, I have a project in which I'm trying to embed one site, that uses session stored variables, inside an IFRAME in another site (which for that matter doesn't even use sessions). Problem...
5
by: pbd22 | last post by:
Hi. I am trying to poll a long-running process via a hidden IFrame. I am noticing that the online errata gives advice for handling a server response: window.parent.handleServerResponse(); ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.