Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-31-2011, 02:01 AM
Dreamrage's Avatar
Dreamrage Dreamrage is offline
Blue Rose Mentor
 
Join Date: 01-11-11
Location: South Africa
Posts: 5,024
iTrader: 0 / 0%
PHP for desktop apps?

Its an interesting thought isn't it?

I started with my PHP studies yesterday, and was reading about the many uses PHP has. It's quite impressive. The material I was reading from the manual, said that in some instances, with the right application of graphics and code, that you could easily create a desktop application using PHP code.

I want to ask the PHP experts out there, are there any apps running today that are coded in PHP? Is it a viable platform to use, and what kind of apps can you create.

It's good to know that PHP isn't just a web development tool and not only used as an HTML preprocessor.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 05-31-2011, 03:53 AM
Aneesh Aneesh is offline
Contributing Member
 
Join Date: 05-26-11
Posts: 56
iTrader: 0 / 0%
No, I don't think that it is possible to use PHP for desktop applications. But, when i have queried about it to Google, I got this one winbinder.org/overview.php, where you will find the possibility of creating windows apps using PHP. Have a look on it.
Also I have found an interesting pseudo code with the structure of winbound application,
PHP Code:
<?php
// first include the wb functions that are contained in some php scripts distributed with winbinders installation package
include('winbinder.php');
// next you need to create a window probably for the user to interact with
$mainwin wb_create_window( [ function args ] );
// next you need to draw controls on the above window
wb_create_control$mainwin, [ function args ] );
// next you need to set a handler for that window, this function will handle the button pushes and tab changes etc in your application, it's the "brains" of the operation so to speak
wb_set_handler$mainwin'process_my_window' );
// next we need to define the function and all it's procedures, notice this function has at least two parameters, the window it's for, and the id of the control being clicked, id's are specified in wb_create_control and normally defined before that, passing them works and trying to be as simple as I can be.
function process_my_window$window$id )
{
    switch( 
$id )
    {
        
// this ID is predefined by wb, it's for the exit button, and you MUST put one in
        
case IDCLOSE:
            
wb_destroy_window$window );
        break;
       
        case 
IDC_BUTTON:
            
// your other cases and buttons and what not here
        
break;
    }

}
// the next step is to tell wb to start looping infinitely with
wb_main_loop( );
?>
And I think, PHC-WIN is a windows application that allows one to create EXEs from PHP code.

Last edited by snakeair; 05-31-2011 at 08:13 AM.
 
Reply With Quote
  #3  
Old 05-31-2011, 04:25 AM
10db 10db is offline
Junior Member
 
Join Date: 04-15-11
Posts: 25
iTrader: 0 / 0%
from what I know, PHP is meant to run server side. But if it will be possible in the future (to create desktop apps using PHP), that would be really great.
 
Reply With Quote
  #4  
Old 05-31-2011, 05:15 AM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,038
iTrader: 4 / 100%
I don't really have enough experience to give a definitive answer. I can easily see scripts running on your local machine using a LAMP package or even a windows version. Most scripts are written and developed offline.

I guess it depends on what application like scripts you want to create.

If you are taking a course for PHP and MySQL you are definitely going to want a localhost machine. Being able to modify, save, run, and see the results immediately is when you really start to learn. I find the undo feature comes in handy quite often.
 
Reply With Quote
  #5  
Old 05-31-2011, 05:19 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Quote:
Originally Posted by ScriptMan View Post
I don't really have enough experience to give a definitive answer. I can easily see scripts running on your local machine using a LAMP package or even a windows version. Most scripts are written and developed offline.

I guess it depends on what application like scripts you want to create.

If you are taking a course for PHP and MySQL you are definitely going to want a localhost machine. Being able to modify, save, run, and see the results immediately is when you really start to learn. I find the undo feature comes in handy quite often.
This - I run various applications that are 'web' apps, but I run them via XAMPP, admittedly not many of them are PHP but rather PERL and Python, but the fundamentals of doing PHP desktop applications are the same. All you need is XAMPP, WAMP, LAMP or MAMP and you're good to go.
 
Reply With Quote
  #6  
Old 05-31-2011, 05:37 AM
clau clau is offline
Member
 
Join Date: 05-31-11
Posts: 31
iTrader: 0 / 0%
You need a server to run PHP. XAMPP and others like it are running Apache which allows you to run the PHP scripts.

On the other hand why would you create PHP scripts for offline use? There are many other programming languages that can be used instead.
 
Reply With Quote
  #7  
Old 05-31-2011, 05:38 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Quote:
Originally Posted by clau View Post
On the other hand why would you create PHP scripts for offline use? There are many other programming languages that can be used instead.
Why on earth would you use C++ to develop applications, when you can write it in machine code...
 
Reply With Quote
  #8  
Old 05-31-2011, 06:17 AM
clau clau is offline
Member
 
Join Date: 05-31-11
Posts: 31
iTrader: 0 / 0%
I did not say which language he should use to develop applications. PHP was created for web based applications not for offline ones. Is not better to use a programming language made for offline use, then using PHP?

How would these applications be distributed? Will it install XAMPP or something similar on each machine? I think this is nonsense as long as there are plenty other ways to make the application.
 
Reply With Quote
  #9  
Old 05-31-2011, 07:48 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Quote:
Originally Posted by clau View Post
I did not say which language he should use to develop applications. PHP was created for web based applications not for offline ones. Is not better to use a programming language made for offline use, then using PHP?

How would these applications be distributed? Will it install XAMPP or something similar on each machine? I think this is nonsense as long as there are plenty other ways to make the application.
Of course there is. But my point was, that applications that I or my friends have built, for example old gaming applications to record/manipulate data, scores etc that were hosted online years ago were built in web languages.

Nowadays, I don't use them for exactly the same uses, however why on earth would I modify something which works (in Perl, PHP or Python) in a whole new language.

As someone who does a lot of development, I have XAMPP running 24/7 anyway so using web languages on my desktop is no problem, these applications aren't going to be distributed, all of my computers that are on my network are development based or server based therefore have XAMPP or LAMP running, so that's not an issue.

Of course there are plenty of 'other ways' to make the application, but business 101 is time economics, it'd be a waste of my time to do so just so that it's wrote in a proper language.
 
Reply With Quote
  #10  
Old 05-31-2011, 05:19 PM
Hades's Avatar
Hades Hades is offline
Senior Web Developer
 
Join Date: 01-23-07
Location: Argentina
Posts: 2,273
iTrader: 0 / 0%
Don't waste your time with that, desktop applications are dying. They are slowly being replaced by cloud software, and I'm sure the release of ChromeOS will accelerate this process.
 
Reply With Quote
  #11  
Old 05-31-2011, 10:36 PM
Dreamrage's Avatar
Dreamrage Dreamrage is offline
Blue Rose Mentor
 
Join Date: 01-11-11
Location: South Africa
Posts: 5,024
iTrader: 0 / 0%
Ok. So it seems that I am going to need more if I want to branch out into desktop apps. Which is good.

Scriptman, I have MySQL here, and I have the means of building myself a localhost. It might not be as powerful as the systems I am working on now, unless I turn my desktop into a localhost. (Interesting Idea).

I know there are a lot of other languages out there. I have studied a few. The way I see it, C++ and Python are ok, but they were built for it. There is a challenge when creating a desktop app in PHP simply because you need to really know what you're doing to create it. I mean from what I have learned so far, you can create installers, the app itself and losh knows what more. it's just interesting is all.

If I wanted to go the easy way, and play around with code like C, C++, Python (which was more fun in linux) I would have. This just seemed like a challenge, and I want a go at it.

Hades, I know everything is moving towards cloud based systems, My work promotes one , but like I said, where I may have first started learning PHP for its web development capabilities, knowing I could do more with it, makes it sweeter. Depending on the types of apps I can code, I could find many uses for PHP besides coding a site.
 
Reply With Quote
  #12  
Old 06-01-2011, 01:03 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Quote:
Originally Posted by Hades View Post
Don't waste your time with that, desktop applications are dying. They are slowly being replaced by cloud software, and I'm sure the release of ChromeOS will accelerate this process.
I disagree, until everyone has such Internet capabilities that powerful desktop applications can be fully ported to the cloud desktop applications are going nowhere. We have tried to branch out into the cloud at my place of employment, the medical, legal and manufacturing branches have absolutely no interest in doing so with the current rate of Internet speeds it's many modern countries.

FORTRAN is still used heavily in the financial sector, I can't imagine the cloud taking proper shape where we're in a position to move away from desktop programming in the next few years. Until the cloud can move past such issues such as Flickr had with deleting peoples accounts and various security issues then the cloud will just be something that is new, exotic, innovative and the men in suits are terrified of for the most part.
 
Reply With Quote
  #13  
Old 06-01-2011, 02:03 AM
Dreamrage's Avatar
Dreamrage Dreamrage is offline
Blue Rose Mentor
 
Join Date: 01-11-11
Location: South Africa
Posts: 5,024
iTrader: 0 / 0%
I can agree with that. When I asked about creating desktop apps, I wasn't really talking about high end major programs either. I just thought about the possibility of creating something my girls could play around with or something that could be useful to my bosses etc. They say you could use images to create a GUI, or use graphics to create an app that is graphics based, so it sounded really interesting.
 
Reply With Quote
  #14  
Old 06-01-2011, 03:02 AM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,038
iTrader: 4 / 100%
Quote:
Originally Posted by Dreamrage View Post

Scriptman, I have MySQL here, and I have the means of building myself a localhost. It might not be as powerful as the systems I am working on now, unless I turn my desktop into a localhost. (Interesting Idea).
If you download one of the many WAMP packages you will have all you need in one neat package. I use the non-installer version of XAMPP on my desktop machine. I do not run Apache or MySQL as services. I start and stop them as I please. I use XP, and chose this version because it makes no registry entries.
 
Reply With Quote
  #15  
Old 06-01-2011, 03:12 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Quote:
Originally Posted by Dreamrage View Post
I can agree with that. When I asked about creating desktop apps, I wasn't really talking about high end major programs either. I just thought about the possibility of creating something my girls could play around with or something that could be useful to my bosses etc. They say you could use images to create a GUI, or use graphics to create an app that is graphics based, so it sounded really interesting.
For a GUI you can just create a HTML/CSS/Javascript page(s) as you would a web interface, you just run it locally, it's not compiling or anything.
 
Reply With Quote
  #16  
Old 06-01-2011, 03:28 AM
Dreamrage's Avatar
Dreamrage Dreamrage is offline
Blue Rose Mentor
 
Join Date: 01-11-11
Location: South Africa
Posts: 5,024
iTrader: 0 / 0%
Quote:
Originally Posted by Dan Williamson View Post
For a GUI you can just create a HTML/CSS/Javascript page(s) as you would a web interface, you just run it locally, it's not compiling or anything.
True, but you could. You would need other applications to do this though, but the thought is intriguing, well to me anyway. I know they say you can create installers, so if you could do that, their should be fewer limitations to coding a fully fledged app in PHP, complete from installer, the works.

One thing that has me thinking though. .dll's and .ini files. how would you code these in PHP? I mean its all good to create the app and all, but the nitty gritty that needs to go with it. how would you do that. Separate php files?
 
Reply With Quote
  #17  
Old 06-01-2011, 03:41 AM
Dreamrage's Avatar
Dreamrage Dreamrage is offline
Blue Rose Mentor
 
Join Date: 01-11-11
Location: South Africa
Posts: 5,024
iTrader: 0 / 0%
Quote:
Originally Posted by ScriptMan View Post
If you download one of the many WAMP packages you will have all you need in one neat package. I use the non-installer version of XAMPP on my desktop machine. I do not run Apache or MySQL as services. I start and stop them as I please. I use XP, and chose this version because it makes no registry entries.
hmmm, thank you I will take a closer look at this. I feel quite happy now. I really don't like it when I want to try something and someone says na uh.. can't be done.

I have it on my laptop, but as yet can't seem to get everything working. when I try look at the localhost index page to see if it works, I get error messages. I'm starting to get frustrated with it seriously.
 
Reply With Quote
  #18  
Old 06-01-2011, 04:35 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Try XAMPP instead of WAMP, I find it much easier, but still much better for my needs, they're essentially the same in all reality though.
 
Reply With Quote
  #19  
Old 06-01-2011, 02:04 PM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,038
iTrader: 4 / 100%
Quote:
Originally Posted by Dreamrage View Post

I have it on my laptop, but as yet can't seem to get everything working. when I try look at the localhost index page to see if it works, I get error messages. I'm starting to get frustrated with it seriously.
Share the error messages and I am sure someone can help.

If you are using the non-windows installer version you still need to run the install.bat file located in the directory you unzipped the files to. What I actually did was unzip the files to a directory I created on c:, then I copied those files to a new directory that I named Xampp, then I ran the install bat program which writes all the config files. You should then have an xampp icon on your desktop, clicking on that allows you to start Apache and MySQL.

You can not use PHP or MySQL unless you first load them as per above. I do not leave them running when I am not using them for security reasons.

Rather than creating your sites in the root at localhost I suggest creating folders under localhost and doing your thing in those locations. Your sites are reached by typing localhost/foldername into any browser that I have tested.

Clicking on any file in any folder will not load the page, it might if if it is html; but if if it is php then it will open in notepad. You have to use a browser to see the output of a PHP file.
 
Reply With Quote
  #20  
Old 06-01-2011, 02:43 PM
Hades's Avatar
Hades Hades is offline
Senior Web Developer
 
Join Date: 01-23-07
Location: Argentina
Posts: 2,273
iTrader: 0 / 0%
Quote:
Originally Posted by Dan Williamson View Post
I disagree, until everyone has such Internet capabilities that powerful desktop applications can be fully ported to the cloud desktop applications are going nowhere. We have tried to branch out into the cloud at my place of employment, the medical, legal and manufacturing branches have absolutely no interest in doing so with the current rate of Internet speeds it's many modern countries.

FORTRAN is still used heavily in the financial sector, I can't imagine the cloud taking proper shape where we're in a position to move away from desktop programming in the next few years. Until the cloud can move past such issues such as Flickr had with deleting peoples accounts and various security issues then the cloud will just be something that is new, exotic, innovative and the men in suits are terrified of for the most part.
Well that's why I used the word "slowly", I don't think anybody can deny it's going to happen eventually.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help on facebook apps sirkakashi08 Coding Forum 1 09-01-2009 12:08 AM
What Twitter apps do you use? juliensimon SEO Forum 9 05-01-2009 10:26 PM
google apps jamyam.com Google Forum 1 09-10-2006 01:36 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:26 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC