I have a page that pulls up information based on an ID from the url using php get. It does this in an iframe. So there is an iframe on the main page that shows all the content, if a user wants a link, they click a link to a page, which is targeted to that iframe. So if a user wants to see an individual post, the iframe is directed to a page that pulls the id from the link.
href="location.php/?id=2" target="mainframe"
My question is, I want someone to be able to click a link to my website from somewhere else, and be able to see just that post, I want to do this without having to create another page, so if there is a way to make a http://www link navigate to my page, and then tell the iframe what to do, that would be awesome. Thanks!
put this at the bottom of your page before the </body>
<script>
document.getElementById('frame_name_goes_here').src = "http://linktoyourpost.html";
</script>
Used php to decide if the Id was present in the url, if it is, direct to the specified id, otherwise, the iframe source is the default page.
Related
i have added like button on my website but i want to check on page load that whether logged in customer already liked my fb page or not?
or is there any way to get element of like button iframe.
Yes there is, go to your page and find share/embedded link of your page. Fb will generate a link that you can paste on your website or blog. It will show direct like button and link to your page in a 300 by 300 sized box.
I am making a website for a client of mine, and it is quite complicated. It consists of a sidescrolling parallax style story and the pages are filled with a lightbox system. So when you click a link it wont go to another page but opens it in the lightbox.
Here comes the problem:
It works when you go to www.foo.com. But I want when you go to www.foo.com/subpage, it redirects to the homepage and opens the selected subpage in the lightbox. I have the code to open the lightbox from a variable. But I dont know how to fetch the url you typed.
Try getting
$_SERVER['HTTP_REFERER']
via php.
should be the URL you came from.
I am trying to use Iframes and or PHP to hide a link that is dynamically created. The link is being created in php. But when I try to access that link from within an iframe it takes over the whole page. The site loads, but the idea is that if it was in an iframe the url could be hidden and the user could click multiple items with out having to enter all their form data in every time.
I've tried using the link as a header and using php commands like:
$remote = fopen( $URL, "r");fpassthru($remote);
where $URL was my link.
a sample of the link is:
http://fb-zc-0.cafe.zynga.com/current/iframe//mfs_sent.php?ids=2&tab_clicked=All&request_id=236973056431070&gid=3014&today=1&time=3&ref=gift_today&cafe_token=OAlF7gSlMbQxAtBhvnprTzNhIww8H7Aq2z9i3KJwGWmJzUQfxZ8b9/kFWMVqN62JUihQA06VtuuoKoxmosK6JIPKWTMl0oQecLb+0e0HSAk3S32f5BCI7xhYB9SflOnN&from_page=SUNRISE_BREAKFAST_1&kingdom=quest&phylum=baklava&uid=342&sendkey=8e4aa1a75594c47cc61aee301efff90e$$ccF(NUP,67jiH3QM7!nspE0W8d8KprzD5,Za77bp34G*S_ST)*ilx)F7Y)acC4xj971Kkswxx2OM3eij3z1h0M3eij3z1h0&mode=quest_asking&quest_key=SUNRISE_BREAKFAST_1&mfs_time=3&snood=1&ajax=true&limiter_channel=rsvp&limiter_type=build_a_carnival3+5
Any help would be appreciated.
If you have links outside of this iFrame and want them to load into that iFrame on the same page, you'll have to give it a name, then target the named iFrame within your link's href.
<iframe src="http://google.com" name="myframe" hieght="100" width="100"></iframe>
<br/>
Test.
However, if you're loading a page into your iFrame that's loading links with target="blank", then those will go to a new window; unless you don't have access to those pages, you won't be able to change the links (short of writing JS to dive into your iFrame, etc).
What I currently have:
index.php: Mainpage, showing topbar, navigation & placeholder for content
navigation: uses javascript to load a php-file into the content-section from index.php if a link in the navigation is clicked; important: NO refresh of index.php
Is working fine right now. Also the url in the address bar is not being changed right now when clicking a link.
What should be added:
If a link in the navigation is clicked, javascript should still load a php-file but also should change the url in the address bar without refreshing the side.
Example:
url: "www.example.com
In navigation link "work" is clicked.
work.php is loaded into the content-section of index.php
url now: "www.example.com/work
Additionally if the user types www.example.com/work in the address bar index.php should load work.php without a link being clicked.
A good example to understand my issue with the url in the address bar is facebook. Hope I could clarify my problem so somebody is able to help me ;-)
You can only change the hashtag of a URL without refreshing the page (making another request).
So when a navigation link is clicked you could change "www.example.com" to "www.example.com/#work" but you can't change it to "www.example.com/work" without reloading the page.
A hashtag can get set with javascript using window.location.hash
window.location.hash = "work";
If you are looking to avoid hashtags, you can use the HTML5 history API. This allows you to have the / in your pages using the history.pushState() and history.replaceState() method.
There is also this plugin that you may find useful.
I have a page with an iFrame in it. I want to be able to send links to people, that will open a page within that iFrame on my page.
The main (parent) page is called results.html
The iFrame has the id "searchresults"
The page that I wan people to be able to open within that iFrame is results.php, but it would have a number of parameters in it (for example results.php?id=5)
How would I construct the link to send to people?
For example, would it be /results.html?target="searchresults";?results.php?id=5
I simply can't work it out!
What stops you from simply loading the iFrame and the main frame with the same GET parameters?
Or the place where you add iFrame, simply add the GET parameters of the main page also to the iFrame and then check for their presence in the iFrame code?
For example, I have a page:
index.php
In this page I have an iFrame with an URL:
<iframe src="search.php"></iframe>
If I make a search, then the main page would change:
index.php?search=test
Now when I am generating the iFrame URL, I check if that GET parameter exists, if it exists then I append it to iFrame URL:
<iframe src="search.php?search=test"></iframe>