php vs asp

macromp

the retarded one
Joined
29 Jul 2002
Messages
426
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?
 
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.
 
both pretty good IMO, php is a bit simpler to get started and has some better built in functions
 
awesome thanks, i'll look into those more xtweaker, what are some of the better functions khayman?
 
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.
 
btw xtweaker, about the syntax thing, do you happen to have any sample code of the same thing in php and asp?
 
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>
 
macromp said:
btw xtweaker, about the syntax thing, do you happen to have any sample code of the same thing in php and asp?
I think Geffy pretty much just did that for me ;)

Thanks Geffy!
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back