display files from onedriver in iframe - php

I use iframe to view files from onedriver on my web app php.
it works fine before, but recently I can not, I have tried many ways but no result
This is code for my file php
<iframe src="https://onedrive.live.com/view.aspx?cid=ca91cd81c0fee9e6&resid=CA91CD81C0FEE9E6%21262&app=Word&authkey=%21AJHFjDm4aQXDEb4&wdo=1" frameborder="0" width="100%" height="100%"></iframe>
I was wrong place, everyone helps me!

On the document, right click and select: "embedded".
It will generate an iframe for you.
More information

Related

creating links that function within an iframe of a php document

I have an application form I need to work into an iframe, but I'm having a hard time with the links for it. Because the iframe was initially giving me errors, I started a work around by having a workaround.php file made that would be read as:
<!DOCTYPE html><html><?php echo file_get_contents($_REQUEST['url']); ?></html>`
Then in the iframe on my page I wrote:
<style><!--iframe.Application {
overflow: hidden;
}
--></style>
<iframe width="100%" height="800px" style="height: 100vh;" class="Application" scrolling="no" src="https://www.mywebsite/workaround.php?url=https://theotherwebsite.com"></iframe>
This worked out very well and I now had the form loading seamlessly onto my website. The next issue was that the links are not working. Any root-relative link within the iframe form was linking to "https://mywebsite.com/page2" rather than to "https://theotherwebsite.com/page2".
Now the manager of the website with the form would be able to change these relative links to absolute links, so this isn't a huge obstacle. To test if it would work, I edited the links in my browser to be an absolute to:
<a href="https://theotherwebsite.com/page2">
For this the iframe refused to connect. I'll need to continue to use workaround.php. Next I tried:
<a href="https://www.mywebsite/workaround.php?url=https://theotherwebsite.com/page2">
For a moment, I see the 2nd page load within the iframe, but then the page opens outside of the iframe in the same tab & window. Additionally, the page that loads is "https://www.mywebsite/workaround.php?url=https://theotherwebsite.com/page2"
At this point, I'm unsure of what link would function and stay within the iframe. I tried to add the "_parent" target.
<a href="https://www.mywebsite/workaround.php?url=https://theotherwebsite.com/page2" target="_parent">
but this changed nothing from my previous attempt. I tried likewise with _self and _top to find no change. _blank still functioned to open the page in a second tab.
At this point I'm not familiar enough with iframes to know what else to attempt. I hope my explanation of past attempts and results is easily understood. If any of you have a suggestion of what could be a solution please let me know!
TLDR: How do I open a link within an iframe of a php document without it opening a new tab?

Passing Params to Wufoo iframe

Ok so there are tons of examples on how to pass custom parameters hidden fields in Wufoo forms (in my case the current URL of the form). The problem is these all deal with the javascript embed code. I'm working with a company whos custom backend won't allow the js embed and therefore I must use the iframe embed method. I cannot for the life of me figure out how to do this. There are a couple frustratingly close examples that mention using PHP successfully but never show the actual implementation. Can anyone tell me how to do this or point me in the right direction? Relevant info:
I currenlty have a field that is hidden using css. I want that field to be populated with the url or some part of the url it could be www.host.com/thepage or just /thepage as long as we can see where on the site the user submitted the form
http://help.wufoo.com/articles/en_US/SurveyMonkeyArticleType/URL-Modifications <- the page every post I've read mentions. http://www.wufoo.com/forums/discussion/3349/how-to-pass-dynamic-value-into-embedded-forms/p1 <- example using php but with javascript embed methodExample iframe embed code:<iframe height="763" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="https://username.wufoo.com/embed/formid/">Fill out my Wufoo form!</iframe>
It seems the appropriate way is to use the URL method.
Adding "def/" at the end of your src, then any arguments you wish to pass.
For example, if I wanted to disable secure SSL, I'd use:
<iframe height="763" allowTransparency="true" frameborder="0"
scrolling="no" style="width:100%;border:none"
src="http://username.wufoo.com/embed/formid/def/secure=false">
...
Additional parameters can be added using the '&' character.
(note that I also changed https for http)
In fact, if you already have a javascript example of what you want, the only thing javascript does is add this iframe for you, so if you can run it in your browser (by making a local HTML file, for example) using Inspect Element and navigating to the created iframe element, you can copy and paste the resulting code to your site, tweaking as desired.
Regarding PHP, all they mean is to construct the URL using things like echo or print. For example:
<iframe height="763" allowTransparency="true" frameborder="0"
scrolling="no" style="width:100%;border:none"
src="https://username.wufoo.com/embed/formid/def/fieldx=<?php echo $the_url; ?>">

iframe php injection into my html site

I have quite a small website, with a total of 3 webpages, consisting of only html, css and jquery...now on one of my .html pages, I have this annoying iframe injection (the source file is php) that is added on top of my body tag each time i load my page. Now I deleted all my referenced stylesheets, plugins etc one by one but the only way get rid of it is if I delete all my content for that page. How do I get rid of this iframe? Any tips?
Note that the same plugins I used on my other pages I used on this 'hacked page', except for one plugin...but removing that one plugin does not fix it...?
Here is the iframe code I got by inspecting the element: this whole part below is injected
<div style="padding-left: 120px;">
<iframe width="728" scrolling="no" height="90" frameborder="0" allowtransparency="yes" src="http://b.admedia.com/banner.php?id=18793&sr=1&injection_code=true&subid=FC&ip=[IP]&ua=[UA]&transparency=[TR]&highlight=0&style=1&appnxsId=860932&size=728x90&search=digital cameras&force=1&ref=&bpage=">
<html>
<head>
</head>
<body>
</body>
</html>
</iframe>
</div>
You almost certainly have malware on your PC.
For example, see this and this. Most likely you have a trojan that is injecting the code into explorer, enabling the attacker to farm for ad clicks.
You can confirm by trying a different browser or running a virus/malware scanner.

How to Show google map?

I am trying to show a google map using the following code:
<embed height="400" width="600" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=110069293083852065946.00047e2506156dd8d127b&ll=27.727526,85.310855&spn=0.021197,0.038581&z=14&iwloc=00047e251edcecb28ba7c&output=embed">
It works fine and shows the map correctly in my chrome browser by it shows missing plugin in firefox browser.
What is wrong with this? Is the code itself wrong?
Try using an iframe, not sure where that embed tag came from.
<iframe width="400" height="600" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=110069293083852065946.00047e2506156dd8d127b&ll=27.727526,85.310855&spn=0.021197,0.038581&z=14&iwloc=00047e251edcecb28ba7c&output=embed"></iframe>
There's plenty of documentation on this:
http://code.google.com/apis/maps/documentation/javascript/basics.html
I've never seen it use embed, usually you just create it using JavaScript assign it to a div tag.

Broken images in PHP from Dropbox over https

I have a strange situation with PHP working differently from HTML. I'm not a web programmer, just messing around. In HTML my images appear fine, in PHP the images are broken. And only public images from my Dropbox https server are broken, ones from a http server work.
As an example, here are two files on my localhost, abc.html and def.php. They try to display two images, one pointing to my https image, and another pointing to the Google logo.
abc.html:
<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'>
<img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>
def.php:
<?php
echo "<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'>";
echo "<img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>";
exit;
Browsing to abc.html shows both images perfectly. Browsing to def.php only shows the Google logo and the other image is broken.
It doesn't work on Firefox however someone told me it works on Opera.
Ideas please :)
Edit: def.php outputs this:
<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'><img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>
I'd recommend installing FireBug to see what the return response from the server is. You might find that DropBox is refusing to serve requests for images with referrals from files ending with certain extensions, e.g. .php.
This might explain the duplicate behaviour with the plain HTTP too.
This works on my Firefox version 3.6, the image shows perfectly well:
<HTML>
<HEAD>
<TITLE>My WebPage</TITLE>
</HEAD>
<BODY>
<img src="https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM" />
</BODY>
</HTML>
Try this:
<?php
echo '<img src="https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM">';
echo '<img src="http://www.google.co.uk/intl/en_uk/images/logo.gif">';
exit;
If that works, it's because html attributes should be bounded by double quotes, not single quotes. Perhaps some browsers forgive that and some do not.
An obvious observation but does your def.php have the closing php tag? Your code example does not...
<?php
echo '<img src="https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM">';
echo '<img src="http://www.google.co.uk/intl/en_uk/images/logo.gif">';
exit;
?>
Edit: Saved the above as a html file, and I only see one image in Chrome... ALSO - Do you have the PHP module installed/associated with your web server?
Try 'view source' in both and compare the results.

Categories