Keep url after redirect with wordpress - php

I'm trying to redirect to a url from another url I mean, I have an url http://www.domainA/Auth/Login and I want to redirect to http://www.domainB/Auth/Login but Keeping on browser http://www.domainA/Auth/Login . I'm working with WordPress and I get the first step with a plugin but I don't get the second step about keeping the old url. How can I do that?.
Thanks for your support

You can not redirect URL without changing adress bar.
You can iframe DomainB in domainA. With this approach you can get what you want.
Sample code of http://www.domainA/Auth/Login/index.html :
<iframe src="http://www.domainB/Auth/Login" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
Your browser doesn't support iframes
</iframe>

Related

How to disable text selection in embeded pdf in html page?

I'm developing an e-library website and I want to display book content (saved in pdf format). The problem is the user that open embeded pdf still able to copy the content by highlight the text. Where do I need to set the code?
I already put style="width:100%; height:100%; user-select: none; -webkit-user-select: none;"
this is my current code
<iframe src="http://localhost/ci_crud/upload/product/Proposal_Thesis.pdf#toolbar=0&navpanes=0&scrollbar=0" title="PDF in an i-Frame" frameborder="0" scrolling="auto" style="width:100%; height:100%; user-select: none; -webkit-user-select: none;"></iframe>

Click-Event on iframe without javascript

I need a iframe with link attached to that iframe. I have a iframe with src containing image file and id containing the url where i should be navigated. I should not use javascript or any php coding for link creation. when i paste that iframe in any page, its should be a clickable iframe.
adding tag doesn work in some browsers like chrome and firefox.
Eg:
<iframe src="imagepath" scrolling = "no" width="728" height="90" id = "redirect url"></iframe>
With the following HTML and CSS you get an iframe with a link overlay. You have to specify the redirect url in the a tag. If you you really have to specify it in the id of the iframe, you definitely need JavaScript.
Here's a demo how it looks like (only tested in Chrome): http://jsfiddle.net/2kA3J/
CSS:
#container {
position:relative;
width:400px;
height:400px;
}
#container a {
position:absolute;
width:100%;
height:100%;
}
#container iframe {
width:100%;
height:100%;
}
HTML:
<div id="container">
<iframe src="imagepath" scrolling="no" ></iframe>
</div>

The word-wrap property does not seem to work in CSS

I have designed an html iframe where I want to use the word-wrap property, i.e., it should break long words onto the next line. But what happens instead is that for long words, it adds a horizontal scroll-bar rather than breaking the word onto the next line.
I tried hiding the scroll bar by using "overflow:hidden" property , but nothing happens.
I could use some help here.
Here's the html code for iframe:
<div id="main_frame" >
<iframe id="main_frame" src="homedept.php" name="iframe_a"></iframe>
</div>
The CSS is:
div#main_frame
{
float: left;
margin-top:198px;
margin-left:5px;
float:left;
position:relative;
width:100%;
height:900px;
z-index: 0;
word-wrap:break-word;
}
iframe#main_frame
{
float:left;
margin-left: 30px;
margin-right: 300px;
float:left;
border:none;
word-wrap:break-word;
width: 78%;
height:70%;
z-index: 1;
}
Thanks for the reply #tyriar, I have set the word-wrap property to the original page now. Still nothing happens.
<div id="display_posts">
<?php //php echoes some text here ?>
</div>
The CSS code is:
#display_posts
{
word-wrap:break-word;
}
You defined same ID 2 times , but ID must be unique , you can not declare it twice.
So use class instead of using ID
Also iframe call other page and you defined word-wrap in original page so its not apply.
Try
word-break:break-word
or
word-break:break-all
And try using class instead of ID because ID should be unique.
You can't apply word-wrap to an iframe, it's a completely separate page and styles from your original page won't apply. You would need to change the styles on the page where the iframe points.
Also id attributes must be unique, you have set id="main_frame" on both an iframe and a div.
Update
If word-wrap:break-all is on the iframe then maybe the width of the page is introducing the scroll bar. Make sure that your elements scale down correctly with the page. If you load up the page in your iframe in your browser you should be able to reduce the window size without a horizontal scroll bar appearing. If one does then it's an issue with the minimum width of that page.

Facebook Send Button - How to pass generated PHP variable in url

I am currently coding a website where lines of information are drawn from a database and displayed using PHP coding (about 20 pieces of info per page). I have included the javascript SDK for facebook after the head and generated the div tag for the send button for each piece of information. My intention is to have a user click the send-button for a specific line of information and transmit the url for only that info - not the main page.
Using php coding I have changed the data-href URL in the fb-send div to represent the referenced information and pass the php variable through the URL. While the URL tests correctly it is not being represented when the send button is clicked (it only references the main page).
Is it possible to pass PHP variables through the URL of the send button?
If so, how can I do this?
If not, what are other options to achieve my desired outcome?
Please let me know if my problem is unclear! Thank you very much for the help!
Try with this
$url_view = "http://".$_SERVER['HTTP_HOST'] . getenv('REQUEST_URI');
$facebook =
"<div class='socialshare_fb'>
<iframe scrolling='no' style='border-width: initial; border-color: initial; overflow-x: hidden; overflow-y: hidden; height: 20px; width: 90px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial;' title='Share on Facebook.' src='http://www.facebook.com/plugins/like.php?href=".$url_view."&action=like&layout=button_count&locale=pt_PT &node_type=link&show_faces=false&width=90'>
</iframe>
</div>";
echo $facebook;

facebook like button not working correctly

I have a problem with my facebook like button. Basically I have an ajax gallery on my page and so when the image changes I change my facebook button so that the button represents the url to the new image. But when I click share it just shares the original url even though it has changed. Here is an example:
When page loads the code for the facebook button is:
<iframe scrolling="no" frameborder="0" style="border: medium none; overflow: hidden; width: 80px; height: 21px;" allowtransparency="true" src="http://www.facebook.com/plugins/like.php?href=http://go-style.co.uk/test-gallery/&layout=button_count&show_faces=false&width=80&action=like&font=lucida+grande&colorscheme=light"></iframe>
I then use jQuery to change the code to this:
<iframe scrolling="no" frameborder="0" style="border: medium none; overflow: hidden; width: 80px; height: 21px;" allowtransparency="true" src="http://www.facebook.com/plugins/like.php?href=http%3A//go-style.co.uk/nggallery/page-7029/image/30&layout=button_count&show_faces=false&width=80&action=like&font=lucida+grande&colorscheme=light"></iframe>
Yet clicking on the new button likes the original url
Anyone know why this is happening?
Have you tried refreshing the iframe after changing it SRC?
$('#youriframe').attr("src", $('#youriframe').attr("src"));
It was a caching issue with facebook in the end!

Categories