I hope this isn't posted anywhere because it's too obvious.
On my website (Robo Co.) I use two iframe elements with the names iframe_r and iframe_l.
I would like to know how to create permalinks to open pages in those iframes that are not included in the src=() element.
What I would imagine the link would be something close to: roboserver.zapto.org/main.php&iframe_r="page_to_load"&iframe_l="page_to_load"
The URL would then forward the values iframe_r="page1" and iframe_l="page2" into the imbedded php which would then load page1 into iframe_r and page2 into iframe_l.
Using the url scheme you used in the page
roboserver.zapto.org/main.php&iframe_r=/left/page.php&iframe_l=/right/page.php
you would author your iframes like so
<iframe id="frameLeft" src="<?= $_GET["iframe_l"] ?>"/>
<iframe id="frameRight" src="<?= $_GET["iframe_r"] ?>"/>
with javascript you could just
document.getElementById("frameLeft").src = "new url";
document.getElementById("frameRight").src = "new url";
Related
I'm trying to open the user_url within an iframe on a private user page in Wordpress.
I put the following code into a snippet:
<?php echo get_the_author_meta('user_url',$userID); ?>
When I use the short code on the user page it does display the user URL, I can also use it in an hyperlink like this:
link text
But when I put the short code into an Iframe the short code does not change into the URL anymore.
<iframe src="[cmruncode name='dash']" height="300" width="300" title="Iframe"></iframe>
Does anyone knows why this is not working and know a solution?
Thanks Peter
If you are using WordPress shortcode then you have to call shotcode using function do_shortcode.
You can try this one
<iframe src="<?php echo do_shortcode( '[cmruncode name="dash"]' ); ?>" height="300" width="300" title="Iframe"></iframe>
And I'm not sure why anchort text display right output. That's weird.
Anyway if you used do_shortcode to output your shortcode then it will work every place.
This only works when I put it directly into the template, in that case no snippet-shortcode is needed at all. But the content needs to be hidden when the user is logged-out.
Normally the plugin "client portal" that I use should take care of this
but it has a content block that does not support PHP and also does not render the php snippet that I made.
Any suggestions?
The solution was to put the iframe code completely into a snippet.
Like this:
<iframe src="<?php echo the_author_meta('user_url',$userID); ?>" height="2400" width="100%" title="Iframe"></iframe>
My WordPress WebSite Posts has different type of iframe tags:
eg:
<iframe src="http://examplesite1.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite2.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite3.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite4.tld/somepageordirectory"></iframe>
I Need WordPress Function for get and replace iframe src for specified (eg: examplesite3.tld) domain eg:
<iframe src="http://examplesite1.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite2.tld/somepageordirectory"></iframe>
<iframe src="/embed.php?ref=http://examplesite3.tld/somepageordirectory"></iframe>
<iframe src="http://examplesite4.tld/somepageordirectory"></iframe>
I'm new in WordPress.
Any Help is Highly appreciated and a lot of sorry about my english.
We need the surrounding code to understand how the page is built, not the displayed code.
To do what you're talking about you would use the surrounding html tags and echo the wordpress variable within it, eg:
<iframe src="<?php echo wp_function( 'variable' );?>"></iframe>
I have a PHP script that generates dynamic images using GD. The image may be accessed remotely via, for example, http://mysite.com/scripts/phpimages.php
Any remote website such as example.com could able to render this image in its client side HTML img tag. For example:
<!-- http://example.com/about.html -->
<img src="http://mysite.com/scripts/phpimages.php" />
What I need that my script able to know the URL of the image requested page i.e http://example.com/about.html
Use this
echo $_SERVER['HTTP_REFERER'];
To prevent errors,
if(isset($_SERVER['HTTP_REFERER'])) {
echo $_SERVER['HTTP_REFERER'];
}
I have a link that recieves a dyanamic image via php, and when you click it, it opens the image in a new window. It looks like this:
Click Here
I want to open the image on a page called red.php, and inside a div with the id=green.
From the sending page I'm thinking of something like this:
Click Here
On red.php the code would possibly be something like this:
<?php
$picture = $_GET['IMAGE_FULL_URL'];
echo ".$picture"
?>
I'm sure I have something wrong above, and I don't know where to begin to add the div id to the url, or if I can simply place the php code inside the div. Can someone please show me the code so this will work? Thanks.
here is an example:
your initial HTML:
Click Here
your Red.php:
<div id="green">
<img src="<?php echo urldecode($_GET['pic']); ?>" alt="" />
</div>
I have the following code presently:
if(isset($_POST['Movie']))
{
$check = $_POST['Movie'];
echo "(left angle bracket)a target='imdb' href='http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq='>IMDB PREVIEW";
}
This gives me a link to click which when I do click opens in an iframe called imdb.
How do I cut out the middle man (having to click the link) and just have this link open directly in the iframe.
I already have an iframe named imdb and I want to display the link in there.
**What I ended up doing was just to echo a new iframe with the same class as the other iframe so that the end user will not know that they are different iframes.
You did not include the source for the iframe itself, but basically, all you have to do is echo the URL into the iframe's src attribute:
echo '<iframe id="imdb" src="'.'http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq="></iframe>';
I don't know if I understood your question, but maybe you want to do this:
echo '<iframe src="http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq=" />';