• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

php vs asp

macromp

the retarded one
#1
i've got to do some research for a uni project, stuff about asp and php, i want to make php sound like the better option (i have no idea if it is or isn't). can anyone give me a few pointers on what to research, what php does better than asp. the person who did the coding for our project only knows php and i'm doing the research bit so he doesnt know either. help?
 

xtweaker

Tweaking Monkey
#2
First thing that comes to mind is that PHP is open source, has a huge community for support and is cross-plateform.

It's also natively meant to interface MySQL and SQL databases, and the database access functions are much simplier from what I know about it.

And personally, I find the syntax of PHP to be much clearer than ASP and more straight-to-the-point.

Also, you're much more likely to find free pferabs in PHP than in ASP from what I could see (free PHP utilities, and such). I guess it all depends where you search, but it just seems easier to find free code when it's in PHP.
 

Khayman

I'm sorry Hal...
Political User
#3
both pretty good IMO, php is a bit simpler to get started and has some better built in functions
 

X-Istence

*
Political User
#6
macromp said:
awesome thanks, i'll look into those more xtweaker, what are some of the better functions khayman?
Ive never used ASP, but PHP has extensive support for different databases, contains full support for OOP in PHP5, and is an extremely fast langauge, that is suitable for everything.

It comes builtin with not that much stuff, but once you add a few modules which almost come standard, you get built in crypto functions, sockets to connect to servers, file manipulation, regular exrpression functions, and above all, a huge community to help you out if you have a problem.
 
#8
ASP: Getting a Record from a Database

PHP: Listing from a Database

code sample for each language showing how to get information from a database. The ASP one is using Embedded Scripting which is also possible with PHP, and the PHP one is using script which generates the HTML. They are two different methods of doing the same thing. Its late right now, but tomorrow I might port the ASP example into PHP as I know PHP and not ASP.

what can I say I got bored :p
Here is the ASP example ported over to PHP, sorta stipped out the comments, sorry :)
PHP:
<HTML>
<HEAD>
<TITLE>PROVA ASP</TITLE>
</HEAD>
<BODY>
<?php
mysql_connect('localhost','username','password');
mysql_select_db('databasename');

// SQL Select query
$result = mysql_query("SELECT * FROM Studenti");

// Check if we had an error
if (mysql_error()) {
    echo "Unable to retrieve record";
} else {
?>
<div align="center">
  <center>
  <table border="1" bordercolor="#111111" width="50%" id="AutoNumber1">
    <?php
    while($row = mysql_fetch_array($result)) {
    ?>
    <tr>
    <td width="25%">
    <?php echo $row['id']; ?>&nbsp;</td>
    <td width="25%">
    <?php echo $row['nome']; ?>&nbsp;</td>
    <td width="25%">
    <?php echo $row['Cognome']; ?>&nbsp;</td>
    <td width="25%">
    <?php echo $row['Data']; ?>&nbsp;</td>
    </tr>
    <?php } ?>
</table>
<?php mysql_close(); ?>
  </center>
</div>
</BODY>
</HTML>
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,015
Latest member
sanoravies