PHP Content Type Iframe Synchronize Tutorial

PHP Content Type Iframe Synchronize Tutorial

PHP Content Type Iframe Synchronize Tutorial

Today, again, we drill deeper into the scenario 3 of PHP Content Type Primer Tutorial as shown way below, two days ago.

Today we put in functionality to place your URLs, the “s” of which was inspired by the work of yesterday’s PHP Content Type Iframe Overlay Tutorial as shown below, into an HTML form element that, again, can be rePOSTed back to our PHP web application php_content_type.php so that we can start (the web application execution) afresh with the chance to Synchronize (via an HTML form submit button) media files you may want to play, for instance.

You’ll probably find impediments to Synchronicity with mobile platform usage, but we’ll just see how it goes for now. If you read this blog often, perhaps you remember a previous incarnation of web applications to Synchronize with PHP/Javascript Media Synchronize Cross Browser Tutorial. It is definitely a topic where cross-browser and cross-platform issues come into play.

So, again, have a go at a live run if you like (and note that you can suffix your URLs with ?wording=[a_caption] or &wording=[a_caption] for explanatory wording functionality, as required), or take a geek at the PHP source code you could call php_content_type.php or take a peek at the changes made to yesterday’s efforts at php_content_type.php … and we hope it helps you out with a web application idea you have.


Previous relevant PHP Content Type Iframe Overlay Tutorial is shown below.

PHP Content Type Iframe Overlay Tutorial

PHP Content Type Iframe Overlay Tutorial

Today we drill deeper into the scenario 3 of yesterday’s PHP Content Type Primer Tutorial as shown below.

In the process we discover another concept for the “overlay” ideas we present at this blog. It is not that we haven’t done this before, in a sense, but that we haven’t tagged it as an idea in the category (or “tag” (chortle, chortle)) of “overlay”, but we need to talk about it … you first … ooooookay … an HTML iframe element that has its src= parameter be dynamically changed is another way to think of a concept of “overlay” … okay, it’s out there … do with it what you will! Call up the president on the red phone, or pick the yellow phone and speak to your Avon representative.

But, seriously, this is serious … can’t you tell?!

What we want to point out about that src= value to dynamically change is that it can be like yesterday’s call with a PHP content type (or mime type) that is not your usual “text/html”. Is THIS of more interest now?!

But, seriously, this is serious … you can tell … we changed the font size … now THAT‘s serious.

The upshot is, that this may mean you can synchronize media perhaps (and perhaps you were a reader when we did tutorials like PHP/Javascript Media Synchronize Cross Browser Tutorial (which attempted synchronization of media) earlier at this blog), or what we do today with our tutorial picture, and allow for the piecing together of a “home cobbled” slideshow, a common overlay “suspect”. We allow for the “Add” option rather than “Overlay” as well, to open up a new HTML iframe on the fly, so to speak.

If you ever use the wonderful Gifpal to create your animated GIFs, we hope to have achieved something just a tad similar, in that, once you enter in a new URL, it is added into the slideshow dynamically, probably not as cutely as Gifpal, but there’s an element of cuteness to seeing a slideshow presentation dynamically change … or it could be that the writer is easily amused!

So have a go at a live run if you like, or take a gecko at the PHP source code you could call php_content_type.php or take a squizz at the changes made to yesterday’s efforts at php_content_type.php


Previous relevant PHP Content Type Primer Tutorial is shown below.

PHP Content Type Primer Tutorial

PHP Content Type Primer Tutorial

Today we want to start a discussion on a big topic in web programming, the webpage content type (or mime type).

The normal association of webpages is with the …


text/html

… mime type. Server side languages such as PHP and ASP.Net, for the most part, create webpages in HTML format, but they don’t have to. Supposing you have some PDF data then you can use PHP’s header method to use (the snippet from today’s PHP php_content_type.php) …


<?php
// ...
// no echo statements anywhere up here
// ...
header('Content-Type: ' . $ct);
echo file_get_contents(urldecode($_POST['selname']));
?>

… to show a webpage using a mime type defined by the PHP variable $ct which is “application/pdf” in the URL “HTTP://localhost:888/logo.pdf” of our example tutorial picture.

We show this distinction today by writing a PHP web application that in the first instance is a web page consisting of an HTML form as per …


<form target='_blank' action='./php_content_type.php' method='POST'>
...

… the “target=’_blank'” of which is ensuring a new webpage will be opened and by saying “method=’POST'”, on submission, would POST (into $_POST[‘selname’]) to itself (in a new webpage) the HTML input type=url as per …


Url: <input type='url' name='selname' id='selname' style='width:70%;' value='//www.rjmprogramming.com.au/MyBusinessUnidad/Welcome_files/logo.jpg'></input>
...

… the user defined URL of interest.

In the second instance, or the callback scenario, the php_content_type.php code analyzes $_POST[‘selname’] to derive a file extension (if none, would assume a mime type of text/html). That file extension we map against the very useful sitepoint resource we thank very much to arrive at a suitable mime type to be suitable for that PHP $ct variable we talked about earlier. This gives us the scenario used for the middle of three buttons …

  1. Navigate via Web Browser … up at the web browser address bar you’ll see the Url of your data source
  2. Show via PHP Content Type to New Webpage … up at the web browser address bar you’ll see the Url of php_content_type.php (which got POSTed to … so no $_SERVER[‘QUERY_STRING’] even)
  3. Show PHP Content Type Below … ie. to an HTML iframe, the scenario of today’s tutorial picture

With scenarios 2 and 3 above there is no hope that View->Page Source nor This Frame->View Page Source will result in a happy readable result, where scenario 1 will sometimes allow for this.

With this knowledge in mind, or by trying a live run, maybe now, some of the mystifying address bar URLs you encounter surfing the net may be more explainable to you … hope so. Understanding of this topic can be a “light bulb” moment for many people, and a little bit of patience can reveal many possibilities with web applications, should you delve deeper yourself.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in Animation, eLearning, Tutorials and tagged , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

23 Responses to PHP Content Type Iframe Synchronize Tutorial

  1. whoah this blog is wonderful i like studying your posts. Keep up the great work! You know, a lot of people are looking around for this info, you could aid them greatly.

  2. Car Shopping says:

    I just couldn’t leave your website before suggesting that I really loved the usual information a person supply for your guests? Is gonna be again ceaselessly to check up on new posts

  3. Woodworking says:

    Nice read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch as I found it for him smile Therefore let me rephrase that: Thanks for lunch!

  4. Computer says:

    Good article and straight to the point. I don’t know if this is truly the best place to ask but do you folks have any thoughts on where to get some professional writers? Thanks :)

  5. Thanks so much for providing individuals with an exceptionally special opportunity to read from here. It can be so useful and packed with fun for me and my office acquaintances to search the blog no less than 3 times in one week to study the newest secrets you will have. And lastly, I am always motivated considering the amazing suggestions served by you. Certain two ideas in this post are in reality the most effective I’ve had.

  6. Fitness says:

    hi!,I like your writing so a lot! share we keep in touch extra about your article on AOL? I need an expert on this space to solve my problem. May be that’s you! Having a look ahead to peer you.

  7. I was just seeking this info for a while. After 6 hours of continuous Googleing, at last I got it in your site. I wonder what’s the lack of Google strategy that do not rank this kind of informative web sites in top of the list. Generally the top web sites are full of garbage.

  8. Healthy Diet says:

    I have been examinating out many of your posts and i can state pretty good stuff. I will definitely bookmark your site.

  9. Of course, what a splendid site and instructive posts, I definitely will bookmark your site.Best Regards!

  10. You can find undoubtedly a lot of particulars like that to take into consideration. That could be a good level to deliver up. I offer the thoughts above as basic inspiration even so clearly there are questions just like the one you bring up the place the most important thing shall be working in sincere very good faith. I don?t know if finest practices have emerged about issues like that, nevertheless I am positive that your job is clearly recognized as a excellent game. Both girls and boys actually feel the affect of just a secondÒ€ℒs pleasure, for the remainder of their lives.

  11. thank you says:

    Hello. remarkable job. I did not expect this. This is a fantastic story. Thanks!

  12. Intriguing, but not perfect. Are you going to write more?

  13. besi wf 300 says:

    muchos gracias for your blog good articles informative article iam happy linked to this place

  14. Hello. Great job. I did not anticipate this. This is a remarkable story. Thanks!

  15. Canon Camera says:

    I savour, lead to I found exactly what I was looking for. You have ended my 4 day long hunt! God Bless you man. Have a great day. Bye

  16. Good – I should certainly pronounce, impressed with your web site. I had no trouble navigating through all the tabs as well as related information ended up being truly easy to do to access. I recently found what I hoped for before you know it at all. Reasonably unusual. Is likely to appreciate it for those who add forums or anything, website theme . a tones way for your customer to communicate. Nice task.

  17. You actually make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand. It seems too complicated and very broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!

  18. Plenty says:

    you’re really a good webmaster. The website loading speed is amazing. It seems that you’re doing any unique trick. Also, The contents are masterpiece. you have done a excellent activity in this matter!

  19. click here says:

    Cool post thanks! We believe your articles are fantastic and hope more soon. We really like anything to do with word games/word play.

  20. Great internet site! I actually enjoy how it’s simple on my eyes and the data are effectively written. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which should do the trick! Have an excellent day!

  21. Plenty says:

    yes, research is having to pay off. I appreciate you blogging your viewpoint.. So content to possess identified this article.. Value the posting you furnished..

  22. Sam Kattaura says:

    An impressive share, I provided this onto a colleague who had previously been doing small evaluation for this. And he in reality purchased me breakfast basically because I came across it for him.. smile. So well then, i’ll reword that: Thnx with all the treat! But yeah Thnkx for spending plenty of time to speak about this, Personally i feel strongly concerning it and adore reading a lot additional about this subject. When achievable, as you develop into experience, do you thoughts updating your internet site with an raise of particulars? It is extremely valuable for me. Large thumb up just for this weblog post!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>