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=" />';
Related
I've got some php code that is calling in a website link from my database. The result is the full website link 'www.store.com', but what I'd prefer is to just have some linked text e.g., 'read more' so that the actual web address is not visible. The portion of the code that is specific to the website call is as follows:
<?php $v['website'] = str_replace('&','&', $v['website']); ?>
<website><?php echo $v['website']; ?></website>
In the case $['website'] contains the web address...
Then you are looking for soemthing like this
<a href="<?php echo $['website']; ?>" >Read more </a>
I would also recommend add target="_blank" to the <a> tag, so the user wont leave your website and the link will open in a new tab.
I don't know what the <website> tag is. But for the anchor tag this,
Read More
will work.
Also see,
Adding php code to html anchor tag
<?php $v['website'] = str_replace('&','&', $v['website']); ?>
<website><?php echo 'Read More'; ?></website>
I am working on a php youtube clone script, similar to playit.pk
If you have experience with such a script then you could probably help me.
On th page watch.php where an iframe is used to view youtube video in the iframe the php source code is:
src="//www.v.ytapi.com/embed/<?php echo $yt->id ?>
but I want to replace it with
src="//www.myDomainName.com/embed/<?php echo $yt->id ?>
How can I achieve that or else Instead of iframe how can I get src like this
http://r5---sn-vgqs7n7y.c.docs.google.com/videoplayback
and directly use it in a video tag.
This is kind of stupid question but is there any way to play videos just by using two pages, I mean like instead of creating an html page for every video I upload to my website, can I have only two php pages and then pass the video from the first page and play on the second one?
I know about passing variables in url but I am kinda confused on how to do this.
I actually embedded my videos from google drive and have a format like
<iframe src="https://docs.google.com/file/d/0B5ZMsnZoUVNSWHhxeGc/preview" width="640" height="385"></iframe>
would it be possible to do like
<a href="play.php?video='test.mp4'>Click to play</a>
or like
$video= 'test.mp4';
<a href="play.php?vid='$video'>Click to play</a>
play.php
$video = $_GET['vid']
if(!empty(($video)){
//then play the video here.
}
I'm expecting you're usnig HTML5.
Let's say there's a list of videos on the first page, and you click on a name of video and it redirects you to second page. Pass the video url (or any identifier for server to know which video) in the link. You can do it like
Cats!!
This will send vid_url as a GET variable on second page. page2.php is, as you can imagine, very simple
<?php
$vid = $_GET['vid'];
//echo $vid;
echo "<video width='320' height='240' controls>
<source src=".$vid." type='video/mp4'>
Your browser does not support the video tag.
</video>"
?>
Of course, you'll do something more elaborate than simply using "echo" for formatted HTML output.
Yes. Instead of empty use isset:
if (isset($_GET["vid"])){
$video = $_GET['vid'];
//play video
}
Play This Video
And On Play.php page add this code
if(isset($_GET['video'])&&!empty($_GET['video']))
{
$Video = $_GET['video'];
// Use the Source of your video anyway you like to play the video
}else
{
echo 'No video selected to play';
}
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";
hi i have a link that shows a google map and echoe's the users location on the map, at the moment this works by the user clicking the link and the map opening in a new window.
what i want to try and do though is make this into an iframe, so there is no need to click a hyperlink, and instead the map and the users location is being echoed in the iframe. is this possible?
here's my link:
click
what i have tried:
<iframe src="http://maps.googleapis.com/maps/api/staticmap?size=500x500&maptype=roadmap\&markers=||<?php echo $location['user_location'] ?>,UK&sensor=false&zoom=8"></iframe>
any reason why im just seeing a blank iframe? thanks
Why you use iframe ? use img
<img src="http://maps.googleapis.com/maps/api/staticmap?size=500x500&maptype=roadmap\&markers=||<?php echo $location['user_location'] ?>,UK&sensor=false&zoom=8">