473,969 Members | 44,025 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

25 New Member
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 7806
Markus
6,050 Recognized Expert Expert
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
kierandes
25 New Member
@Markus
Thanks Bud, did the trick :).
Jun 6 '09 #3
Markus
6,050 Recognized Expert Expert
@kierandes
Welcome.

- mark
Jun 6 '09 #4

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

Similar topics

1
1243
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" src="menu.html"> I think I can use javascript to change the name attribute of the iframe, and then have menu.html display that info. so lets say bali.html loads the iframe with menu.html. I'd then like
7
2716
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. alert(iframe.contentWindow.document.documentElement) gives null.
3
6788
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 application is based on mysql and php on a remote server, and is accessed by the user via a web browser, primarilly IE. The image file names are built up by the server side php scripts, and so a URL for the image file is created, but the file itself is...
4
2999
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 the fixed part, I want to change the contents of my IFrame (= changing the source of my Iframe to another webpage). How do I do this? The Iframe I can not maged it from my c-sharp code (I don't see it as a webcontrol). Thanks
5
4657
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
9406
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 can use it there. Thanks in advance :) Paul
9
11213
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 DIV: <IFRAME id=myframe style="display:none" src="..." onload="ShowNews(this)"></IFRAME>
1
19314
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 is, that it doesn't always save the session. When I try to access it from some computers, I have no problem, the session variable is stored and I can browse the site in the IFRAME and everything's ok, but on other computers, the session variable...
5
2692
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(); The problem I am having with this is that the above function gets called ***after*** the long-running response is completed.
0
10320
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10135
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11792
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8427
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6377
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.