1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I PROGRAM with PHP?

Discussion in 'General Programming Chat' started by drey2k, Apr 16, 2010.

  1. drey2k

    drey2k Power Member

    Joined:
    Jan 4, 2009
    Messages:
    551
    Likes Received:
    169
    Occupation:
    Finance guy
    Location:
    USSR 1943
    I have the basics of PHP scripting down. I can use it to create forms on websites, to create functions on sites that do certains things, to use it for includes and anything else in general to do on a site. I'm also learning how to use it with SQL right now.

    But how do I go about making full fledged programs with PHP? I mean programs that you run off an .exe file or something like that.

    I know there are a ton of programs out there that are probably better for this than PHP (I'm thinking of studying Ruby), but I like the simplicity of PHP and I am already familiar with it.

    Thank you
     
  2. Grizzy

    Grizzy Senior Member

    Joined:
    Nov 11, 2008
    Messages:
    919
    Likes Received:
    999
    Yea your right there are much better alternatives than php for a desktop applications...

    But you can check out bamcompile if you want to compile your php scripts into EXEs.
     
  3. relaxin

    relaxin Junior Member

    Joined:
    Aug 13, 2007
    Messages:
    100
    Likes Received:
    25
    Occupation:
    CEO
    May be php is not the best option for exe app.

    But if you really want to get the power of basic PHP, learn how to use curl_setopt () and regular expressions..

    Online it's all about interaction so by using curl library you can interact with other websites.

    To learn about creating any program just take notes of all those things you hate doing manually like searching on google for inurl:register "powered by pligg".

    Instead of copying and pasting urls returned just use use few curl_setopt options to download the page, and parse the results you need. Repeat the process by using any kind of loop you want. HINT use sleep function btn queries.
     
    Last edited: Apr 16, 2010
  4. aмillionaírе

    aмillionaírе Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 20, 2008
    Messages:
    532
    Likes Received:
    358
    You cannot make exe apps with php.

    you can make command line and PHP-GTK (desktop) apps with it, though.

    There's a few downsides to php: you cannot multi-thread it, you can't multi-process it unless you fork it, a process control library is available for forking but only on UNIX-boxes.

    The forking and command line features puts it on the same level as perl, they all come from the c bloodline anyway.

    I use the command line to run millions of queries, it's quite stable.
     
    Last edited: Apr 16, 2010
  5. clposterboy

    clposterboy Junior Member

    Joined:
    Mar 10, 2010
    Messages:
    104
    Likes Received:
    5
    So which is the best program to create exe applications if not for PHP?
     
  6. drey2k

    drey2k Power Member

    Joined:
    Jan 4, 2009
    Messages:
    551
    Likes Received:
    169
    Occupation:
    Finance guy
    Location:
    USSR 1943
    Okay say I want to make an alternative to SEnuke or Scrapebox, would I be able to do it with PHP alone?
     
  7. geteasymoneynow

    geteasymoneynow Regular Member

    Joined:
    Jan 17, 2010
    Messages:
    336
    Likes Received:
    290
    Occupation:
    Any Thing
    Location:
    With your girlfriend
    php is so much better for the web not so sure about exe files!
    try VB
     
  8. geteasymoneynow

    geteasymoneynow Regular Member

    Joined:
    Jan 17, 2010
    Messages:
    336
    Likes Received:
    290
    Occupation:
    Any Thing
    Location:
    With your girlfriend
    VB is really hard but you will be able to customize it and make a great app
    similar to SEnuke and Scrapebox!

    but it will take you somebit of time before you are at that level
     
  9. aмillionaírе

    aмillionaírе Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 20, 2008
    Messages:
    532
    Likes Received:
    358
    Yes, but your fingers will hurt from typing so much code. :22:
     
  10. relaxin

    relaxin Junior Member

    Joined:
    Aug 13, 2007
    Messages:
    100
    Likes Received:
    25
    Occupation:
    CEO
    What specifically do want to create?
     
  11. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    Yeah, I am a php programmer, as well as other languages and platforms. If you want to build and run an .exe file, you are much better off getting into C++ or VB ( visual basic C+ training ).

    Php is a server side language and will pull many things for you but, a desktop application isn't one of them.
     
  12. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    The answer to that would be ' No '. Sorry, but php doesn't work like that. It is a server side language that operates from it's own functions and crosses with mysql for database operations for its main use. I can and have programmed server scripts and applications that will pull mearly any featured task but, it will not work as a stand alone application like an .exe file. It has to function within a server directory or else it won't pull, as the php source operators are based in the php language that is read through apache as a specific web server-to-browser system.
     
  13. WizGizmo

    WizGizmo Super Moderator Staff Member Premium Member

    Joined:
    Mar 28, 2008
    Messages:
    3,845
    Likes Received:
    55,442
    For online applications, uBot is becoming quite popular as a programming environment.

    "Wiz"
     
  14. happyhatter

    happyhatter Registered Member

    Joined:
    Jan 26, 2009
    Messages:
    61
    Likes Received:
    3
    I tried this but get Access denied messages to the MySQL to my website. Any ideas how to get around that?
     
  15. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    You need a database connect form included in your script, to access the database username, password, server path,( as it will NOT be localhost due to it being called from your server and not the user's pc ), and database name.

    This should have the mysql query connecting to the database and then login/access information.