Tag Archives: EasyPHP

Karaoke via YouTube API in Iframe Email Tutorial

It’s good with a web application like our “Karaoke via YouTube API” one to have a means by which you share what you are doing, and because we have based it on GET parameters, then an email link is a Share idea that should work well. What is a bit harder to share are the bits that you saved a microphone “taping” session to an audio file we talked about, first, at Karaoke via YouTube API in Iframe Microphone Tutorial as shown way below. Since then, we talked about emojis with Karaoke via YouTube API in Iframe Emoji Tutorial as shown below. With the user audio files we can do one of two things … ask the user to attach the audio files themselves using an email client program … or … if we know the email address ahead of time we can use PHP mail function to send emails with audio file data attachments So, today, most of the changed code is PHP code a lot like the code we went over when we presented the thread of blog postings starting with Canvas Image Email Attachment Primer Tutorial. And this confirms yet again, for me, the usefulness of email, and sharing. The other code thing to consider regarding email attachments, if you own a web server, is that the large amounts of data are there in the ether (on mail servers … thanks … that’s ether, isn’t it?) and at the destination, rather than on your (web) server … we say with a smile on our face. We hope it is helping you out or giving you ideas to try yourself, with … The parent HTML and Javascript and CSS karaoke_youtube_api.htm changed in this way The child HTML and Javascript and CSS stop_start_youtube.html is unchanged The child PHP legend_via_map.php changed in this way for email functionality … to arrive at this generic live run, that we hope you try, and share emails with friends. Did you know? Karaoke is big out there! Take a look at 18 Best Karaoke Songs of All Time for some inspiration in this line of thinking. Beats “Macarthur Park” in the shower, any day?! Previous relevant Karaoke via YouTube API in Iframe Emoji Tutorial is shown below. For a long time we resisted the use of emoji, thinking that their use was a bit lame, but more and more, as times goes on, we

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

Karaoke via YouTube API in Iframe Emoji Tutorial

For a long time we resisted the use of emoji, thinking that their use was a bit lame, but more and more, as times goes on, we find good use for them. It is kind of predictable though for quite a few reasons … they are compact, and in a world going down the mobile device “way”, that is a huge advantage they can help with Internationalization of your web applications they can become action items, as would a button, about which, at this blog, you might want to read HTML and CSS More Button Ideas Tutorial new ones are constantly being designed … in addition to the reason that turned me off them, in my isolated thinking, for so long … they can cheer up a website … but am not ready to say they are self-explanatory enough to dive on in there without some English wording around, at least with today’s work, and overcoming this phobia will be the last stage of acceptance. Mind you, perhaps caution should be part of the equation for “mission critical” action items, though emojis can also be decorative, and you can see that use of them a lot around this blog as decoration for HTML “unordered list” ul elements. With today’s changes we use emojis for action items for the continuation of our “Karaoke via YouTube API” web application project (that we left off with Karaoke via YouTube API in Iframe Microphone Tutorial as shown below yesterday), and in so doing, make more “height” room by doing away with the band of buttons under the YouTube video player, and with the smaller amounts of “button” emoji space now, place this, now, to the right of the YouTube player instead. How do we find the emojis we want? Well, at the entry level and exit level we have, respectively … searches for relevant words in Google search engine … eg. “video game emoji” Google search as per this link and hope to arrive at the http://www.fileformat.info website for the technical details necessary … eg. Unicode Character ‘VIDEO GAME’ (U+1F3AE) HTML Entity (decimal) 🎮 is what is useful to us, in HTML coding as a value= value for HTML input elements or innerHTML property of HTML a elements, for instance The steps in between the two above tends to be a bit variable. For the example above, we ended up at Google’s first suggestion,

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Karaoke via YouTube API in Iframe Microphone Tutorial

It was always a plan with the “Karaoke via YouTube API” that we would try to “splice” in user contributions for a more real “Karaoke” experience. I’ve done work on this before, and it takes a lot of web server diskspace to be the one storing such audio files, and know why Snapchat has the length (of media) limitation. There was discussion in HTML5 about standards as you can read here and the discussion in Capturing Audio & Video in HTML5 sums it up really well as far as web applications go … you need to be able to execute, successfully, the Javascript function … navigator.getUserMedia() … to get anywhere that way. Now we don’t expect many users to have this accessible yet, but we do not restrict methodologies to use here, and we could be getting the user to use another desktop microphone recording app perhaps, just to arrive at, in order of preference … a public URL with http: or https: transfer protocol of an audio file you’ve created … or … a local web server, such as Mac OS X MAMP‘s http://localhost:8888/ ones or Windows EasyPHP‘s http://localhost:8887/ ones, URL with http: transfer protocol of an audio file you’ve created … or … any other http: or https: URL to slot in between YouTube slots a file: local audio file, perhaps saved using the great navigator.getUserMedia() webpage here Today’s task is to set up a system to slot these microphone audio files into the functionality. We’ve decided to add it as a suffix possibility to the “Start in seconds” field, as much as anything, because the “;” delimitation we use means that to get back the original you just add the bold (Javascript split function) coding bit as exemplified by … thisd = eval(eval(document.getElementById(‘j’ + i).value) – eval(document.getElementById(‘i’ + i).value.split(‘;’)[0])); … as shown by the URL we used to create today’s tutorial picture, with bold bits of user audio relevance … http://www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=CPMpeNDIGdk&recown=on&youtube_duration=449.0&c0=on&i0=0&j0=60&c1=on&i1=80%3Bhttp%3A%2F%2Flocalhost%3A8888%2FmyRecording00.wav&j1=124&c2=on&i2=144&j2=396&c3=on&i3=416&j3=449&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9= … and so this is an easy approach to the slotting in of new ideas, but keep the same basic structure of data design otherwise … we do like to keep things that work as much as possible … doh! There’s more to do, but we have the framework here to move forwards, and hope it is helping you out or giving you ideas to try yourself, or … The parent HTML and Javascript and CSS

Posted in Ajax, eLearning, Event-Driven Programming, Games, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment

PHP Port Process Primer Tutorial

When there is a concept that somehow links hardware to software things fall into place better for me, personally, with understanding. For me, this is because hardware is that interesting thing out there that is more unknown, and so much more mysterious, to me, than software. One conduit to the hardware world, for me, then, is the concept of a port, which is, to quote Wikipedia … In computer networking, a port is an endpoint of communication in an operating system. … linking the software, via networking principals, to hardware. So if there is a way to find an underlying operating system PID (process identifier) associated with a designated port (number), then my ears prick up. What initially puts you off such an endeavour is that there is no way the Windows command line would have the same command as the Linux or unix command line to do this? Is there? Well, actually, there almost is, with netstat -an but the lack of an “o” switch in Linux (or unix) is the reason this cannot be used … as “o” supplies a PID column to the result set. However Linux has alternatives with the lsof command, so the project will be undertaken by PHP using its ever useful exec method to … Linux (or unix) … lsof -i:[portNumber] Windows … netstat -ano | findstr “:[portNumber] PID” … and so, that brings us to the question of how the PHP tells what operating system underlies it. We make use of this link‘s great advice (to make use of the pre-defined constant PHP_OS) to come up with (where $gp contains port number of interest) the PHP code snippet … if (strtoupper(substr(PHP_OS, 0, 3)) === ‘WIN’) { // echo ‘This is a server using Windows!’; exec(‘netstat -ano | find “:’ . $gp . ‘ PID” > ppi.txt’); } else { // echo ‘This is a server not using Windows!’; exec(‘sh -c “lsof -i:’ . $gp . ‘” > ppi.txt’); } To look at the PHP source code, try this port_process_info.php or try a live run link. We worked with a Windows local Apache web server called EasyPHP ( for URL http://localhost:8887/port_process_info.php ) and a Mac OS X local Apache web server called MAMP ( for URL http://localhost:8888/port_process_info.php ) to test the PHP code today. Stop Press The last MAMP for Windows install we did, in 2021, ended up with HTTP://localhost/ being the resultant

Posted in eLearning, Hardware, Networking, Operating System, Software, Tutorials | Tagged , , , , , , , , , , , , , , , , | 14 Comments

PHP Desktop Command Line Follow Up Tutorial

Yesterday we started on some PHP desktop tutorials for a XML Chapter Changes via the Substitution of Strings desktop job when we presented PHP Desktop Command Line Primer Tutorial as shown below. Of the three web modes of use today’s improvement work is … web browsing (or “surfing the net”) … we add an HTML form as pictured … that one is relatively easy command line usage … we leave it as is, interactively asking the user for information … though you could approach this with a menu system perhaps curl on the command line … now this is more problematic because of the difficulty with interactive input and curl usage … so we … in the first instance expect the user to type “curl http://www.rjmprogramming.com.au/PHP/renumber_more.php” at the command line to start off the user sees on the command line the output of the underlying HTML as if web browsing, but it contains a more complex “curl http://www.rjmprogramming.com.au/PHP/renumber_more.php?curlget=%7Cfilespec%3DCOM_.IOVBK%2F%2A.xml%7Cynftt%3D%23%40%21%40%23%7Cprefix1%3Dolink%3E%7Cprefix2%3Dolink+targetptr%3D%22start%22%3E%7Cprefix3%3Dolink+targetptr%3D%22end%22%3E%7Cprefix4%3Dlabel%3D%22%5B%7Cprefix5%3Dlabel%3D%22%7Cprefix6%3DCOMM.IOVBK%7ECH.%7Clookup%3D%5B30.%2C%5B29.%7C%5B32.%2C%5B30.%7C%5B33.%2C%5B31.%7C%5B34.%2C%5B32.%7C%5B35.%2C%5B33.%7C%5B36.%2C%5B34.%7C%5B37.%2C%5B35.%7C%5B38.%2C%5B36.%7C%5B39.%2C%5B37.%7C%5B40.%2C%5B38.%7C%5B41.%2C%5B39.%7C%5B42.%2C%5B40.%7C%5B43.%2C%5B41.%7C%5B46.%2C%5B42.%7C%5B47.%2C%5B43.%7C%5B48.%2C%5B44.%7C%5B49.%2C%5B45.%7C%5B50.%2C%5B46.%7C%5B50A.%2C%5B47.%7C%5B52.%2C%5B48.%7C%5B53.%2C%5B49.%7C%5B54.%2C%5B50.%7C%5B55.%2C%5B51.%7C%5B56.%2C%5B52.%7C%5B59.%2C%5B53.%7C%5B60.%2C%5B54.%7C%5B61.%2C%5B55.” type of suggestion command line idea which the user can copy and adjust (in that encoded way, unfortunately, using vertical bar | as the major delimiter) into another copy buffer the user pastes that adjusted new complex curl command onto the command line, to complete the task All in all, we do not recommend curl usage, for this job! Here is that PHP code … renumber_more.php–GETME … for desktop prompted interactive use and/or curl and/or web application (with HTML form) usage, and so it is meaningful, now, to offer a live run link renumber_more.php-GETME … for desktop prompted interactive use and/or web application (defaults only) usage Changes here regarding this tutorial renumber_more.php_GETME … web application (defaults only, and “hardcoded”) usage Changes as for tutorial below Previous relevant PHP Desktop Command Line Primer Tutorial is shown below. Sometimes you have desktop program requirements involving files and the operating system. If the job is quite large you’d probably want to involve one of the well known IDEs like Xcode for Mac or Visual Studio for Windows or perhaps NetBeans or Code:Block and they could provide solutions in a whole gamut of compilable programming languages such as C++, C#, VB.Net, C or Java, just to name a few. To avoid some of this bother for smaller jobs we recommend, in Windows, Digital Mars C (or D), and we’ve talked about that here. Today we start on a short journey to show you that PHP at

Posted in eLearning, Operating System, Software, Tutorials | Tagged , , , , , , , , , , , , , , | 6 Comments

PHP Desktop Command Line Primer Tutorial

Sometimes you have desktop program requirements involving files and the operating system. If the job is quite large you’d probably want to involve one of the well known IDEs like Xcode for Mac or Visual Studio for Windows or perhaps NetBeans or Code:Block and they could provide solutions in a whole gamut of compilable programming languages such as C++, C#, VB.Net, C or Java, just to name a few. To avoid some of this bother for smaller jobs we recommend, in Windows, Digital Mars C (or D), and we’ve talked about that here. Today we start on a short journey to show you that PHP at the command line, with command line curl, or as a web application (especially with a local MAMP web server on Mac or EasyPHP web server on Windows) can be another option. Do you remember PHP Modes of Use File Traverse Tutorial? The job we show today is an XML Chapter Changes via the Substitution of Strings desktop job. In this job we have … a filespec, on the desktop (or USB) of input data files a mapping string file (or the data of) to map the chapter information, only, that is of interest … from that we start with a quick MAMP web application solution … we’ll show you here as renumber_more.php_GETME full of hardcodings and assumptions. We rid the code of many hardcodings to genericize it considerably, and we show you some of that journey via renumber_more.php-GETME where we introduced some PHP command line interactive usage where we got help from this link (thanks). This interactivity only happens in the PHP usage from the command line, and to test for that we … if (isset($argv[0])) { // PHP command line specific interactive input code below … // // PHP command line specific interactive input code // } // … end of PHP command line specific interactive input code Here is that PHP code … renumber_more.php-GETME … for desktop prompted interactive use and/or web application (defaults only) usage renumber_more.php_GETME … web application (defaults only, and “hardcoded”) usage Changes If this was interesting you may be interested in this too.

Posted in eLearning, Operating System, Software, Tutorials | Tagged , , , , , , , , , , , , , | Leave a comment

AutoHotKey Surfing PHP exec Tutorial

There’s another companion piece to our C “sorting” program tutorials finishing with C Sorting PHP exec Tutorial as of a couple of days ago. And it’s a pretty important chapter if you are interested in software integration, and “meeting points”. We talk about the “meeting point” of web and desktop applications through the use of mechanisms with the web application server language’s world … our web server language today is PHP and its exec method, but it could be ASP.Net and a new Process() scenario if that’s how you roll … but it has to be Windows web hosting … as we do with some local web serving utilizing the brilliant EasyPHP local web server … we can’t show you live on rjmprogramming.com.au domain because it is a Linux web server. The difference today is that instead of using some C code compiled using the Digital Mars C compiler, we dynamically create a Windows executable, on the fly, using the brilliant AutoHotKey (last talked about at this blog with AutoHotKey StayAwake Tutorial as shown below) and its *.ahk scripting language that can compile Windows executables for the Windows environment you find yourself in. The AutoHotKey script created on the fly has behind its logic the brilliance of the code suggested at this very useful link … so, thanks. What happens on EasyPHP local (WAMP) Apache/PHP/MySql web server, under Windows, is that … we have our idea.php (and you are welcome to make a better name) … in the Document Root of EasyPHP (in our case at c:\progra~1\EasyPHP-12.1\www\idea.php … or http://127.0.0.1:8887/idea.php) … and in the same place have … a subdirectory called AutoHotKey containing the AutoHotKey scripting software … so that on typing http://127.0.0.1:8887/idea.php into the Internet Explorer address bar … an HTML form asks about a good Tag to look for at the blog here and, optionally, within the blog posting titles that result, a search string to narrow down the scope … and then … we have the information for PHP to write out an AutoHotKey script for the purpose which PHP exec() arranges to dynamically create a Windows executable that … runs to open an Internet Explorer webpage for the Tag search and any accompanying offshoot webpages for matching title search blog postings of interest … cute, huh? “Who” (but they’re on “second”) says desktop work is irrelevant to web applications? After all, the server side languages interface

Posted in eLearning, Operating System, Tutorials | Tagged , , , , , , , , , , , , , | Leave a comment

C Sorting PHP exec Tutorial

There’s another chapter to our C “sorting” program in addition to the “piping” functionality we added with C Sorting Command Line Piping Tutorial as shown below, a couple of days ago. And it’s a pretty important chapter if you are interested in software integration, and “meeting points”. We talk about the “meeting point” of web and desktop applications through the use of mechanisms with the web application server language’s world … our web server language today is PHP and its exec method, but it could be ASP.Net and a new Process() scenario if that’s how you roll … but it has to be Windows web hosting … as we do with some local web serving utilizing the brilliant EasyPHP local web server … we can’t show you live on rjmprogramming.com.au domain because it is a Linux web server. Please don’t think everything is possible with this arrangement, and a designer of web functionality would be wary, so just play within reasonable restrictions, and you should be fine … but don’t know about you … but personally find this software integration interesting and exciting. So today we show some (proof of concept) server side PHP taking a file_get_contents() original data source and uses some C executable, placed into the same directory as the PHP, in conjuction with the use of the exec() method to rearrange the order of the items of the original data via that C executable’s sorting functionality. The programming C code you could call use_qsort.c changing from a couple of days ago as per this link shores up a bit of the data sophistication accepted. The programming PHP code you could call use_qsort.php supervises the Digital Mars C executable that is created using the C code above. Who says desktop work is irrelevant to web applications? After all, the server side languages interface to what the desktop world looks like … a web server operating system. It is worth remembering that no matter how “cloudy” things get there are still web servers at the end of all these trails. Previous relevant C Sorting Command Line Piping Tutorial is shown below. Hope you’ve been noticing the improved usefulness, as a tool, our C “sorting” program is becoming as, today, we add some “piping” functionality, to add to yesterday’s command line switch improvements with our Windows C program that sorts arguments on the command line via the qsort method when

Posted in eLearning, Operating System, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , | 23 Comments