Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / ASP or PHP ?

Author
Message
Damokles
21
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 26th Jan 2004 13:48 Edited at: 26th Jan 2004 13:49
Rigth now, I'm trying to learn PHP, thanks to www.asp-php.net.

It works pretty good ... but they always write the codes for ASP and PHP on the same page. So I realised ASP looked pretty much like BASIC. (you can look at the link above : ASP-code is in green and PHP in cyan)

So, before I go further, I would like to know the advantages of each :
Can they be used everywhere ? Could there be some problems with one ? Is one of them more used than the other ? Why ? ...

What do you think about it ?

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 26th Jan 2004 14:10
ASP can be written in either VBScript or JScript so obviously if you know either VB or Javascript then you'll find it mcuh easier then PHP. The main downfall is that ASP basically only runs on IIS which isn't used quite as much as something like Apache. Although I do believe you can get a modified version of ASP to run on Apache, it's not quite the same and most servers won't support it anyway.

PHP on the other hand is generally a more versatile language and will run on most servers. A lot more people use PHP and it's basically becoming the new CGI. PHP also has a lot of really useful commands that you might not find in ASP.

Personally, although I know both, I prefer PHP - in fact, the only time I ever use ASP is when the server is IIS.


"Computers are useless they can only give you answers."
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Jan 2004 14:31
PHP - multi-platform (portable), lots of support
ASP - fast learning curve if you already know VB/VBA/VBscript. Restricted platforms, tied to MS technology.

It's a difficult call, depends on your circumstances. I loaded IIS, PHP and MySQL, for the first time, in less than 2 hours. However, ASP is there as soon as IIS is loaded.

Security is a different matter altogether, I couldn't comment on that aspect.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 26th Jan 2004 15:04
Having used both, I would go for PHP.

It has far more built-in functions than ASP, it is pretty easy to learn, and very flexible. Plus the PHP documentation is far superior to the MSDN docs, and it is a more widely used scripting language.

In my experience ASP is slower as well, although that probably has more to do with the server (but PHP runs 20% faster on my home PC).

PHP script looks rather like Java or C, but its easy to learn.

On the other hand, ASP can integrate with scripting objects rather like VBScript, but its not a very convenient way of doing things.


BlueGUI Plugin:http://blue.robert-knight.net / BlueIDE http://blueide.sf.net-Free Replacement editor for DBPro
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 26th Jan 2004 17:14
Quote: "
PHP script looks rather like Java or C, but its easy to learn.
"


You say that like "C" and "Easy to Learn" are mutually exclusive!



Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Jan 2004 17:56 Edited at: 26th Jan 2004 17:57
At the university I had a chance to take basic classes in both ASP and PHP. One thing that really made me go for PHP is that I found it easier to use then ASP. For example with ASP you need 2-4 lines of code that even our teacher didn't knew what they did exactly just to connect to an SQL database. With PHP you use a single function: @mysql_connect(url, login, pass). If you want to print out something to HTML you use 'document.write' in ASP but in PHP you use 'echo' or 'print'.

PHP often have a more BASIC way of doing things if you are more comfortable with that. The only problem with PHP is that you need ; after every line. Some may find using {} a problem but I code like this, making it look like BASIC and is far more readable then what I see on the net: click the source button...

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 26th Jan 2004 19:32
ASP:

response.write "The value of myvar is " + str(myvar)

or PHP:

print("The value of myvar is $myvar");

ASP:

Server.Transfer "includes/include.asp"

or PHP:

include "includes/include.asp"


BlueGUI Plugin:http://blue.robert-knight.net / BlueIDE http://blueide.sf.net-Free Replacement editor for DBPro
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 27th Jan 2004 06:26
Rob:
PHP print/echo does not use (). So it should be:

"The value of myvar is $myvar"

The thing with PHP is that if you use "" all variables (word with $) will be replaced by it's value. Using '' and it will print out $myvar instead of the value of $myvar.

You can also do it like this, the way I prefer to do it:

print 'The value of myvar is ' . $myvar

PHP doen't bother about variable types $myvar can be integer, float, string or any type of array. You can do things like:

$var['name'] = 'Dead Glory';
$var['country'] = 'Sweden';
$var[1] = 1;
$var[2] = 2;

Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 27th Jan 2004 13:04
@Dead Glory

Print() can use parentheses, and I do use them just for consistancy.


BlueGUI Plugin:http://blue.robert-knight.net / BlueIDE http://blueide.sf.net-Free Replacement editor for DBPro
Damokles
21
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 27th Jan 2004 19:09
Well, thank you very much, guys.

So I think I will go on with PHP

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 27th Jan 2004 19:32
Horray. He chose right. Onto round two.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 28th Jan 2004 19:08
Rob:
I see. Well I use echo without () all the time anyway

Login to post a reply

Server time is: 2024-11-24 15:48:51
Your offset time is: 2024-11-24 15:48:51