I need to know how many people are interested in learning how to write a desktop application using PHP? If I get enough interest on this topic, then I will write a simple tutorial on how its done.

We (veedeoo and me) were experimenting on Desktop apps utilizing the Daniweb API. I don't have the screenshot for now, but if there are reasonable number of interested party, I can easly provide some.

Please let me know and thanks for reading. You can either response or click on the up vote..

Member Avatar for diafol

Could you elaborate? Are you using something like PHP-GTK? Do you use a browser as a container for the 'app' or is it a windows executable?

If you make it in Java, I love you... because you've instantly supported Win/Mac/Linux.

Member Avatar for diafol

What interested me was writing (I am assuming) PHP code to create a desktop app (again assuming - a win executable).

@D,

Luckily, I always keep screenshots on my thumb drive and desktop. Here we go Mr. L.D.A

yes it is a win executable or msi. The application is pretty lightweight. We experimented using a CSS framework like bootstrap.

We used the tideSDK with Titanium SDK. Unlike PHP-GTK, we have more success in developing with tideSDK.

below is the screenshot of a bootsrap framework working as front-end

274c117a456347408e5c34e452f35c67

the screenshot at runtime

ff1163a87aec3fc4f935daf07ec878ba

the executed desktop app using the simple Daniweb API codes as shown

$feed = file_get_contents('https://www.daniweb.com/rss/pull/solved');
$articles = new SimpleXMLElement($feed);

foreach ($articles->channel->item as $article) {
echo '<a href="' . $article->link . '">' . $article->title . '</a><br />';
}

the result

6e983e02f804e5c6a826a741a71f32f9

screenshot of the link destination of the app, once clicked. Screenshot showing the application browsing this thread.

1f0d93124e6661bdf0974de1da981cd0

screenshot of the win32 files

ea8b86b1d6278b5d720ba90eed92d671

The SDK is pretty easy to work on. In fact, they also have an android SDK and other mobile SDKs.

Example of coding in procedural

<script type="text/php">

    function set_array()
    {

       return (array('php','javascript','ruby','python'));

     }

 </script>

we can pass the output of the PHP function above onto the javascript function

<script>

    function jsFunction() {
        var index;
        var text = "<ul>";

        var codes = (show_array());
        for (index = 0; index < codes.length; index++) {
            text += "<li>" + codes[index] + "</li>";
        }
        text += "</ul>";
        document.getElementById("codes").innerHTML = text;
    }

</script>

we deliver the output to the front-end

<button onclick="jsFunction()">Show Array</button>
<p id="codes"></p>

the desktop application output is shown by the screenshot below.

b33d615c9c53fbdc60574f744f4a3458

We are still experimenting on form processing e.g. youtube search api or anysite search capability. Below is the screenshot of the youtube API version 2 that I have just implemented last month. No cSS styling or anything as shown below.

34681675f9bc5befaf6b906855fde301

correction! :)

this

<script>
    function jsFunction() {
    var index;
    var text = "<ul>";
    var codes = (show_array());
    for (index = 0; index < codes.length; index++) {
    text += "<li>" + codes[index] + "</li>";
    }
    text += "</ul>";
    document.getElementById("codes").innerHTML = text;
    }
</script>

should read

<script>
    function jsFunction() {
    var index;
    var text = "<ul>";
    var codes = (set_array());
    for (index = 0; index < codes.length; index++) {
    text += "<li>" + codes[index] + "</li>";
    }
    text += "</ul>";
    document.getElementById("codes").innerHTML = text;
    }
</script>
Member Avatar for diafol

Oh that.s fantastic guys. Love to see simethinf in the tutes about this. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.