iframe not working, on kiwiirc embed - php

I was writing a long .php website and thought about embedding kiwiirc. The issue is, I keep getting an empty frame. The problem is even worse when I figured out that iframe for kiwiirc.com itself works, but not for the full embed code (example for not working: https://kiwiirc.com/client/irc.kiwiirc.com/?&theme=basic#your_channel ). Other sites work as expected too, the only issue I appear to have with is their own embed links. If I open their link in a browser, it works. I'm trying to run it on localhost.
Example of code not working:
<!DOCTYPE html>
<html>
<head>
<title>TEST</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<iframe src="https://kiwiirc.com/client/irc.kiwiirc.com/?&theme=basic#your_channel" style="border:0; width:100%; height:450px;"></iframe>
</body>
</html>
Kiwiirc's embed links: https://kiwiirc.com/embedding

If you run a Kiwi applet in a frame or iframe you have to enable third party cookies because the browser sees two different domains. Your domain and the domain where the cookies come from (your embedded applet)

Just a heads up, nothing wrong with the code. I installed chromium and tested it, and it worked. Usually using firefox with a lot of addons, odd thing being that all other embeds worked, and so this specific url when opened in a new tab.
I know it's not much of an answer, but it's browser's fault.

Related

How to Visit a Site in Cron and Follow HTML Meta Redirects

Is there a way/tool to visit a site in cron that is capable of following HTML Meta Tag Redirects?
A programmer wrote a feature that when hit through a browser returns
<html>
<head>
<!-- HTML meta refresh URL redirection -->
<meta http-equiv="refresh"
content="0; url='.$base_url.'/cache/'.($trip_index+1).'">
</head>
<body>
<p>The page has moved to:
'.$base_url.'/cache/'.($trip_index+1).'</p>
</body>
</html>';
In a browser that will take you from example.com/cache/1 to example.com/cache/2 automatically until all the steps are done. Then the client came back and also wanted it to be automated...
I can't use cURL even with the -L flag because it only follows redirects in headers like 301, not the HTML ones.
I then found out about links and that worked great from the CLI with something like links -html-auto-refresh 1 example.com/cache and finished to the end. But unfortunately it doesn't work in cron because the refresh is part of the rendering itself.
So is there a tool that will work from a cron task that will do this? Browser testing tools? Selenium? PhantomJS? Splash?

codeigniter letter at start of every page

I'm working on a website, which I have temporarily hosted here.
You'll notice the mystery letter 'a' I'm getting at the start of every page. I've gone through all the php files (controllers, views, models) and cannot locate where this letter is coming from. Another curiosity is that all the head content is not residing in the head tags when inspected with Firebug. It appears in the body tags, however it still functions correctly. Are these two issues related?
The only thing I have found from searching the internet is that perhaps some files have been saved as ANSI instead of UTF-8. I've tried 'saving as' all my php files as UTF-8 using my editor, but it is a very slow process. Any help debugging this situation would be appreciated.
EDIT- thanks for your response, #erman-belegu. It doesn't seem to be in any controller. For instance, I've set up a 404 redirect, with its own controller and view. The view looks like this:
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="No Page">
</head>
<body>
<h1>No page dude.</h1>
</body>
</html>
But when inspected with firebug, it looks like this:
<html>
<head></head>
<body>
a
<meta content="No Page" name="description">
<h1>No page dude.</h1>
</body>
</html>
I have encoded everything using UTFCast, and am still experiencing the same issue. Any help welcomed.
You see the head inside the body tag because the mysterious "a" is the first character of your output. It's put inside the body tag by the rendering engine of your browser, or by firebug.
If you find the cause of your "a" - almost certainly some content outside PHP tags - the head will return to normal in firebug.
Searching for the "a" is tricky.. I'm not sure how large your codebase is, but I'd say start by exiting the process right before output is sent. You should see only the "a". Then move the exit step by step untill your "a" disappears, and you'll find it.
Check your controllers at start or maybe any print somewhere. Check all your code on these pages because you print these "a ".
Also use UTF-8 without BOM. But, I think that you print it accidentally and dont think that this happens for any other reasons.

PHP MAMP not showing all of HTML document

I am using MAMP. None of my code after the PHP tags displays in a browser.
I suspect it's something related to what content I can send to the browser after sending PHP? Or what content can be sent before the HTML doc?
Code:
<?php
/* Web Controller for searching music */
session_start();
echo "I display fine!";
?>
<html>
<head>
<title>Listen2me</title>
</head>
<body>
<h1>Listen2.me</h1>
<input type="text" name="songChoice" value="Search songs">
</body>
</html>
Maybe the missing doctype declaration could affect the display:
<!DOCTYPE html>
Did you try uploading the file to a different server to see if it's a problem with your localhost or a problem with your file?
When I run into issues where the code looks fine but it's not working fine, I always run it through BBEdit's "zap gremlins" feature. You might have an invisible bad character in there somewhere that's messing stuff up. If you don't have BBEdit, you can recreate the document from scratch. Don't copy-paste, because you'd just be copy-pasting any bad characters right back into the new document.

Send IE 7 (and below) to old/sub directory of site. <!-- [if IE 7]><"LINK TO OLD SITE"/><![endif]-->

I have just launched a site (using Joomla and a custom template), which doesn't display that well in IE7 (and I guess below too). I have looked around and have found out that you can link to different style sheets from my index.php, however, instead of linking to a different style sheet, I want it to link to the older site which is still live (under www.mydomain.com/old).
Is that at all possible?
As stated in the title, I have looked around and found out that you could use an if statement like this -
<!-- [if lte IE 7]><"LINK TO OLD SITE"/><![endif]-->
is what I'm trying even possible? I haven't got anywhere with it so far, trying the usual html tags of href="http://www.mydomain.com/old"
Any help would be great on this. I'm just getting stuck at the moment!
Conditional comments are used in the client-side part of your page, and so are not useful for PHP. You can use a conditional comment with JavaScript like this:
<!— [if lte IE 7]>
<script type="text/javascript">
top.location.href = "http://www.mydomain.com/old";
</script>
<![endif]-->
The disadvantage of this is that you are performing this task on the client machine, which is slower than if you performed the redirect on the server and sent to user to a different page instead. You can do this using PHP by checking the browser version and redirecting with header:
$browser = get_browser();
if($browser->browser == 'IE' && $browser->majorver <= 7) {
header('Location: http://www.mydomain.com/old');
}
Bear in mind that for this to work you must call header before any data is sent to the client.
Well, much reasonable would be to catch IE7 users before they started to render the page.
So it could be done with server-side script either with some mod_rewrite. Would be easier and faster.
I used Google to find this.
The objective of this technique is to enable redirects on the client side without confusing the user.
...
In HTML and XHTML, one can use the meta element with the value of the http-equiv attribute set to "Refresh" and the value of the content attribute set to "0" (meaning zero seconds), followed by the URI that the browser should request.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The Tudors</title>
<meta http-equiv="refresh" content="0;URL='http://thetudors.example.com/'" />
</head>
<body>
<p>This page has moved to a <a href="http://thetudors.example.com/">
theTudors.example.com</a>.</p>
</body>
</html>

How to hide url in php?

I am working on site in the php. In this site i have 10 screen shot images with herf tag. When a user click on any image, there should open a new tab with that site but actually showing the url of my site. Eg : if my site is www.abc.com From this site user will redirected to www.xyz.com. But the url above should www.abc.com. It will shows all the functionality of xyz.com site. If anybody knows, plz help me. I have seen that type of functionality somewhere before.
You could do that with a full iFrame, however that's really not the thing you want to do unless absolutely necessary.
The iFrame solution is very simple and maybe the best one for your problem.
But just to provide another possibility: You could implement a sort of web proxy with the PHP function file_get_contents. If you do something like that, you eventually have to deal with streams to preserve the context (COOKIES, etc.).
Finally you will have your own URL (maybe rewritten, to look nice), where the content of the other website is shown (but without correct ajax calls and maybe other issues).
You could use an iframe... or maybe .htaccess file will do what you need..?
If I get you right you want to change the browser's adressbar content? You can't do that.
I've found this on stackoverflow:
Modify the URL without reloading the page
Use full screen iframe:
<html>
<head>
<title>full screen iframe</title>
<style type="text/css">
/* Full Screen The Page Fix*/
body { margin: 0; }
</style>
</head>
<body>
<iframe src=".../site.html" style="border: 0; width: 100%; height: 100%">Your browser doesn't support iFrames.</iframe>
</body>
</html>

Categories