Log in

View Full Version : logo in php



hemi
06-30-2010, 11:07 AM
hello All,

Iam doing a program in php.I completed it successfully now what i want is i want to make an icon for that application and when i click on that, it should open the application.Is this possible in Php

Beverleyh
06-30-2010, 01:03 PM
Could do with a bit more info - do you mean to run a function or actually open an new application (.php page) window?

If you're asking for a php equivelant to javascript's onclick="DoFunction();" action, then no, there isnt one (php is server-side, javascript is client-side)

But if you're asking if you can insert HTML into a php file to display your logo image, then yes, just use the usual <a href="my_application.php"><img src="path/to/image/my_logo.jpg" height="100" width="100" alt="logo" /></a> code and wrap it in hyperlinked anchor tags to open your application.php page.

traq
06-30-2010, 01:19 PM
...are you doing a desktop application in php? or a web app?

hemi
06-30-2010, 01:42 PM
thnks for ur reply ,


iam doing desktop application so i want to place an icon relating to that.

traq
06-30-2010, 03:57 PM
I thought you might be doing a desktop app, the way you worded it. But, sorry, I'm not sure how that would work.

djr33
06-30-2010, 07:49 PM
You will need a .ico file and a way to attach this to your program. The easiest way would be to use your compiler if there is an option, such as compile test.php -i:icon.ico (rough guess about the format), if your compiler supports that.
If your compiler does not, then you will need to find a way to change the icon of an .exe that is already compiled. I don't know if this is possible, but if it is I think you can find shareware/freeware for it. Try searching google for "set icon .exe" and have some patience-- you'll get a lot of useless results (mostly for creating .ico files-- but you might need that too), and probably some that work.

Note: this question is completely unrelated to PHP (as code), and only related to your compiler and how windows works with .exe files. You might find more help at a desktop programming forum if needed. Most users here don't use PHP to create desktop applications (and most people who DO create desktop applications don't use PHP). I've done a very small amount, but I don't know very much about it except that PHP is very slow and usually not the right language for desktop programming.


I don't know what compiler you are using, but there may be no reason not to use bambalam:
http://www.bambalam.se/bamcompile/
It's free and supports icons (in the format I used above).
This is the compiler I've used for PHP. It works well, at least for basic programs.

traq
06-30-2010, 08:08 PM
the whole idea of desktop php is mildly exciting for me... my initial reaction is "wow, awesome, I'd love to try that!", but then my sense of practicality comes in: I don't have any needs for a desktop app, no experience in writing them at all (not since 5th grade when we did stuff like 10 IF X = 42 GOTO 40
20 X = X + 1
30 GOTO 10
40 PRINT "X equals 42", anyway), and, beyond that, I get the feeling that if I ever get into desktop programs, there's probably a better place to start than php. :)

That compiler is pretty cool-looking, though.

djr33
06-30-2010, 08:38 PM
I've used it and tried a few things. It works, but it's slow.
I was using the GD library at one point to do some filters for images, and I created an .exe that would run through all of the images in a folder and apply it to all of them then save the output files. GD is inefficient and running PHP as a desktop app is inefficient, but aside from that it was good and did what I needed. The main advantage of running it there instead of my server was that it could run for hours (literally) without the problems of doing that on a server. And I could use files locally rather than uploading them.
Other things I've tried are a file encryptor (just for fun but it worked) and an FTP uploader (using PHP's ftp functions). I wanted to get the ftp uploader to be more useful (as it was, I compiled the filename and destination into the program), but never got a chance.
The main problem is that the compiler is simple and doesn't have many options for input/output, etc. It actually does have these options, but it's complicated and would as you say be easier to do it using another language. Since I don't know another language, though, it's better than nothing and fun to play with.

As a completely random note, at least with bambalam, you can compile an include then keep the rest as text (included.php). So I found this a good way to test things (mostly image manipulations), and this might be a good way to test some complex algorithm locally rather than dealing with it on your server.

hemi
07-01-2010, 05:29 AM
well, thanks for suggestion. This was really helpfull