Using PHP and IFrame to override style of webpage locally - php

I have an account with Simple In/Out. We have 50+ employees and display their statuses (In/Out of office) on a TV at the receptionist desk. However we can't fit all of the employees on the screen without scrolling.
Simple In/Out provides very limited styling to how the list is shown. With CSS I could remove dead space and visually improve the list.
At first I would inspect element and make a few changes however the screen would get refreshed and all changes lost.
I am trying to simply make a .html page that displays an iFrame of the List with Local CSS edits.
The list url is simpleinout.com/list- login and the list displays.
The following 2 files display the page and an appended CSS file with changes however if I click anywhere else the CSS file is removed.
simple.html:
<html>
<head></head>
<body>
<iframe src="http://localhost/~JohnHarbert/simple.php" style="border: 0" width="1920" height="1080" frameborder="0" scrolling="no" ></iframe>
</body>
</html>
simple.php:
<?php
$content = file_get_contents('http://www.simpleinout.com/list');
$content = str_replace('<head>','<base href="https://www.simpleinout.com/" /><head>', $content);
$content = str_replace('</head>','<link rel="stylesheet" href="http://localhost/~JohnHarbert/style.css" /></head>', $content);
echo $content;
?>
Again. The code does append the css file on the initial load(It adds it just before ). But when I click to display list. The css file is no longer added inside the Iframe.
You're help is much appreciated.

I'm the web developer behind Simple In/Out.
The easiest way to fit more users on your screen would be to use the font/column controls in the upper right. Once you've entered Full Screen mode, click on the gear icon in the upper right. It will allow you to choose anywhere from 2 to 6 columns of users and you can adjust the font size to fit more on the screen.
Hope that helps!

Related

Embed iframe into a php file

I recently started a new position as a graphic designer for a local nonprofit. I have a little background in HMTL and CSS, but their website runs on PHP and I'm already struggling to work with the code.
I need to add an inline frame to embed a webpage within a specific page on our website. The programmers who built our site didn’t build a user friendly interface where we can embed HTML, so I'm told that I need to add the iframe snippet into the PHP for that page. However, the page I want to edit does not have it's own PHP file. It is a subpage under one of the site's main nav categories. I was able to find a PHP file which corresponds to that main nav category that this subpage falls under. I believe that this is where I would need to add the code. It appears to be a template which structures all of the pages inside of this broader nav category.
Can anyone help me with this? I'm not sure if you can just add HTML to a PHP file as is, or if it needs to be altered a bit. Also I need to know how I could have the PHP template selectively load the desired iframe only on the page that actually needs it - I don't want that iframe to appear in all the other pages that fall within the broader nav category.
The code I need to embed looks like this:
<iframe width="100%" height="800px" src="https://google.com" frameborder="0" scrolling="yes"></iframe>
you can use html as it is on php page.
point 2: you want to show iframe on specific page only...
e.g. on page xyz.php
<?php
$basename = basename($_SERVER['PHP_SELF']); /* Returns The Current PHP File Name */
if ($basename == 'xyz.php'){ ?>
<iframe width="100%" height="800px" src="https://google.com" frameborder="0" scrolling="yes"></iframe>
<?php } ?>

Create an Image Trackback for an outside web publisher to link to my site

We're trying to create a trackback system where an outside web publisher can put some html on a page on their website that links back to a specific product page on our site. Let's call it a 'badge' for purposes of this question.
Once they've inserted the badge, we want to identify this, then grab the < h1 > and first < p > as a teaser to comprise a link from our site back to theirs and write all this stuff to our database. Then, our users can see the title and first bit of their page, then decide if they want to see more.
Here's what we've done (not much I'm afraid):
<a href="http://www.mysite.com/abc.html">
<img alt="abc" src="http://www.mysite.com/logo.gif" style="width:200px;height:100px" />
</a>
We're planning to build an admin page to do the last part of grabbing the < h1> and < p> and posting it to the live database, etc. and we'll figure this out later.
However, the middle step (identifying that this piece of html has been used) we're at a loss.
Is this something we should be doing through a log file....I have no clue even how to begin thinking about it.
A little direction of where to begin working on this problem would be very helpful.
Thanks in advance!!
This is one approach.
You give them HTML which looks something like:
<a href="http://www.mysite.com/abc.html">
<img alt="abc" src="http://www.mysite.com/logo.php" style="width:200px;height:100px" />
</a>
Notice that says logo.php, not logo.gif.
logo.php will live on your server. Its purpose is twofold:
Gather information about the page holding the <img> tag
Load and output logo.gif so the users see the image as expected.
If you embed that html on a webpage somewhere, logo.php will have information about where the request for the image originated. Specifically, $_SERVER['HTTP_REFERER'] will give you the complete URL to the page where the img tag resides. It is then up to you to decide how to process and store that information.
I don't know exactly what you want to do, but a very simplified logo.php would look something like this:
<?php
$url = $_SERVER['HTTP_REFERER'];
// do something with $url...
// it will be something like "http://theirsite.com/wherever/they/pasted/the.html"
// now output the logo image...
header("Content-Type: image/gif");
echo file_get_contents("/path/to/logo.gif");
Keep in mind that every time anyone hits their page with the image tag, logo.php will be run. So don't accidentally create 10000 links back to their site on your site :)

Display cross domain page inside div, iframe, frame with original height?

I have created a page in which I am showing A websites Page (situated some where on web );
I used iframe but puzzled with the height issues I solved width issues for 950px only with css3 but my need is full height as target website but that is not working with cross domain pages (I've done with same domain successfully).
Now I want to do it either with PHP using get_file_content() or some other putting it into div , iframe or in frames whatever works (and also pages must be accessible as it is from main sites)
The container will change its content with hyper link click.
Please help me to resolve the issues.
I've tried many more methods including jquery, js, php, css and blah blah blah with no success.
before commenting or answering please visit THIS LINK
I need some thing like this
Please check this and alter here
To See My page Click here
Note:
I have no access of target site so I can't put attributes on target
page and get back to iframe page.
I have 100+ pages to show so no
specific method can be used i need any generalized technology.
One more thing i don't want scrolling in my page.
Efforts done :
Ajax/Jquery
PHP Resize
In the "iframe'd" html, have:
<body onload="parent.resize_iframe(document.body.scrollHeight)">
and in the page that iframes:
<script type="text/javascript">
function resize_iframe(new_height) {
document.getElementById('iframed').style.height = parseInt(new_height, 10) + 60 + 'px';
}
</script>
I used 60px to fix potential padding etc.
Note that they have to be under the same domain for this to work, otherwise you might have to run:
<script type="text/javascript">
document.domain = "domain.com";
</script>
On either or both. This is required so that the browser may interact between them.
Do something like this:
<frameset rows="*">
<frame frameborder=0 src="http://www.discountautoparts.com/" scrolling="auto" noresize>
</frameset>
If you do that it should look like this picture

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.

Drupal 6: different slideshows for every page, easy in-node editing for end user

new to Drupal 6. I see a lot of slideshow modules out there, but it seems like most of them require quite a lot of configuration, and would be cumbersome for the user to change later. Some of my pages have sliders, and others have single images in the same spot. I don't want to have a separate node for each slider. The client can't handle that. I would like to have the images uploaded via the attachment section in the page itself, and fields for the image title and alt text. Then I would want to take that and display the image along with the title and alt text as a slideshow, with buttons to switch to previous and next. Is it possible to do this?
The jquery slideshow module almost does what you want, but it doesn't have the next/previous buttons.
I'd recommend just finding a javascript slideshow product that you want to use, and then manually integrate it into a node template.
Recently, I integrated jqFancyTransitions into a Drupal 6 project. The content type contains a image field, set to allow multiple values.
I installed the library in my theme, then, in the content type specific node template, I added this:
mycontenttype-node.tpl
<script src="/sites/all/themes/mytheme/jqFancyTransitions.1.8.min.js" type="text/javascript"></script>
<div id='ft'>
<?php foreach ($node->field_my_photo_field as $image): ?>
<img src="/sites/default/files/imagecache/my_photo_imagecache_preset/<?php print base_path() . str_replace(' ', '%20', $image['filepath']); ?>" alt="" />
<?php endforeach; ?>
</div>
<script>
$('#ft').jqFancyTransitions({ width: 350, height: 300, navigation: true, effect: 'wave' });
</script>
Note, I'm using an imagecache preset to crop & scale the images to 350x300, and I had to str_preplace spaces because jqfancytransitions didn't like them. That's only because it was an easier solution than either requiring users not to use spaces or modifying their file names.

Categories