Is PHP the easier web programming language?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marta

    Is PHP the easier web programming language?

    Hi all!

    I would to study a web programming language to create a PHP script
    (output.php) that, given the following
    input page (input.htm) where the user select the weight and volume of a
    package to be shipped, returns the prices of various couriers ("yellow",
    "blue" and "black").
    Really is PHP my best choice? ASP is much more complicated? and what about
    Perl?

    ~~~ input page input.htm:

    <form method="GET" action="output. php" name="input">

    SELECT THE VOLUME OF YOUR PACKAGE:

    <input type="radio" name="volume" value="1"> from 0 to 1 m3
    <input type="radio" name="volume" value="2"> from 1 to 2 m3
    <input type="radio" name="volume" value="3"> from 2 to 3 m3

    <br>SELECT THE WEIGHT OF YOUR PACKAGE:

    <input type="radio" name="weight" value="100"> from 0 to 100 Kg
    <input type="radio" name="weight" value="200"> from 100 to 200 Kg
    <input type="radio" name="weight" value="300"> from 200 to 300 Kg

    </form>

    ~~~ istructions to be integrated in the "output.php " script:

    Courier "yellow" - for volume 1, 2 and 3:
    if weight=100 then rate=600
    if weight=200 then rate=900
    if weight=300 then rate=1200

    Courier "blue" - for volume 1 and 2:
    if weight=100 then rate=400
    if weight=200 then rate=700

    Courier "black" - for volume 2 and 3:
    if weight=100 then rate=800
    if weight=200 then rate=1100
    if weight=300 then rate=1500


    ~~~ sample request and result:

    Example A) With the user input:
    volume=2
    weight=300

    output.php must generate this result:
    courier "yellow" = 1200
    courier "black" = 1500


    Example B) With the user input:
    volume=1
    weight=100

    output.php must generate this result:
    courier "yellow" = 600
    courier "blue" = 400





  • Jeb Hunter

    #2
    Re: Is PHP the easier web programming language?

    PHP and ASP are really quite similar, beyond the obvious syntactic
    differences. I use Codecharge Studio http://www.codecharge.com/?906 and
    switch back and forth between ASP and PHP with no trouble at all, despite
    having all ASP and no PHP experience. Well, except for remembering to use
    the ";" to end my PHP lines ;-)

    Personally, I lean towards PHP these days just because there seems to be a
    broader community of support for it.


    Comment

    • lawrence

      #3
      Re: Is PHP the easier web programming language?

      "Jeb Hunter" <jebhunter@mail .com> wrote in message news:<cbmdnX37P ZTs-gLcRVn-1Q@comcast.com> ...[color=blue]
      > Personally, I lean towards PHP these days just because there seems to be a
      > broader community of support for it.[/color]

      I assume you mean a broader free community. There is a huge industry
      behind ASP, and millions of people programming with it, but its all
      high dollar. I'm impressed with the fact that when I open the
      newspaper and look at the want ads there are several requests for ASP
      and none for PHP. Yet if you go looking for advice, it is easy to find
      tons of free advice and free code for PHP. With ASP, no one gives
      advice without charging for it.

      Comment

      • JAS

        #4
        Re: Is PHP the easier web programming language?

        lawrence wrote:[color=blue]
        > "Jeb Hunter" <jebhunter@mail .com> wrote in message news:<cbmdnX37P ZTs-gLcRVn-1Q@comcast.com> ...
        >[color=green]
        >>Personally, I lean towards PHP these days just because there seems to be a
        >>broader community of support for it.[/color]
        >
        >
        > I assume you mean a broader free community. There is a huge industry
        > behind ASP, and millions of people programming with it, but its all
        > high dollar. I'm impressed with the fact that when I open the
        > newspaper and look at the want ads there are several requests for ASP
        > and none for PHP. Yet if you go looking for advice, it is easy to find
        > tons of free advice and free code for PHP. With ASP, no one gives
        > advice without charging for it.[/color]

        As a former ASP coder that made the switch to PHP I'd refute this.
        There is a very strong usenet community standing behind ASP and many MVP
        stamped ASP related sites and tutorials. The job situation is very real
        however -- unfortunatly. I was originally hired as an ASP programmer
        and press-ganged my company into making the switch but I often feel like
        I am one of the few actually salaried out there.

        J

        Comment

        • Markus Ernst

          #5
          Re: Is PHP the easier web programming language?

          Marta wrote:[color=blue]
          > Hi all!
          >
          > I would to study a web programming language to create a PHP script
          > (output.php) that, given the following
          > input page (input.htm) where the user select the weight and volume of
          > a package to be shipped, returns the prices of various couriers
          > ("yellow", "blue" and "black").
          > Really is PHP my best choice? ASP is much more complicated? and what
          > about Perl?[/color]

          Is ASP as such still existing? I think if you look forward your decision is
          actually between the .NET world and the open source world. If you prefer
          working with an editor that does a huge part of the coding for you, and
          don't really care about how it works if it works at last, you might prefer
          the .NET way (of course you will have to pay for the convenience). If you
          prefer having control over your code you will prefer the open source way,
          and thus learn PHP.

          --
          Markus


          Comment

          • Jordon Bedwell

            #6
            Re: Is PHP the easier web programming language?

            PHP is a good language if you have time. ASP sucks outright and CFML is your
            best source for Robust Rapid Development!

            PHP = Available on 99.99% of all servers

            ASP = Only on crappy windows mostly

            CFML = Available on all OS's if your Service providers offer it, but alot
            are getting up to running CFML since its becomming a widely used language!

            P.D.

            Perl is the lanauge that php started from if im correct !!!

            "Markus Ernst" <derernst@NO#SP #AMgmx.ch> wrote in message
            news:41a1ac98$0 $23630$afc38c87 @news.easynet.c h...[color=blue]
            > Marta wrote:[color=green]
            >> Hi all!
            >>
            >> I would to study a web programming language to create a PHP script
            >> (output.php) that, given the following
            >> input page (input.htm) where the user select the weight and volume of
            >> a package to be shipped, returns the prices of various couriers
            >> ("yellow", "blue" and "black").
            >> Really is PHP my best choice? ASP is much more complicated? and what
            >> about Perl?[/color]
            >
            > Is ASP as such still existing? I think if you look forward your decision
            > is actually between the .NET world and the open source world. If you
            > prefer working with an editor that does a huge part of the coding for you,
            > and don't really care about how it works if it works at last, you might
            > prefer the .NET way (of course you will have to pay for the convenience).
            > If you prefer having control over your code you will prefer the open
            > source way, and thus learn PHP.
            >
            > --
            > Markus
            >[/color]


            Comment

            • Ginzo

              #7
              Re: Is PHP the easier web programming language?

              >Perl is the lanauge that php started from if im correct !!!

              Wrong.

              Ciao,


              Ginzo
              ---------------------------------
              War is god's way of teaching
              Americans geography
              -- Ambrose Bierce
              ---------------------------------

              Comment

              • Bill Bablefesche

                #8
                Re: Is PHP the easier web programming language?

                >> Perl is the lanauge that php started from if im correct !!![color=blue][color=green]
                >>[/color]
                > Wrong.
                >
                > Ciao,
                >
                > Ginzo
                > ---------------------------------
                > War is god's way of teaching
                > Americans geography[/color]

                Yes! PHP began as PHP/FI in 1995 as a set of Perl scripts.




                --splatter

                Comment

                • d

                  #9
                  Re: Is PHP the easier web programming language?

                  Perl is a completely different language. PHP just borrowed some good ideas
                  from it, hence the similarity.

                  Perl still has lots of very good uses out there ;)

                  "Jordon Bedwell" <subluj@talkame rica.net> wrote in message
                  news:cojj7i$hfg $1@news.chatlin k.com...[color=blue]
                  > PHP is a good language if you have time. ASP sucks outright and CFML is
                  > your best source for Robust Rapid Development!
                  >
                  > PHP = Available on 99.99% of all servers
                  >
                  > ASP = Only on crappy windows mostly
                  >
                  > CFML = Available on all OS's if your Service providers offer it, but alot
                  > are getting up to running CFML since its becomming a widely used language!
                  >
                  > P.D.
                  >
                  > Perl is the lanauge that php started from if im correct !!!
                  >
                  > "Markus Ernst" <derernst@NO#SP #AMgmx.ch> wrote in message
                  > news:41a1ac98$0 $23630$afc38c87 @news.easynet.c h...[color=green]
                  >> Marta wrote:[color=darkred]
                  >>> Hi all!
                  >>>
                  >>> I would to study a web programming language to create a PHP script
                  >>> (output.php) that, given the following
                  >>> input page (input.htm) where the user select the weight and volume of
                  >>> a package to be shipped, returns the prices of various couriers
                  >>> ("yellow", "blue" and "black").
                  >>> Really is PHP my best choice? ASP is much more complicated? and what
                  >>> about Perl?[/color]
                  >>
                  >> Is ASP as such still existing? I think if you look forward your decision
                  >> is actually between the .NET world and the open source world. If you
                  >> prefer working with an editor that does a huge part of the coding for
                  >> you, and don't really care about how it works if it works at last, you
                  >> might prefer the .NET way (of course you will have to pay for the
                  >> convenience). If you prefer having control over your code you will prefer
                  >> the open source way, and thus learn PHP.
                  >>
                  >> --
                  >> Markus
                  >>[/color]
                  >
                  >[/color]


                  Comment

                  • Razzbar

                    #10
                    Re: Is PHP the easier web programming language?

                    lkrubner@geocit ies.com (lawrence) wrote in message news:<da7e68e8. 0411201934.73a3 d1f8@posting.go ogle.com>...[color=blue]
                    > "Jeb Hunter" <jebhunter@mail .com> wrote in message news:<cbmdnX37P ZTs-gLcRVn-1Q@comcast.com> ...[color=green]
                    > > Personally, I lean towards PHP these days just because there seems to be a
                    > > broader community of support for it.[/color]
                    >
                    > I assume you mean a broader free community. There is a huge industry
                    > behind ASP, and millions of people programming with it, but its all
                    > high dollar. I'm impressed with the fact that when I open the
                    > newspaper and look at the want ads there are several requests for ASP
                    > and none for PHP.[/color]

                    Ha, I don't find many ads for either language!
                    [color=blue]
                    > Yet if you go looking for advice, it is easy to find
                    > tons of free advice and free code for PHP. With ASP, no one gives
                    > advice without charging for it.[/color]

                    YES! I've noticed that with MS products in general. Even though there
                    is a much larger installed base of products, it's -much- harder to
                    get information via newsgroups. I've often wondered if that might
                    be a money mentality at work, with the MS people thinking that if
                    they shared their knowledge, they'd be undermining themselves in
                    consideration of supply and demand. I've overheard this sentiment
                    expressed seriously, too -- "you don't want to tell people how
                    you do it"...

                    You might run into this attitude in the PERL and PHP communities,
                    but it seems to be much more so in the ASP community.

                    Which language to study? I prefer using PHP, ASP and PERL in
                    that order. PERL is way too hard to read, and I've only done
                    a little work in it. I'd advise getting your feet wet in all
                    three. That way you get an insight to how web programming in
                    general works. There are principles that apply to all three
                    languages.

                    One advantage to PERL is that it's a "CGI" approach to web
                    programming, which is worth understanding. With CGI, you
                    can use -any- language that runs on the server. The -only-
                    reason PERL has long been considered "the" language for
                    server-side programming is that a lot of people already
                    knew PERL when HTTP came along. It was an already existing
                    language which was well suited to the job.

                    Comment

                    • Razzbar

                      #11
                      Re: Is PHP the easier web programming language?

                      "d" <d@example.co m> wrote in message news:<lKLrd.650 21$F7.36820@fe1 .news.blueyonde r.co.uk>...[color=blue]
                      > Perl is a completely different language. PHP just borrowed some good ideas
                      > from it, hence the similarity.
                      >[/color]
                      How completely is "completely "? Both are still imperative procedural
                      languages. Same step-by-step thought process in both languages.

                      Not as different as Lisp is from BASIC, eg.
                      [color=blue]
                      > Perl still has lots of very good uses out there ;)[/color]

                      Sure.

                      Comment

                      • d

                        #12
                        Re: Is PHP the easier web programming language?

                        Completely as in PHP isn't "based" on anything in particular. The phrasing
                        of the first post insinuated PHP was a direct descendent of perl.

                        By your logic, a horse is a direct descendent of a dog - 4 legs, head, tail
                        ;)

                        "Razzbar" <glakk@potatora dio.f2s.com> wrote in message
                        news:c48470fc.0 412030948.2bbc5 a6e@posting.goo gle.com...[color=blue]
                        > "d" <d@example.co m> wrote in message
                        > news:<lKLrd.650 21$F7.36820@fe1 .news.blueyonde r.co.uk>...[color=green]
                        >> Perl is a completely different language. PHP just borrowed some good
                        >> ideas
                        >> from it, hence the similarity.
                        >>[/color]
                        > How completely is "completely "? Both are still imperative procedural
                        > languages. Same step-by-step thought process in both languages.
                        >
                        > Not as different as Lisp is from BASIC, eg.
                        >[color=green]
                        >> Perl still has lots of very good uses out there ;)[/color]
                        >
                        > Sure.[/color]


                        Comment

                        • Razzbar

                          #13
                          Re: Is PHP the easier web programming language?

                          "d" <d@example.co m> wrote in message news:<f34sd.709 45$F7.55735@fe1 .news.blueyonde r.co.uk>...[color=blue]
                          > Completely as in PHP isn't "based" on anything in particular. The phrasing
                          > of the first post insinuated PHP was a direct descendent of perl.
                          >[/color]
                          .... which it is not. However...

                          PHP has some "genes" from PERL. You can tell the creators have experience
                          with PERL.

                          Of course PHP is not "based" on any language in particular. Not in the way
                          that Modula is based on Pascal, or C++ is based in C.

                          But PHP is still belongs to family of languages: Procedural languages like
                          C, BASIC, Pascal.... in contrast to a declarative language like SQL.

                          [color=blue]
                          > By your logic, a horse is a direct descendent of a dog - 4 legs, head, tail
                          > ;)[/color]

                          No, but they share some traits. Did those traits develop independantly
                          of one another? Is it just a coincidence that both animals are so
                          similar, or do they possibly have common ancestry? Is it mere
                          coincidence that PERL and PHP both have features (such as the
                          notion of a 'here document') that aren't found in other languages?

                          PHP didn't 'descend from' PERL, but there certainly is some influence.

                          Comment

                          • Andy Hassall

                            #14
                            Re: Is PHP the easier web programming language?

                            On 5 Dec 2004 10:27:04 -0800, glakk@potatorad io.f2s.com (Razzbar) wrote:
                            [color=blue]
                            >"d" <d@example.co m> wrote in message news:<f34sd.709 45$F7.55735@fe1 .news.blueyonde r.co.uk>...[color=green]
                            >> Completely as in PHP isn't "based" on anything in particular. The phrasing
                            >> of the first post insinuated PHP was a direct descendent of perl.
                            >>[/color]
                            >... which it is not. However...
                            >
                            >PHP has some "genes" from PERL. You can tell the creators have experience
                            >with PERL.[/color]

                            PHP/FI, that-which-was-rewritten-to-become PHP, was actually written in Perl.

                            --
                            Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
                            <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

                            Comment

                            • Bruce Lewis

                              #15
                              Re: Is PHP the easier web programming language?

                              "Marta" <marta@mariapia .com> writes:
                              [color=blue]
                              > Hi all!
                              >
                              > I would to study a web programming language to create a PHP script
                              > (output.php) that, given the following
                              > input page (input.htm) where the user select the weight and volume of a
                              > package to be shipped, returns the prices of various couriers ("yellow",
                              > "blue" and "black").
                              > Really is PHP my best choice? ASP is much more complicated? and what about
                              > Perl?[/color]

                              This sounds a lot like a homework problem, but if so, by now the
                              assignment must have been due already.

                              Here is a BRL version for you to compare against PHP, ASP and Perl
                              solutions.

                              [
                              (define-input (string->number volume) (string->number weight))
                              (define yellow-rate
                              (case weight
                              ((100) 600)
                              ((200) 900)
                              ((300) 1200)))
                              (define blue-rate
                              (and (< volume 3)
                              (case weight
                              ((100) 400)
                              ((200) 700)
                              (else #f))))
                              (define black-rate
                              (and (> volume 1)
                              (case weight
                              ((100) 800)
                              ((200) 1100)
                              ((300) 1500))))

                              ] courier "yellow" = [yellow-rate]
                              [(brl-when blue-rate
                              ] courier "blue" = [blue-rate]
                              [)]
                              [(brl-when black-rate
                              ] courier "black" = [black-rate]
                              [)]


                              [color=blue]
                              > ~~~ input page input.htm:
                              >
                              > <form method="GET" action="output. php" name="input">
                              >
                              > SELECT THE VOLUME OF YOUR PACKAGE:
                              >
                              > <input type="radio" name="volume" value="1"> from 0 to 1 m3
                              > <input type="radio" name="volume" value="2"> from 1 to 2 m3
                              > <input type="radio" name="volume" value="3"> from 2 to 3 m3
                              >
                              > <br>SELECT THE WEIGHT OF YOUR PACKAGE:
                              >
                              > <input type="radio" name="weight" value="100"> from 0 to 100 Kg
                              > <input type="radio" name="weight" value="200"> from 100 to 200 Kg
                              > <input type="radio" name="weight" value="300"> from 200 to 300 Kg
                              >
                              > </form>
                              >
                              > ~~~ istructions to be integrated in the "output.php " script:
                              >
                              > Courier "yellow" - for volume 1, 2 and 3:
                              > if weight=100 then rate=600
                              > if weight=200 then rate=900
                              > if weight=300 then rate=1200
                              >
                              > Courier "blue" - for volume 1 and 2:
                              > if weight=100 then rate=400
                              > if weight=200 then rate=700
                              >
                              > Courier "black" - for volume 2 and 3:
                              > if weight=100 then rate=800
                              > if weight=200 then rate=1100
                              > if weight=300 then rate=1500
                              >
                              >
                              > ~~~ sample request and result:
                              >
                              > Example A) With the user input:
                              > volume=2
                              > weight=300
                              >
                              > output.php must generate this result:
                              > courier "yellow" = 1200
                              > courier "black" = 1500
                              >
                              >
                              > Example B) With the user input:
                              > volume=1
                              > weight=100
                              >
                              > output.php must generate this result:
                              > courier "yellow" = 600
                              > courier "blue" = 400
                              >
                              >
                              >
                              >
                              >[/color]

                              --

                              http://ourdoings.com/ Let your digital photos organize themselves.
                              Sign up today for a 7-day free trial.
                              I rarely read mail sent to brlspam@yahoo.c om

                              Comment

                              Working...