473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

Jul 17 '05 #1
18 2618
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.
Jul 17 '05 #2
"Jeb Hunter" <je*******@mail.com> wrote in message news:<cb********************@comcast.com>...
Personally, I lean towards PHP these days just because there seems to be a
broader community of support for it.


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.
Jul 17 '05 #3
JAS
lawrence wrote:
"Jeb Hunter" <je*******@mail.com> wrote in message news:<cb********************@comcast.com>...
Personally, I lean towards PHP these days just because there seems to be a
broader community of support for it.

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.


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
Jul 17 '05 #4
Marta wrote:
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?


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
Jul 17 '05 #5
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:41***********************@news.easynet.ch...
Marta wrote:
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?


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

Jul 17 '05 #6
>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
---------------------------------
Jul 17 '05 #7
>> Perl is the lanauge that php started from if im correct !!!

Wrong.

Ciao,

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


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

http://us2.php.net/history
--splatter

Jul 17 '05 #8
d
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" <su****@talkamerica.net> wrote in message
news:co**********@news.chatlink.com...
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:41***********************@news.easynet.ch...
Marta wrote:
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?


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


Jul 17 '05 #9
lk******@geocities.com (lawrence) wrote in message news:<da**************************@posting.google. com>...
"Jeb Hunter" <je*******@mail.com> wrote in message news:<cb********************@comcast.com>...
Personally, I lean towards PHP these days just because there seems to be a
broader community of support for it.
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.


Ha, I don't find many ads for either language!
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.


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.
Jul 17 '05 #10
"d" <d@example.com> wrote in message news:<lK******************@fe1.news.blueyonder.co. uk>...
Perl is a completely different language. PHP just borrowed some good ideas
from it, hence the similarity.
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.
Perl still has lots of very good uses out there ;)


Sure.
Jul 17 '05 #11
d
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" <gl***@potatoradio.f2s.com> wrote in message
news:c4**************************@posting.google.c om...
"d" <d@example.com> wrote in message
news:<lK******************@fe1.news.blueyonder.co. uk>...
Perl is a completely different language. PHP just borrowed some good
ideas
from it, hence the similarity.

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.
Perl still has lots of very good uses out there ;)


Sure.

Jul 17 '05 #12
"d" <d@example.com> wrote in message news:<f3******************@fe1.news.blueyonder.co. uk>...
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.
.... 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.

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


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.
Jul 17 '05 #13
On 5 Dec 2004 10:27:04 -0800, gl***@potatoradio.f2s.com (Razzbar) wrote:
"d" <d@example.com> wrote in message news:<f3******************@fe1.news.blueyonder.co. uk>...
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.

... which it is not. However...

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


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

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #14
"Marta" <ma***@mariapia.com> writes:
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?
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]
[)]
~~~ 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



--

http://ourdoings.com/ Let your digital photos organize themselves.
Sign up today for a 7-day free trial.
I rarely read mail sent to br*****@yahoo.com
Jul 17 '05 #15
Perhaps it's needless semantic bickering; but the post made it sound
as if he thought PHP had eveloved from Perl; which is absolutely not
true.

On 01 Dec 2004 16:06:41 GMT, Bill Bablefesche <bb****@nerspampalm.com>
wrote:
Perl is the lanauge that php started from if im correct !!!

Wrong.

Ciao,

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


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

http://us2.php.net/history
--splatter

Ciao,
Ginzo
---------------------------------
War is god's way of teaching
Americans geography
-- Ambrose Bierce
---------------------------------
Jul 17 '05 #16
> This sounds a lot like a homework problem, but if so, by now the
assignment must have been due already.
I can absure it was a business need. I finally paid $20 to a programmer to
have it done :)
Here is a BRL version for you to compare against PHP, ASP and Perl
solutions.


Anyway, I'm curious about this BRL. Why did you decide to study this minor
language?
Your code would be useful to me but I'm feared that I'ld be in difficulty
when I'll need to improve it. How many people knows BRL?

M.
Jul 17 '05 #17
"Marta" <ma***@mariapia.com> writes:
Anyway, I'm curious about this BRL. Why did you decide to study this minor
language?
I learned Scheme in college, and created BRL by extending Scheme in a
way that was suitable for server-side web programming. That's actually
an oversimplification. There were 12 years of C programming in
between.
Your code would be useful to me but I'm feared that I'ld be in difficulty
when I'll need to improve it. How many people knows BRL?


Hundreds of high schools and colleges use Scheme in the course of
teaching other topics, because it's such an easy language that one can
focus most of the course on topics rather than nitty-gritty syntax
details. It's a simple step from Scheme to BRL.

Scheme programming is fun. Post a problem in comp.lang.scheme and once
people decide it isn't homework you'll get 5 or so solutions.

Note that despite PHP's reputation as being easy and fun, nobody would
supply you a PHP solution without being paid for it.

--

http://ourdoings.com/ Let your digital photos organize themselves.
Sign up today for a 7-day free trial.
Jul 17 '05 #18
Jordon Bedwell wrote:
PHP is a good language if you have time. ASP sucks outright


A major problem with PHP is that it gives you less help with finding
mistakes.

If you use Perl, just use the -w option and "use strict", and it'll
tell you about things like undeclared (e.g. mis-spelled) variables
when you test your script from the command line. This is a huge
time-saver. PHP has no equivalent - you can set error_reporting to
E_ALL, but it's only for runtime errors. It won't detect an error in a
code path until that path gets executed.

(Arguably, this is a problem with PHP's current implementations, not
the language.)

BTW I agree with you about ASP. Learning something that works only on
one family of operating systems is a bad thing to do anyway.

Jul 17 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marta | last post by:
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...
17
by: Rob | last post by:
i know javascript, vbscript, asp css and alot more and im only 14 i was wondering which is easier to learn php or cgi. any help?
73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
13
by: cjl | last post by:
Hey all: I'm working on a 'pure' python port of some existing software. Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be...
3
by: user | last post by:
Hi all, At the outset, I regret having to post this slightly OT post here. However, I strongly feel that people in this group would be the best to advise me on my predicament. I am working as...
66
by: Mitchell S. Honnert | last post by:
In some recent posts, I've seen people who seem to be waxing nostalgic with respect to the "ease of use" of Visual Basic 6. I can't quite put my finger on it, but they seem to be implying that VB6...
13
by: dm1608 | last post by:
I know all the hype right now from Microsoft is how much easier, faster, and less code ASP.NET 2.0 provides over previous versions. I'm puzzled by this as I could turn out an classic ASP webpage...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
3
by: Greg | last post by:
Lately I have been Customizing C commands into another language (Shona) to facilitate easier learning of C by Shona speaking people using pre-processor directives i.e. (#include define) is there...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.