ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Dipping Toes Into Programming

    Developer Discussion
    16
    142
    18.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ObsolesceO
      Obsolesce
      last edited by

      I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).

      Lots of potential there.

      I can get form data processed by powershell and outputted to a web page.

      I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.

      I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)

      scottalanmillerS 1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @Obsolesce
        last edited by

        @tim_g said in Dipping Toes Into Programming:

        I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).

        Lots of potential there.

        I can get form data processed by powershell and outputted to a web page.

        I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.

        I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)

        So basically recreating Honolulu?

        ObsolesceO 1 Reply Last reply Reply Quote 0
        • ObsolesceO
          Obsolesce @scottalanmiller
          last edited by

          @scottalanmiller said in Dipping Toes Into Programming:

          @tim_g said in Dipping Toes Into Programming:

          I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).

          Lots of potential there.

          I can get form data processed by powershell and outputted to a web page.

          I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.

          I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)

          So basically recreating Honolulu?

          If that's how it work, I haven't looked... then yes.

          Except this would be a learning tool for me as I'm going through my PHP book, where I implement things as I learn them.
          That's what I'm doing now with this other PHP web application.

          F 1 Reply Last reply Reply Quote 2
          • F
            flaxking @Obsolesce
            last edited by

            @tim_g said in Dipping Toes Into Programming:

            @scottalanmiller said in Dipping Toes Into Programming:

            @tim_g said in Dipping Toes Into Programming:

            I was playing around with the concept of using PHP and forms to do things with PowerShell (given a Windows Server is running a web server with PHP such as XAMPP).

            Lots of potential there.

            I can get form data processed by powershell and outputted to a web page.

            I didn't do much last night, but I was able to output PING results to the web page, and when I was finished for the night, I put in code so when I refreshed the web page, it shut down my computer.

            I'm thinking I could potentially create an internal web app to control anything via PowerShell by use of forms... such as adding a user to AD to running reports. (of course secured and login required)

            So basically recreating Honolulu?

            If that's how it work, I haven't looked... then yes.

            Except this would be a learning tool for me as I'm going through my PHP book, where I implement things as I learn them.
            That's what I'm doing now with this other PHP web application.

            Applying what you're learning to something you already know - it's a good learning strategy

            1 Reply Last reply Reply Quote 0
            • D
              dave_c
              last edited by

              I am not sure I would recommend PHP as a first language; perhaps PHP 7 leveraging Laravel or something structured. Mainstream PHP programmers used to have many bad habits. PHP 7 has good object support and I do not dislike it that much.
              Python is very good for a first language.
              I am more of a backend programmer and for that I like Go; it is a small language with very good concurrency.
              For front end I like https://vuejs.org/ more than React

              By the way, the python paradox is a good read: http://www.paulgraham.com/pypar.html

              scottalanmillerS 1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @dave_c
                last edited by

                @dave_c said in Dipping Toes Into Programming:

                Mainstream PHP programmers used to have many bad habits.

                That won't affect the learner, though. Learn from a good source, and PHP won't be in the way at all. PHP itself doesn't encourage bad habits, that was just a culture of people using it as non-programmers.

                D 1 Reply Last reply Reply Quote 1
                • D
                  dave_c @scottalanmiller
                  last edited by

                  @scottalanmiller
                  Oh, yes: Learn from a good source.
                  PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"

                  ObsolesceO 1 Reply Last reply Reply Quote 1
                  • ObsolesceO
                    Obsolesce @dave_c
                    last edited by

                    @dave_c said in Dipping Toes Into Programming:

                    @scottalanmiller
                    Oh, yes: Learn from a good source.
                    PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"

                    PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.

                    dafyreD scottalanmillerS 2 Replies Last reply Reply Quote 0
                    • ObsolesceO
                      Obsolesce
                      last edited by

                      I do plan on learning Python as well, but PHP is easier for me to learn programming.

                      1 Reply Last reply Reply Quote 0
                      • dafyreD
                        dafyre @Obsolesce
                        last edited by

                        @tim_g said in Dipping Toes Into Programming:

                        @dave_c said in Dipping Toes Into Programming:

                        @scottalanmiller
                        Oh, yes: Learn from a good source.
                        PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"

                        PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.

                        No kidding. It has been a while since I've done anything in PHP and I had an idea to tinker with tonight... I keep shooting myself in the foot trying to use PowerShell syntax for stuff.

                        F 1 Reply Last reply Reply Quote 1
                        • scottalanmillerS
                          scottalanmiller @Obsolesce
                          last edited by

                          @tim_g said in Dipping Toes Into Programming:

                          @dave_c said in Dipping Toes Into Programming:

                          @scottalanmiller
                          Oh, yes: Learn from a good source.
                          PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"

                          PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.

                          Oh gosh I hope not.

                          ObsolesceO 1 Reply Last reply Reply Quote 0
                          • F
                            flaxking @dafyre
                            last edited by

                            @dafyre said in Dipping Toes Into Programming:

                            I keep shooting myself in the foot trying to use PowerShell syntax for stuff.

                            I feel like that problem just gets worse before it gets better (does it ever get better?)

                            1 Reply Last reply Reply Quote 0
                            • ObsolesceO
                              Obsolesce @scottalanmiller
                              last edited by

                              @scottalanmiller said in Dipping Toes Into Programming:

                              @tim_g said in Dipping Toes Into Programming:

                              @dave_c said in Dipping Toes Into Programming:

                              @scottalanmiller
                              Oh, yes: Learn from a good source.
                              PHP "was" badly designed. PHP 7 has more sanity. Quoting someone on the internet: "Languages like Python or Ruby were designed, PHP just happened"

                              PHP is reminds me a lot of Powershell scripting. I'm running into so many similarities.

                              Oh gosh I hope not.

                              I'm not talking about the cmdlets and stuff. I mean the scripting parts... programming logic, loops, arrays and such... those areas.

                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller
                                last edited by

                                You're probably just seeing the underlying paradigm of procedural programming.

                                ObsolesceO 1 Reply Last reply Reply Quote 5
                                • ObsolesceO
                                  Obsolesce @scottalanmiller
                                  last edited by

                                  @scottalanmiller said in Dipping Toes Into Programming:

                                  You're probably just seeing the underlying paradigm of procedural programming.

                                  Yeah hats probably the case.

                                  1 Reply Last reply Reply Quote 0
                                  • scottalanmillerS
                                    scottalanmiller
                                    last edited by

                                    https://medium.freecodecamp.org/every-time-you-build-a-to-do-list-app-a-puppy-dies-505b54637a5d

                                    ObsolesceO 1 Reply Last reply Reply Quote 0
                                    • ObsolesceO
                                      Obsolesce @scottalanmiller
                                      last edited by

                                      @scottalanmiller said in Dipping Toes Into Programming:

                                      https://medium.freecodecamp.org/every-time-you-build-a-to-do-list-app-a-puppy-dies-505b54637a5d

                                      My first project that I'm almost finished with is a nutrition calculator for my protein bar recipe.

                                      That basically covers the first two chapters and a little into 3.

                                      Though, there's about 65 form fields to handle, so it's quite big without me knowing how to handle all those fields, especially due to them initially being generated automatically by like 4 lines of PHP.

                                      I'll link it after it's finished, it's quite nice for it's purpose.

                                      1 Reply Last reply Reply Quote 1
                                      • scottalanmillerS
                                        scottalanmiller
                                        last edited by

                                        Cool

                                        ObsolesceO 1 Reply Last reply Reply Quote 0
                                        • ObsolesceO
                                          Obsolesce @scottalanmiller
                                          last edited by Obsolesce

                                          @scottalanmiller said in Dipping Toes Into Programming:

                                          Cool

                                          I'm pretty close to being done with my first project to drive home chapters 1 and 2 of the book (plus what I learned on SoloLearn).

                                          Edit: It takes advantage of HTML5 and PHP7+ only features 🙂

                                          Here's the results so far:

                                          First Screenshot:
                                          This is the default page, and all of this is automatically generated and filled in with just a few lines of PHP, and allows you to adjust as needed before submitting how much one bar weighs.
                                          0_1521777918836_1a32ad09-6e8c-4607-ab94-64bc999ea572-image.png

                                          Second Screenshot:
                                          This shows the results of everything from the first screenshot.
                                          0_1521778015722_6b1eb8c1-e107-4714-896e-f4990f62f279-image.png

                                          I know I need to work on formatting and prettyness a bit, but my main goal was first functionality.

                                          I also have error handling, and defaulting to ZERO:
                                          0_1521778124030_82deadb9-3fa6-4640-b366-c82ccfbdb8a4-image.png

                                          As well as injection prevention, null setting before any handling, and strict checking:
                                          0_1521778245010_da8aa7b1-7d55-45d0-a3cd-f0f6e394682d-image.png

                                          A snippet of just the $grams variable (but applies to everything):
                                          0_1521778343606_419b4e5a-e65b-401b-97aa-b80a3aaa397a-image.png
                                          (that's an old comment to myself that I haven't removed yet)

                                          JaredBuschJ 1 Reply Last reply Reply Quote 3
                                          • ObsolesceO
                                            Obsolesce
                                            last edited by

                                            For the rest of the chapters, I'll be doing other projects (two of which I started already and got as far as I could with the knowledge of chapters 1 and 2 (some of 3)) and will do those as I go through the book... also, I will make this Protein Bar Nutrition Calculator way more efficient on the back end as I learn more.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 6 / 8
                                            • First post
                                              Last post