php Detect if html5 play button pressed - php

In PHP can I detect if the play button is pressed when the html5 audio player opens from a hyperlink
$line = "<font color='blue'>$name</font>";
echo $line;

PHP is a server-side language that does not have access to client-side events such as clicking on an HTML5 play button.

Related

How to Hide Zoom links in Address bar of any Browser

I have a project were client wants to hide Shared link to their student because client thinking that student sharing their links of zoom meeting with another students of another organization.(so the client doesn't wants to share links due to client is teaching a Paid Course).
So I'm Thinking that what if we open link window as popup window.
but the problem is target=_blank and opening new window not popup windows.
how to solve this thing?
I'm using following code of php
echo "<td><a href=" . $row['r_link'] ." target=_blank>". $row['r_topic'] ."</td>";
I had Solved this Problem using iframe. iframe hides the address from the normal user (not saying from a hacker).
I added all link details in html form with input type "hidden" and posted/set target on the next page. Where php fetches parameters of link and put in iframe src tag. Code as Fallows.
in HTML
<input type=hidden name=r_id value=$id>
in next page PHP and HTML
$r_link = mysqli_real_escape_string($con,$_POST['r_id']);
<iframe src="<?php echo $r_link ?>"></iframe>
Thank You,
in this way I have solved my issue of hiding the meeting link.

open dompdf in new tab taken data from given page

I know that there are at least two other similar questions, but they do not help me.
I have textarea with tinymce where user writes his text. Then there is a button "PDF" that should create pdf and open it in new tab. The content of pdf is the content in tinymce.
When user click on button, the form is submitted to index.php action. Then index.php gathers information from $_POST variable and creates pdf.
I cannot get it to open in new tab as a normal link.
I tried it in different ways.
1) I can open PDF in the same tab, but this is not what I need. This line opens my pdf on the same tab:
$dompdf->stream('document.pdf',array('Attachment'=>0));
2) I can open it in new window, but then browser warns that this is pop-up. Client doesn't want it. Also another problem with this is that pdf is stored on server. I do not want it (pop-up warning is more important). Here is my code:
$output = $dompdf->output();
file_put_contents('document.pdf', $output); //save pdf on server
//opens generated pdf in new window, but this creates warning for popup
echo '<script type="text/javascript" language="javascript">
window.open("http://modeles-de-lettres.org/test/saved_pdf.pdf", "_blank");
</script>';
I have read those:
1) Open PDF in a new tab using dompdf
This suggests: "As far as opening in a new tab. That depends on how you are generating the PDF. But the simplest way it to provide a link with a target attribute." I think this means that I have
<a href="my.pdf" target="blank"
or
<a href="my.php" target="blank"
But this does not work for me, because I should POST my form to get data from pdf.
2) generate the pdf on newtab in dompdf
This is something that I have implemented before (I did it without sessions), but it creats warning about popups.
You can simply do the following:
<button type="submit" formtarget="_blank">Submit to a new window</button>
formtarget="_blank" attribute will open new tab.
Hope it will help you!
The problem is the order in which you're doing things. You should be opening the new window from a user event, like clicking a button. If a script on a page load event tries to open a window, the browser will presume it's an unwanted popup, since the user hasn't done anything besides navigating to the page.
What could work for you, is adding a target="somewhere_new" attribute to your form tag. This way, the browser would open a new tab since there's no frame/iframe with a name="somewhere_new" attribute, and you wouldn't have to do anything special in the server side, just process the data as you did before using $dompdf->stream('document.pdf',array('Attachment'=>0)); at the end

How can I include this in a Jquery lightbox or dialog box?

Is this technically possible in Jquery .. Basically I'd like to call a php page inside or a lightbox or a Jquery Dialog pop up when a user clicks on an image hyperlink or a link
For example , I have this this line of code .. Once a user clicks on this image link , a dialog or light box should appear with the content of the profiles.php page .. How can I implement this in Jquery .. I'm too new to Jquery .. but how would I go about doing this ? I'd really appreciate it .. I need guidance on how to make the profiles.php info load into a dialog or lightbox .. whichever of the two options is appropriate for it.
echo "<a href='profiles.php'><img src='boy.jpg'width='100' height='100' class='image' /></a>";
Try Fancybox ! Its a jquery plugin!
For usage instructions visit : http://fancybox.net/howto
You could use jQuery.load(url) method read more: http://api.jquery.com/load/
jQuery('a.linkclass').click(function(event){
event.preventDefault();// prevent link default action
jQuery('selection of where you need to load content').load('profiles.php');
});
Not sure if it works 100% haven't tested it
Load Colorbox on your page
add class colorbox-html to the hyperlink
add <script>$('a.colorbox-html').colorbox();</script> to the bottom of your page
Click the link
Disclaimer: This hasn't been tested

Open Video Pop up on the same WebPage when the user clicks on play

<div class="player"><iframe src="http://player.vimeo.com/video/<?= $vimeo;?>?title=0&byline=0&portrait=0&color=abcc16&autoplay=0" width="150" height="150" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe></div>
How do i open a popup window on the same page with the cross(x) on top when i click on play button for the video displayed on the html page? And it has to display Watch Video on the video Window before the user clicks on it. I am currently using the above code in php to display the frame window in the browser.
jquery + colorbox plugin http://www.jacklmoore.com/colorbox
Open a colorbox popup with the "watch video" message in it. Add click handler that replaces the message with the video iframe.

How to open multiple browser windows on request? (PHP)

So I have a form on PHP/HTML page. User submitss it to that same PHP/HTML page. So now PHP page I will have $_POST data. I want to when page is refreshed opnt some popUp browser windows which url's will be relative to users POST request. like www.example.com/bal-bla-bla.php? id=$_POST['StreamId']
Include some <script> elements with window.open calls in them in the response … then watch as every popup blocker in the world blocks them.
if ( isset($_POST['submit']) ) {
echo '<script>window.open ("'.$_SERVER['PHP_SELF'].'myplayer.php?stream_id='.$_POST['StreamId'].'","myplayer");</script>';
}
edited:
you can always display a message before open the window that advice the user to accept this new window!
var flag = confirm(" This window is not an ADV! ;-) ");
if (flag)
window.open("'.$_SERVER['PHP_SELF'].'","myplayer");
You would need to do this client side in javascript.
You could use window.open() in a document.onload event handler.
However, chances are if the user has a pop-up blocker this will be blocked.

Categories