Brief comparison of PHP and ASP Dec04 '05

Feedback

# (1 of 6): Dale » bluetrait.com

1 week, 3 days after the fact. (Wed 14 Dec 2005, 10:00 PM CST)

You can use $_REQUEST in php. This takes into account $_GET, $_POST and $_COOKIE.

http://www.php.net/reserved.variables

# (2 of 6): Matthom

1 week, 4 days after the fact. (Thu 15 Dec 2005, 11:22 AM CST)

Interesting... thanks Dale. Another example of the versatility that PHP has over ASP.

Previous comment Return to entry

# (3 of 6): Josh » joahua.com/blog

2 weeks, 1 day after the fact. (Tue 20 Dec 2005, 3:47 AM CST)

Mmm... dubious about the security of such versatility, though. PHP has earnt a bad rep for such things, even if people generally consider IIS/Microsoft stuff to be not much better!

Previous comment Return to entry

# (4 of 6): Matthom

2 weeks, 2 days after the fact. (Tue 20 Dec 2005, 8:08 AM CST)

PHP Security to the rescue!

Previous comment Return to entry

# (5 of 6): Scott

1 year, 8 months after the fact. (Tue 21 Aug 2007, 12:30 AM CST)

A little late to the game, I realize, but just in case anyone happens to come across this via Google...

No "total rows" function after a query Try: result.RecordCount

Formatting code Try: vbCrLf (e.g. "My string"&vbCrLf)

Basically each language has its strengths... ASP/ADO is much more intuitive for handling DB work, PHP kicks ass when dealing with file management & arrays, both are pretty comparable in dealing with strings (I would argue that PHP is a little superfluous/redundant with its string functions).

Hope that helps!

Previous comment Return to entry

# (6 of 6): James » cj-design.com

2 years, 1 month after the fact. (Thu 24 Jan 2008, 10:59 AM CST)

Hi,

Great post.

I use both PHP and ASP and have to say you are almost spot on in your comparison of the two.

Here I look at some alternatives for ASP, if available....

No "quick" operators - CORRECT, totally agree that PHP is superior

No "total rows" function - CORRECT, although there are better ways to count rows than your example in ASP;

a) use SELECT COUNT(*) (- drawback is that you have to perform two queries) b) use numRows = uBound(query.GetRows(), 2) + 1 (- better than your example and pretty quick, even with thousands of rows - more than this should probably use the above SQL method) c) use one of the ADO methods to retrieve the RecordCount (sometimes not available).

Formatting code - CORRECT, you can also use:

"my string " & vbcrlf & vbcrlf

Passing variables across pages - ALMOST CORRECT

With ASP you should say that it uses Request.QueryString("page") instead of PHP's $GET and Request.Form("apples") instead of PHP's $POST. The "Global" Request("var") will look in the querystring first, then the post, then the session, then the cookie - so its best to use the former method(s). Likewise, PHP has global variables $_GLOBALS.

No associative arrays! - This is what annoys me the most

You can, however, use the ASP dictionary object - but it still requires functions to help sort etc. So I agree that PHP is far superior when it comes to arrays functions.

PHP vs. ASP - which is better?

PHP for sure!

But people tend to pay more for ASP because they trust Microsoft! :p

Cheers

James

Previous comment Return to entry

RSS feed for comments on this post

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

Return to entry.

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

I’ve been using ASP at work, and other than it being a completely out-dated language, there’s so many little differences (annoyances), as compared to PHP.

You are at the feedback permalink page for: Brief comparison of PHP and ASP

Read more...