why external site is not being shown inside iframe? [duplicate] - html

This question already has answers here:
Getting Past Facebooks Iframe Block
(2 answers)
Closed 9 years ago.
it has been a while since my last time working with iframes, now i need to load some external sites inside iframes but nothing is happening. This are the iframe tags, the wierd thing is that nothing is being shown inside this iframes. Is there something that im missing?
for ($j = 1; $j < 10; $j++) {
$urls[] = 'http://www.facebook.com/profile.php?id='.$friends["data"][$j]["id"];
}
echo '<div class="container"><div class="row-fluid">';
foreach($urls as $url){
echo '<iframe id="face" name="face" src="'. $url .'" style="width: 100%; height: 200px;"></iframe><br>';
}
echo '</div></div>';
}
Each $url is a friend's facebook profile and they are being loaded perfectly fine but nothing is being shown inside my iframes. Any ideas? i also tried with google.com... same thing, nothing is being shown.

Likely because Facebook has explicitly disallowed iframing their pages using the X-FRAME-OPTIONS header. This is primarily a security measure, supported by newer browsers.
Look in your browser's console for a message like this:
Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

Related

Embedding an iframe in Wordpress does not work

I need to embed the following code on a self hosted Wordpress installation -
<iframe id="slydy"
style = "border: none; max-width: 100%; min-width: 100px;"
src = "http://slydy.co/users/TCC/01"
width = "648"
height = "435"
frameborder = "0"
marginwidth = "0"
marginheight = "0"
scrolling = "no"
allowfullscreen = "allowfullscreen">
</iframe>
but it just doesn't show up. I've installed the same on at least two other Wordpress blogs and it worked just fine.
What setting do i need to tweak?
probably one of these things:
if your website httpS then its blocked because your iframe is http.
make sure that you in text ( not visual ) editing mode on post editing screen
WP caching ?
The Wordpress editor blocks/removes iframes. Try using some of the plugins out there that supports iframes, og make an Shortcode to make iframes.

Can I set more than one hyper links on single word? [duplicate]

This question already has answers here:
How can I open multiple links using a single anchor tag
(2 answers)
Closed 7 years ago.
I want to know that Can I set more than one links on single word in html?
I've experimented like:
<a href="link2 target="_blank>Open</a>
Open
This is only example idea what I want to do ; of-course either of above is not working.
So, How can I set more than one links to different target on single word?
Is it possible with html or <a> or something else.
No, you can't.
If you are open for javascript you could create a function that takes urls and have the function call window.open but that is likely to get blocked by pop-up blockers.
/* this function tries to open the
arguments supplied to it*/
function opensesame() {
for(var i=0; i < arguments.length; i++) {
$('#log').append($('<div></div>').text('trying to open '+ arguments[i]));
window.open(arguments[i]);
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- you can have a local link in href -->
<a href="#"
onclick="opensesame('http://www.google.com','http://stackoverflow.com');">
open sesame
</a>
<div id="log">
</div>
From the FAQ on the window.open documentation:
How can I tell when my window was blocked by a popup blocker?
With the built-in popup blockers of Mozilla/Firefox and Internet Explorer 6 SP2, you have to check the return value of window.open(): it will be null if the window wasn't allowed to open. However, for most other popup blockers, there is no reliable way.
I leave it as an exercise for the reader to extend this to take target settings as well.
No, you can't.
It's possible to have two different links in different parts of the same word, but not on the same.
uniform
You need Javascript for such thing.

Open page as pdf with DOMPDF

I am currently working on a semi dynamic page where I use some GET functionality to personalize it. I also echo the date a couple of places. At the bottom of this page, I would like to have a button that gives the visitor the option to download/open this page as PDF. Without the header. I have integrated DOMPDF, but I simply cant get it to work properly and need some help. I have tried a couple of things found here on Stackoverflow, with no success.
In basic, I need the whole page printed in the PDF, but it should not open when page is loaded. But triggered by the button. And then without the header (one spesific div). Is this possible?
<?php
require_once("dompdf/dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>This is a test for '.
'<?php echo htmlentities(substr(urldecode($_SERVER["QUERY_STRING"]), 1)); ?> </p>'.
'<p>Thank you for reading.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("the_inquiry.pdf");
return true;
?>
<html>
<body>
<div class="shouldnotPrintToPDF">
Content.
</div>
<div class="shouldPrintToPDF">
Sensitive content.
Open or save as PDF
</div>
</body>
</html>
This is basically our one page presentation. And contains a lot of text, so I will not present all of that here. But in this way, I have to write the page twice, in $html = as well as inside the actual tag. And the PDF save/open option pops up right from the start, which it should not. I also wish to append the echo htmlentities part to the actual pdf-name.. is this possible? The PDF opens and contains what put into the $html = just fine. But not triggered by the link.
Update:
When i do exactly what you perform here, I get an error "The requested URL /inquiry.php&pdf=1 was not found on this server." I have the page I am trying to print in pdf on root level, but the DOMPDF is in /dompdf.. I dont know if that has anything to do with it?
Update:
When i edited the link, i get all this information up in a new page, like below.
[_parse_properties(margin:=1.2cm)(empty)_parse_properties]
[_parse_sections[section[_parse_properties(display:=-dompdf-page)
(counter-reset:=page)(empty)_parse_properties]#html#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]
_parse_sections][_parse_sections[section[_parse_properties(display:=block)
(empty)_parse_properties]#div##map##dt##isindex#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]
_parse_sections][_parse_sections[section[_parse_properties(page-break
-before:=avoid)(display:=block)(counter-increment:=page)
(empty)_parse_properties]#body#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(margin:=1em
0)(empty)_parse_properties]#p##dl##multicol#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(margin-left:=40px)
(empty)_parse_properties]#dd#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(margin:=1em
40px)(empty)_parse_properties]#blockquote#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(font-style:=italic)
(empty)_parse_properties]#address#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(text-align:=center)
(empty)_parse_properties]#center#section]
Do you have any idea what it might be caused by?
Breakthrough:
When I activated DOMPDF_DPI it actually opens as PDF, but now all of the text comes on first line of the second page of the PDF. Like, all the text comes out on top of each other. Also, when it opens the PDF, the ?&pdf=1 are included in the htmlentities query string, which looks very messy since it is supposed to be a personalized page as well as the PDF.
You can set dompdf to parse CSS #media queries for standard media types (screen, print, voice, etc.). By default dompdf parses the "screen" media type styles, but you can change this in the configuration file. See the DOMPDF_DEFAULT_MEDIA_TYPE configuration setting. Then you just need to pass the original URL querystring with an appended variable telling the page to render to PDF. If your original URL is something like the_inquiry.php?name=Joe then your PDF URL could be the_inquiry.php?name=Joe&pdf=1.
Your code would then look similar to the following:
<?php
ob_start();
?>
<html>
<head>
<style>
#media print {
.shouldnotPrintToPDF, .pdflink { display: none; }
}
</style>
</head>
<body>
<div class="shouldnotPrintToPDF">
Content.
</div>
<div class="shouldPrintToPDF">
Sensitive content.
Open or save as PDF
</div>
</body>
</html>
<?php
if ( isset( $_GET['pdf'] ) ) {
require_once 'dompdf/dompdf_config.inc.php';
$html = ob_get_clean();
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("the_inquiry.pdf");
}
?>

Progress Bar for Online Web Form

I am making a application form for a survey of sorts, and want to include a progress bar at the top showing graphically (not really high end) how far the user has got.
I've spent a while surfing the net and asking Google in various ways to do this but it all comes out with progress bar for upload/download.
I am writing the form in XHTML and CSS with a PHP handler to a MySQL Database. The general thinking seems to be ASP (a few are JQuery)to which I have no experience, if it needs to be ASP then fine, but is there any other way and if it does need to be ASP can you please help?
Thank you in advance.
Possible solutions:
Include another image on each page, showing the progress.
Use php to get the current progress and include the image.
Make a div as a progressbar with different width
...
You could even just use simple html... However, here are two possible solutions with php:
<?php
$progress = 1;
$max = 5
echo "<img src=\"progress_".$progress.".jpg\" />"
?>
where progress_1.jpg, progress_2.jpg,... are your images.
Without images - just CSS:
<?php
$progress = 70;
$max = 100;
?>
<div style="height:15px; width:<?=$max?>px; background-color:silver; padding:1px;">
<div style="height: 100%; width:<?=$progress?>px; background-color:yellow"></div>
</div>

HTML5 Canvas - awesome charts error - when used inside php - base64 output

First thanks for the awesome charts - they are simple and i am trying them out for a friends website.
A brief abt the site -it is a stock market related website trying to show a index from Bombay Stock Exchange in detail. Doing it for a friend basically for free.
The site is in wordpress and use wp exec php for inserting php into posts etc. I am trying to insert the chart html code inside php - since I get a variable data through php from a url and on the fly i define it into a csv - field like - echo $mycsvfile[49][0]; which out puts a value from 49th row 0 coloum.
So if the php ends the temp values are lost so basicallt what i have to do is - get both the java script and also html div into the php.
what i tried first was to get the div only into php to sse the default output - but the output is coming as - base64 code - ie numericals etc. I dont know how to output that into image and embed into the page - inside php.
The link being - http://www.shariah50.net/live-stock-price-quotes-shariah-index-bse/
Trying to display two images- inside php and another one pure html as u had given.
pls guide
how to output that into php and get an image
how to code the javascript into php - since i need to pass variables into the javascript.
Two ideas i had - dont know how good they are - is it ok to convert the canvas element into a jpeg or png, and secondly - can we convert the in page javascript into a php query...
Waiting for ur reply - tried to find a solution for it but couldnt online ...
What code i am using is basically below -
echo ' ';
echo ' ';
echo ' Your web-browser does not support the HTML 5 canvas element.';
echo ' ';
echo ' ';
?>
.chart_container{ text-align: center; width: 400px; height: 400px; margin: 0px 25px; float: right; }
<div class="chart_container">
<canvas id="chartCanvas11" width="400px" height="400px" float="right";>
Your web-browser does not support the HTML 5 canvas element.
</canvas>
</div>
<script type="application/javascript">
var chart11 = new AwesomeChart('chartCanvas11');
chart11.chartType = "horizontal bars";
chart11.title = "Charts";
chart11.data = [-12.62,13.3,10.06,4.27,1.96,0.78];
chart11.labels = ['IE','Firefox','Chrome','Safari','Opera','Other'];
chart11.colors = ['#006CFF', '#FF6600', '#34A038', '#945D59', '#93BBF4', '#F493B8'];
chart11.randomColors = true;
chart11.draw();
</script>
Ok, the basic flow is:
Create an Image element that has the base64 image string as src value. Example: <img src="data:image/png;base64,iVBORw0KG...
I don't really understand your question and how it is related to html5, but "putting javascript into php code" is the same as "putting html into php code".